A secure, web-based voting platform designed for educational institutions and organizations to conduct transparent elections with role-based access control.
- Admin: Complete system management and oversight
- Candidates: Registration, profile management, and campaign information
- Voters: Secure voting interface with ballot casting
- Candidate Registration: Self-registration with approval workflow
- Position Management: Create and manage electoral positions
- Secure Voting: One-vote-per-position system with voter verification
- Real-time Results: Live vote counting and analytics
- PDF Reports: Generate printable election results
- Dashboard Analytics: Visual charts and statistics for administrators
- Session-based authentication
- Role-based access control
- Unique voter identification
- Vote integrity protection
- Backend: PHP 7.4+
- Database: MySQL/MariaDB
- Frontend: HTML5, CSS3, JavaScript
- Charts: Chart.js for data visualization
- PDF Generation: TCPDF library
- Server: Apache/Nginx with PHP support
- Web server (Apache/Nginx)
- PHP 7.4 or higher
- MySQL 5.7+ or MariaDB 10.2+
- phpMyAdmin (recommended for database management)
-
Clone the repository
git clone <repository-url> cd online-voting-system
-
Database Setup
- Create a new MySQL database named
online_voting - Import the database schema:
mysql -u root -p online_voting < db/online_voting_db.sql
- Create a new MySQL database named
-
Configure Database Connection
- Edit
include/conn/conn.php - Update database credentials:
$conn = mysqli_connect("localhost", "username", "password", "online_voting");
- Edit
-
Set File Permissions
chmod 755 include/photo/ chmod 644 include/css/* chmod 644 include/js/*
-
Web Server Configuration
- Point document root to project directory
- Ensure PHP modules are enabled:
mysqli,session,gd
- ID:
admin - Password:
admin - Email:
abc@gmail.com
The system includes sample voters and candidates for testing purposes. Check the database for complete test data.
βββ admin/ # Admin panel and management
β βββ pages/ # Admin page components
β βββ *.php # Admin functionality files
βββ user/ # User interfaces
β βββ candidate/ # Candidate dashboard and features
β βββ voter/ # Voter interface and voting system
βββ include/ # Shared resources
β βββ conn/ # Database connection and session management
β βββ css/ # Stylesheets
β βββ js/ # JavaScript files
β βββ img/ # System images
β βββ photo/ # User profile photos
βββ db/ # Database schema and setup
βββ tcpdf/ # PDF generation library
- Login with admin credentials
- Manage positions, candidates, and voters
- Approve/reject candidate registrations
- Monitor voting progress and results
- Generate PDF reports
- Register through the candidate registration page
- Wait for admin approval
- Access candidate dashboard after approval
- Update profile and campaign information
- Login with voter credentials
- View available positions and candidates
- Cast votes (one per position)
- View confirmation of submitted votes
- admin: System administrators
- candidates: Registered candidates with approval status
- voters: Registered voters
- positions: Electoral positions/offices
- votes: Cast votes linking voters to candidates
- Candidates belong to specific positions
- Votes link voters to candidates for specific positions
- One vote per voter per position constraint
- Change default admin credentials immediately
- Use HTTPS in production environments
- Implement proper input validation and sanitization
- Regular database backups recommended
- Monitor for suspicious voting patterns
- Modify CSS files in
include/css/directory - Update logos and images in
include/img/
- Extend user roles by modifying authentication logic
- Add new fields to candidate/voter profiles
- Customize voting rules and restrictions
-
Database Connection Failed
- Verify database credentials in
conn.php - Ensure MySQL service is running
- Verify database credentials in
-
Photo Upload Issues
- Check file permissions on
include/photo/directory - Verify PHP file upload settings
- Check file permissions on
-
Session Problems
- Ensure PHP sessions are properly configured
- Check session file permissions
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request