The Online Voting System is a web application that allows users to register, log in, and vote for candidates in an election. The system includes both a frontend and a backend, providing a complete solution for managing elections online.
- User registration and login
- Admin dashboard for managing voters and candidates
- Voter dashboard for viewing profile and voting
- Real-time vote counting and results display
- Secure authentication using JWT tokens
- Frontend: React, Vite, React Router
- Backend: Spring Boot, JPA, MySQL , JWT
-
Clone the repository:
git clone https://github.com/Polymath-Saksh/Online-Voting-System.git cd Online-Voting-System/voting-spring -
Configure the database:
- Create a MySQL database named
voting_system. - Update the
application.propertiesfile with your database credentials.
- Create a MySQL database named
-
Build and run the backend:
./mvnw spring-boot:run
-
Navigate to the frontend directory:
cd ../frontend_voting/voting-app-frontend -
Install dependencies:
npm install
-
Run the frontend:
npm run dev
POST /voters/register: Register a new voterPOST /voters/login: Login a voter and issue a JWT tokenGET /voters/me: Get logged-in voter detailsPUT /voters/{id}: Update voter details
GET /admin/voters: Get all votersPUT /admin/voters/{id}: Update voter detailsDELETE /admin/voters/{id}: Delete a voterPOST /admin/candidates: Add a new candidatePUT /admin/candidates/{id}: Update candidate detailsDELETE /admin/candidates/{id}: Delete a candidateGET /admin/results: Get election results
GET /candidates: Get all candidatesPOST /candidates/{id}/vote: Vote for a candidate
src/components: Contains reusable components likeHeader,HomePage,Table, etc.src/pages: Contains page components likeLoginPage,RegisterPage,AdminDashboard,VoterDashboard, etc.src/styles: Contains CSS files for styling the components and pages.
- Register a new voter using the registration page.
- Log in with the registered email and password.
- Admin users can access the admin dashboard to manage voters and candidates.
- Voter users can access the voter dashboard to view their profile and vote for candidates.
- View the election results on the results page.
We welcome contributions to the Online Voting System project. To contribute, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push them to your forked repository.
- Create a pull request with a detailed description of your changes.
This project is licensed under the MIT License - see the LICENSE file for details.