This repository contains the code for an Online Voting System, which is a college project. The project aims to provide a secure and user-friendly platform for conducting online elections. It allows voters to register, log in, view candidates, and cast their votes electronically.
We welcome any suggestions and feedback to improve this project. Please feel free to open an issue or submit a pull request with your ideas and improvements.
To set up and run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/8harath/Online-Voting-System.git cd Online-Voting-System -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install the required dependencies:
pip install -r requirements.txt -
Initialize the database:
python database.py -
Run the application:
python app.py -
Open your web browser and navigate to
http://127.0.0.1:5000to access the application.
The project structure is as follows:
Online-Voting-System/
├── app.py # Main application file
├── database.py # Database connection and initialization
├── models.py # Data models for Voter, Candidate, and Vote
├── templates/ # HTML templates for the web application
│ ├── base.html
│ ├── index.html
│ ├── login.html
│ ├── register.html
│ ├── dashboard.html
│ ├── candidate_detail.html
│ └── vote_confirmation.html
├── static/ # Static files (CSS, JavaScript, images)
│ ├── css/
│ │ └── styles.css
│ ├── js/
│ │ └── script.js
│ └── images/
│ └── candidate_photos/
└── requirements.txt # List of required Python packages
- User Registration and Login: Users can register with their details and log in to the system.
- Dashboard: After logging in, users can access their dashboard to view available candidates.
- Candidate Details: Users can view detailed information about each candidate, including their promises, assets, liabilities, background, political views, and regional views.
- Voting: Users can cast their vote for a candidate. Once a vote is cast, it is recorded in the database, and the user cannot vote again.
- Vote Confirmation: After voting, users receive a confirmation with a reference number for their vote.
- Logout: Users can log out of the system securely.