The Digital Voting System is a secure, user-friendly platform designed to facilitate remote voting processes, ensuring that each vote is counted accurately and efficiently. This system is ideal for organizations, educational institutions, and communities that require a reliable method to conduct elections and polls online.
- Create, read, update, and delete requests for help.
- User authentication and authorization.
- Secure API endpoints with JWT (JSON Web Token) security.
- Data storage with MySQL.
- Tested with Postman for comprehensive API validation.
- Unit and integration tests using Mockito and JUnit.
- Backend: Java Spring Boot
- Database: MySQL
- Security: Spring Security with JWT
- Testing: Postman, Mockito, JUnit
- Java 11 or higher
- Maven
- MySQL Server
- Postman (for testing)
-
Clone the repository:
git clone https://github.com/chetanlamani/digital voting system.git cd digital voting system
-
Configure MySQL:
- Install MySQL Server if you haven't already.
- Create a database named online voting system_db.
- Create a user with appropriate permissions and set the password.
-
Set up environment variables:
Create a .env file in the root directory and add the following:
SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/online voting system_db SPRING_DATASOURCE_USERNAME= SPRING_DATASOURCE_PASSWORD= SPRING_JPA_HIBERNATE_DDL_AUTO=update
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
The API is documented using Swagger. Once the application is running, you can access the API documentation at:
http://localhost:8080/swagger-ui.html
A Postman collection is included in the repository. Import digital voting system.postman_collection.json into Postman to test the API endpoints.
The project includes unit and integration tests using Mockito and JUnit. To run the tests, use the following command:
mvn test
The application uses Spring Security with JWT to secure API endpoints. Ensure that you configure proper security measures and handle sensitive data responsibly.
Contributions are welcome! Please open an issue or submit a pull request.
If you have any questions or feedback, please reach out to us at chetanlamani3995@gmail.com