Project Overview
The Real-Time Online Voting System Using Python and Flask, also known as VoteLive, is a web application designed to demonstrate digital voting and live election result management. It allows registered voters to participate in an active election while administrators manage candidates, voter accounts and election sessions through a dedicated dashboard.
The application uses Python, Flask, Flask-SocketIO and SQLite. Its main highlight is real-time vote counting: when a voter submits a vote, updated results are broadcast to connected browsers without requiring users to refresh the page.
This project is suitable for students who want practical experience with Python web development, database operations, authentication, role-based permissions and WebSocket-based communication.
Available Features
Voter Registration and Login
- Allow voters to register through the application.
- Support secure login using password hashing.
- Separate voter and administrator access.
- Manage voter account status.
Candidate Management
- Add, edit and delete candidates.
- Upload candidate photographs.
- Manage candidate names, election posts and symbols.
- Display photo-based and symbol-based ballot options.
Real-Time Voting
- Allow eligible voters to cast a vote during an active election session.
- Enforce one vote per voter.
- Prevent voting when the election session is inactive.
- Update vote counts and turnout across connected clients.
Live Results Dashboard
- Display live vote counts and turnout statistics.
- Show animated progress bars and percentage shares.
- Broadcast result changes using Flask-SocketIO.
- Update the results interface without a page refresh.
Election Session Control
- Start, stop and reset an election session.
- Enable or disable ballot access according to the session state.
- Manage the election title.
- Reflect changes to election status across connected browsers.
Voter Management
- View registered voter accounts.
- Enable, disable or delete voter accounts.
- Review voting status.
- Preserve account information when using the application's soft-disable functionality.
CSV Result Export
Administrators can export final election results in CSV format for record-keeping and further analysis.
Administrator Workspace
The administrator dashboard provides access to election statistics, candidate management, voter management and session controls. Administrators can start or stop voting, reset an election, change the election title and export final results.
Voter Workspace
Voters can create an account, sign in, view the available candidates and cast a vote while the election is active. The application enforces one-vote-per-voter rules and displays updated results through its live results interface.
Technology Stack
- Programming Language: Python 3.x
- Web Framework: Flask
- Real-Time Communication: Flask-SocketIO
- Database: SQLite
- Database ORM: Flask-SQLAlchemy
- Authentication: Flask-Login
- Password Security: Werkzeug password hashing
- Frontend: Jinja2 templates, custom CSS and JavaScript
- Live Updates: Socket.IO client
Database Modules
The SQLite database contains records for users, candidates, votes and election settings. User records include role and voting-status information. Candidate records store candidate details and photographs, while vote records associate a voter with a selected candidate and timestamp. Settings maintain information such as the election title and active session status.
Security Features
- Password hashing rather than storing plain-text passwords.
- Role-based access restrictions for administrators and voters.
- One-time vote enforcement at the application and database levels.
- Election session checks before accepting votes.
- Account disabling functionality.
- Secure filename handling for candidate photo uploads.
Software Requirements
- Python 3.x compatible with the project dependencies
- Visual Studio Code or another Python editor
- Packages listed in requirements.txt
- A modern web browser
Project Applications
- College election demonstrations
- Student council voting prototypes
- Club and association election simulations
- Academic projects demonstrating real-time web applications
- Learning WebSocket communication and voting integrity
Important Security Note
This project is an educational voting application. It should not be treated as a certified election platform for public or legally binding elections without independent security assessment, identity verification, privacy protections, accessibility testing and appropriate auditing.
Watch Project Demo
Watch Real-Time Online Voting System Using Python and Flask Demo
More Details and Full Documentation
View Online Voting System Using Python Details
- Install Python 3.x and Visual Studio Code on your computer.
- Extract the project files and open the project folder in VS Code.
- Open the integrated terminal in the project directory.
- Create a virtual environment using: python -m venv venv
- Activate the environment on Windows using: venv\Scripts\activate
- Install the required packages using: python -m pip install -r requirements.txt
- Check that the project configuration and required dependencies are available.
- Run the application using: python run.py
- If port 5000 is already in use, run the application with a custom port using: python run.py 5001
- Open http://127.0.0.1:5000/ in your browser, or use the configured custom port.
- Sign in with the default administrator credentials documented by the source: username admin123 and password admin123.
- Change the default administrator password before using the application beyond a local demonstration.
- Add candidates and configure the election title through the administrator workspace.
- Start the election session from the administrator dashboard.
- Register a voter account and sign in from a separate browser or private browsing window.
- Cast a vote and verify that the live results update without refreshing the page.
- Stop the election session and verify that ballot access is disabled.
- Export the final election results as a CSV file when required.
Stuck while running it? Chat with us on WhatsApp for free installation help.
No reviews yet. Be the first to review this project.