The Voting App is a full-stack web application designed to facilitate elections. Built with React for the frontend, Express and Node.js for the backend, and MongoDB for the database, this application allows users to register as candidates or voters, participate in elections, and view results. The entire project has been Dockerized for simplified deployment and management.
- Frontend: React, React Router, Tailwind CSS
- Backend: Node.js, Express.js
- Database: MongoDB
ui/
: Contains the React frontend application, including all components, pages, and styling.server/
: Contains the Express backend application, including API routes, server configuration, and middleware.Dockerfile
: Configures Docker for the backend service, specifying build and runtime instructions.docker-compose.yml
: Manages multi-container Docker applications, orchestrating the deployment of both frontend and backend services.
-
🔐 User Authentication and Authorization: Secure login for officials, candidates, and voters.
-
📝 User Registration: Registration forms for both candidates and voters.
-
🗳️ Candidate Management: Approval and rejection of candidate applications by officials.
-
✅ Voter Management: Approval and rejection of voter registrations by officials.
-
🎯 Vote Casting: Interface for voters to cast their votes during an active election.
-
⚙️ Election Control: Features for officials to create, start, and stop elections.
-
📊 Result Viewing: Tabs for candidates, voters, and officials to view election results.
-
Candidate Registration: Register with details such as name, student ID, DOB, and email.
-
Voter Registration: Register and await approval from officials to participate in elections.
-
Election Participation: Approved voters can view candidates and cast their votes.
-
Results Viewing: View election results after the election period ends.
- Docker: Ensure Docker is installed on your machine. Install Docker
- Docker Compose: Ensure Docker Compose is installed. Install Docker Compose
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Build and start the application:
docker-compose up --build
This command builds the Docker images and starts the containers for both frontend and backend services.
- Frontend: Access the application at http://localhost:3000
- Backend: The backend API is available at http://localhost:5000
-
Environment Variables: Configure any required environment variables in the
.env
file.Create a
.env
file in the root directory with the following variables:MONGO_URI
: URI of your MongoDB databaseJWT_SECRET
: Secret key for JWTs
- Run Tests: Implement and run tests as needed for your application.
Feel free to submit issues, fork the repository, and create pull requests. Contributions are welcome!