A decentralized voting platform that combines blockchain transparency with traditional database reliability. This application enables secure, verifiable elections with support for both traditional and ranked-choice voting systems.
- Multiple Voting Systems: Support for traditional voting and ranked-choice voting
- Blockchain Verification: All votes are stored on the Ethereum blockchain for immutability and transparency
- Dual-Storage Architecture: Votes are stored both on-chain and in a backend database for redundancy and verification
- Vote Verification: Voters can independently verify their votes by comparing blockchain and database records
- Email-Based Authentication: Secure voter authentication using email and OTP
- Election Management: Create and manage elections with custom candidates and expiry dates
- CSV Voter Import: Bulk upload eligible voters via CSV files
Built using NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript.
- Frontend: Next.js 14 (App Router), React, TailwindCSS
- Blockchain: Ethereum, Hardhat, Wagmi, Viem
- Wallet Integration: RainbowKit
- Backend: Bohemian Backend
Before you begin, you need to install the following tools:
- Node (>= v18.18)
- Yarn (v1 or v2+)
- Git
To get started with Bohemian Voting Platform, follow the steps below:
- Clone this repository & install dependencies
git clone https://github.com/anandrajaram21/bohemian-frontend.git
cd bohemian-frontend
yarn install- Set up the backend server
Follow the instructions in the Bohemian Backend repository to set up and run the backend API server.
- Configure environment variables
Create a .env.local file in packages/nextjs/ and add:
NEXT_PUBLIC_API_URL=http://localhost:8000 # or your backend URL
- Run a local Ethereum network (first terminal):
yarn chainThis starts a local Ethereum network using Hardhat for testing and development.
- Deploy the VotingSystem contract (second terminal):
yarn deployThis deploys the VotingSystem smart contract to your local network.
- Start the Next.js frontend (third terminal):
yarn startVisit the application at http://localhost:3000
- Create an Election: Navigate to the Create page to set up a new election with candidates, voting system type, and eligible voter emails
- Vote: Eligible voters receive OTPs via email and can cast their votes on the election page
- Verify: Voters can verify their votes were recorded correctly by comparing the blockchain and database records on the Verify page
- View Results: Election results are displayed in real-time with visual charts
bohemian-frontend/
├── packages/
│ ├── hardhat/ # Smart contracts and deployment scripts
│ │ ├── contracts/ # VotingSystem smart contract
│ │ └── deploy/ # Deployment scripts
│ └── nextjs/ # Next.js frontend application
│ └── app/
│ ├── page.tsx # Home page
│ ├── create/ # Create election page
│ ├── election/ # Individual election pages
│ ├── view/ # View all elections
│ └── verifier/ # Vote verification page
The VotingSystem contract handles:
- Storing votes on the blockchain with authorization hashes
- Retrieving votes by election ID
- Ensuring vote immutability and transparency
- Backend API: bohemian-backend - Handles voter authentication, email distribution, and database storage
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is built on top of Scaffold-ETH 2, an open-source toolkit for building decentralized applications. For more information about the underlying framework, visit the Scaffold-ETH 2 documentation.