The Election Management System (EMS) is a web-based platform designed to streamline student elections, such as student council and class elections. EMS enhances efficiency, transparency, accessibility, and security in elections by leveraging modern web technologies.
- Secure user authentication
- Candidate registration and management
- Online voting system with real-time results
- Blockchain technology for tamper-proof vote security and verification
- Role-based access control (Admin, Candidates, Voters)
- SMS and email notifications for election updates
- Responsive UI for mobile and desktop users
- Audit logs and election history
- Election activation and deactivation
- Progressive Web App (PWA) integration for offline access and mobile installation
- Add, edit, and delete elections
- Add, edit, and delete categories (positions) of elections
- Add, edit, and delete candidates for each category
- Activate and deactivate elections
- View results of active elections
- View and update profile
- View, assign admin roles, and reset passwords for voters
- Configure and monitor blockchain vote verification
- Validate election integrity through blockchain verification
- Secure login authentication
- Secure login authentication
- View the list of candidates for active elections
- Cast votes in active elections with blockchain security
- View voting choices after submission
- Verify personal vote through blockchain verification
- View live results of active elections
- Learn about blockchain voting security
- View and update profile
- HTML5
- CSS3
- Bootstrap
- JavaScript (ECMAScript 7)
- Progressive Web App (PWA) features
- Service Workers for offline functionality
- PHP 8.4
- MySQL
- Google Cloud
- Blockchain technology for tamper-proof voting records
- Vote verification through cryptographic hash chains
- SSL Encryption
- Reset Password linked via Mail
- Google Authenticator for 2FA
- Email: PHPMailer
- Device: Customized api for push notifications with sound.
- SMS: Arkesel SMS Gateway
Ensure you have the following installed:
- PHP 8.2
- MySQL Server
- Apache/Nginx Server
-
Clone the Repository
git clone https://github.com/aristocratjnr/Election.git cd Election -
Set Up the Database
- Create a MySQL database named
ems. - Import the SQL file:
mysql -u root -p ems < database/ems.sql - Set up the blockchain database table:
php database/blockchain_migration.php
- Create a MySQL database named
-
Configure Blockchain (Optional)
- By default, the blockchain functionality is enabled
- You can modify blockchain settings in
admin_blockchain_setup.php - The blockchain system uses SHA-256 hashing which is supported by default in PHP
- For high-volume elections, consider optimizing your MySQL configuration:
# Add to my.cnf for better blockchain performance innodb_buffer_pool_size = 256M innodb_log_file_size = 64M
-
Run the Application
- Place the project folder inside
htdocs(C:/xampp/htdocs/Election). - Start XAMPP and ensure Apache and MySQL are running.
- Open
http://localhost/Electionin your browser. - Log in as admin and navigate to "Blockchain Setup" to verify the blockchain system is functioning correctly.
- Place the project folder inside
- Manage candidates, set election dates, and oversee the voting process.
- Register and view their election status.
- Securely log in, cast votes, and view real-time election results.
- Install as a mobile app via the PWA functionality for convenient access.
The Election Management System utilizes blockchain technology to secure the voting process, enhancing transparency and integrity. This cutting-edge approach provides several important benefits:
- Tamper-proof Records: Each vote is secured as a block in an immutable chain, making it impossible to alter votes without detection
- Vote Verification: Voters can independently verify that their vote was correctly recorded and remains unchanged
- Transparency: The blockchain provides a transparent record of all votes while preserving voter anonymity
- Cryptographic Security: Uses SHA-256 hashing algorithm and proof of work to ensure data integrity
- Real-time Validation: The entire blockchain can be validated at any time to verify election integrity
- Voter Privacy: Uses one-way hashing with salt to protect voter identities
- Genesis blocks are automatically created for each new election
- Votes are securely recorded in the blockchain with cryptographic validation
- Administrative interface for monitoring blockchain health and integrity
- Educational resources to help users understand blockchain security
- User-friendly verification interface for voters to verify their ballots
- Proof of Work: Implements mining algorithm to secure each block
- Block Structure: Contains vote data, previous hash, timestamp, and nonce
- Chain Validation: Complete chain integrity checking with O(n) complexity
- Database Integration: Blockchain blocks stored in dedicated MySQL table
- Vote Anonymization: Student IDs are never directly stored in the blockchain
- IP Tracking: Securely hashes IP addresses for audit purposes without exposing raw data
The Election Management System implements PWA technology, providing the following benefits:
- Offline Access: Access key features even with poor or no internet connection.
- Installation: Install SmartVote as an app on mobile devices and desktops.
- App-like Experience: Enjoy a native app-like experience with full-screen mode and home screen access.
- Automatic Updates: Always get the latest version without manual updates.
- Improved Performance: Faster loading times and smoother interactions through cached resources.
- Open the application in a modern browser (Chrome, Edge, Safari, etc.)
- Look for the "Install App" button in the interface
- Follow the on-screen prompts to install the application
- Access SmartVote directly from your device's home screen or app drawer
Q: How does blockchain ensure vote security?
A: Each vote is recorded as a block in the chain with a unique cryptographic hash. The hash is dependent on the vote data and the previous block's hash, creating an immutable chain. Any attempt to modify a vote would invalidate the entire chain.
Q: Is my vote anonymous?
A: Yes. Your identity is protected through one-way hashing with a random salt. This means your vote is verifiable by you but cannot be traced back to your identity by others.
Q: How can I verify my vote was counted correctly?
A: After voting, you'll receive a vote ID. You can use this ID on the blockchain verification page to confirm your vote was recorded correctly and remains unmodified.
Q: Does implementing blockchain slow down the voting process?
A: The blockchain operations occur in the background after your vote is submitted, so there's no noticeable delay in the voting experience.
Blockchain Verification Issues:
- If you cannot verify your vote, ensure you're using the correct vote ID
- Check that you're selecting the correct election in the verification interface
- Try clearing your browser cache and trying again
For Administrators:
- If blockchain validation fails, check the database connection
- Ensure PHP has sufficient memory allocation for handling large blockchains
- Regular database backups are recommended to preserve blockchain integrity
- Use the admin blockchain setup page to monitor system health
The blockchain implementation in the Election Management System follows a carefully designed architecture to ensure security, performance, and maintainability.
-
Blockchain Class (
classes/Blockchain.php):- Core implementation of blockchain functionality
- Methods for blockchain creation, validation, and vote addition
- Proof of work algorithm implementation
- Block integrity verification
-
Blockchain Database (
blockchain_blocksTable):- Stores all blocks in the blockchain
- Indexes for efficient querying and validation
- Maintains chain references through previous_hash field
-
Verification Interface (
blockchain_verify.php):- User interface for blockchain exploration and validation
- Tools to verify individual votes
- Blockchain statistics and health monitoring
- Chain integrity validation tools
-
Admin Management (
admin_blockchain_setup.php):- Enable/disable blockchain functionality
- Monitor blockchain performance
- Perform integrity checks and system diagnostics
- Educational resources for administrators
-
Educational Resources (
blockchain_learn.php):- Explanations of blockchain technology for users
- Visual aids and diagrams
- FAQs and benefits explanation
- Security measures documentation
- User casts vote through the standard interface
- Vote is recorded in the traditional database tables
- Vote data is simultaneously passed to the blockchain system
- Blockchain system creates a new block with vote data
- Block is secured with proof of work algorithm
- Block is added to the blockchain with links to previous blocks
- User receives verification information for their vote
- Vote data is anonymized through one-way hashing
- Each block is secured with SHA-256 cryptographic hashing
- Proof of work algorithm prevents tampering
- Full chain validation available at any time
- Vote verification without compromising voter privacy
For inquiries, reach out to:
- Email: [email protected]
- GitHub: aristocratjnr
- Website: My Portfolio