A secure and user-friendly web-based voting system built with Flask. This application allows users to register, login, and cast votes for presidential and vice-presidential candidates.
- User Authentication: Secure login and registration system
- Voting Interface: Intuitive voting interface for presidential and vice-presidential elections
- Admin Panel: Comprehensive admin dashboard for managing users, candidates, and results
- Real-time Results: Live vote counting and percentage calculations
- File Upload: Support for candidate photo uploads
- Password Recovery: Forgot password functionality with email-based reset
- Responsive Design: Modern, mobile-friendly interface
- Backend: Flask (Python)
- Database: SQLite
- Frontend: HTML, CSS, JavaScript
- Security: Werkzeug password hashing
- File Handling: Secure file uploads with validation
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/josiaO/voting_system.git cd voting_system
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python src/app.py
-
Access the application: Open your browser and navigate to
http://localhost:5000
- Registration Number: ADMIN001
- Password: admin@may2025
- Register: Create a new account with your details
- Login: Use your registration number and password
- Vote: Select your preferred candidates for president and vice-president
- View Results: See real-time voting results and percentages
- Login: Use the admin account credentials
- Manage Users: View, edit, and delete user accounts
- Add Candidates: Upload candidate photos and information
- Announce Winners: Declare election winners
- Post Messages: Broadcast messages to all users
voting_system/
├── src/
│ ├── app.py # Main Flask application
│ ├── static/
│ │ ├── asset/ # Uploaded candidate photos
│ │ ├── scripts/ # JavaScript files
│ │ └── styles/ # CSS stylesheets
│ └── templates/ # HTML templates
├── voting.db # SQLite database
├── requirements.txt # Python dependencies
└── README.md # This file
- Registration number, full name, email, phone, level
- Password (hashed), admin status, creation tracking
- Name, position (president/vice), photo path
- Education, course information
- User ID, president choice, vice choice
- Position, candidate ID, announcement timestamp
- Password hashing using Werkzeug
- Session management
- File upload validation
- SQL injection prevention
- XSS protection
- Supported Formats: JPG, JPEG, PNG
- Maximum Size: 5MB
- Storage Location:
src/static/asset/
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Barney Rolland, 2025. All rights reserved.
For support and questions, please open an issue on GitHub or contact the development team.
Note: This is a demonstration voting system. For production use, additional security measures and compliance with local election laws should be implemented.