A secure, transparent, and trustless voting platform built on the Ethereum blockchain. This project leverages smart contracts, JWT-based authentication, and a clean frontend interface to demonstrate how decentralized technologies can modernize electoral systems.
β οΈ Note: This project is no longer actively maintained.
This decentralized voting system enables remote, anonymous, and tamper-proof elections. Votes are recorded on the Ethereum blockchain, ensuring full transparency and eliminating centralized points of failure.
π§ Built for learning and demonstration purposes, this project is ideal for those exploring how blockchain can be applied in real-world governance scenarios.
π₯ Live Demo: Watch on YouTube
- π JWT Authentication β Secure voter login and role-based access control.
- βοΈ Ethereum Integration β Votes are recorded on-chain for full transparency.
- π€ Trustless Process β No central authority; smart contracts manage logic.
- π Admin Panel β Add candidates, set election periods, and view results.
- π₯οΈ User-Friendly UI β Easy-to-use interface for voters and admins alike.
- FastAPI (Python 3.9)
- MySQL (Port: 3306)
- JWT Authentication
- Uvicorn
- Node.js (v18.14.0)
- Browserify
- HTML/CSS/JS
- Truffle
- Ganache
- Metamask
- Solidity (Smart Contracts)
| Admin Panel | Candidate View | Voting Interface |
|---|---|---|
![]() |
![]() |
![]() |
git clone https://github.com/kairos1205/Decentralized-Voting-System-Using-Ethereum-Blockchain.git- Download Ganache
- Create a workspace named development
- Add
truffle-config.jsto the Truffle projects section
-
Install the Metamask extension
-
Create/import wallet and connect to Ganache:
- Network Name: Localhost 7575
- RPC URL: http://localhost:7545
- Chain ID: 1337
- Currency Symbol: ETH
- Create a new database:
voter_db - Create the
voterstable using:
CREATE TABLE voters (
voter_id VARCHAR(36) PRIMARY KEY NOT NULL,
role ENUM('admin', 'user') NOT NULL,
password VARCHAR(255) NOT NULL
);π‘ Tip: Manually insert some user records to begin testing.
npm install -g trufflenpm installpip install fastapi mysql-connector-python pydantic python-dotenv uvicorn uvicorn[standard] PyJWTπ§ Before running, make sure to update DB credentials in:
./Database_API/.env
truffle console
compile
.exitbrowserify ./src/js/app.js -o ./src/dist/app.bundle.jsnode index.jscd Database_API
uvicorn main:app --reload --host 127.0.0.1truffle migrateβ Visit the app at: http://localhost:8080
π₯ Need help setting it up? Watch the full walkthrough: YouTube Setup Guide
βββ build/ # Compiled contracts
βββ contracts/ # Solidity smart contracts
βββ Database_API/ # FastAPI backend
βββ migrations/ # Truffle migration scripts
βββ public/ # Favicon and other static assets
βββ src/ # Frontend assets (HTML, CSS, JS)
βββ index.js # Node.js entry point
βββ package.json # Node project config
βββ truffle-config.js # Truffle settings
βββ README.md # Project documentation
This project is licensed under the MIT License. You're free to use, modify, and distribute it, as long as you retain the original license and attribution.
π View LICENSE
If you found this project helpful, please consider giving it a β. Your support is appreciated!


