Skip to content

anandrajaram21/bohemian-frontend

Repository files navigation

Bohemian Voting Platform

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.

Features

  • 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

Tech Stack

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

Requirements

Before you begin, you need to install the following tools:

Quickstart

To get started with Bohemian Voting Platform, follow the steps below:

  1. Clone this repository & install dependencies
git clone https://github.com/anandrajaram21/bohemian-frontend.git
cd bohemian-frontend
yarn install
  1. Set up the backend server

Follow the instructions in the Bohemian Backend repository to set up and run the backend API server.

  1. Configure environment variables

Create a .env.local file in packages/nextjs/ and add:

NEXT_PUBLIC_API_URL=http://localhost:8000  # or your backend URL
  1. Run a local Ethereum network (first terminal):
yarn chain

This starts a local Ethereum network using Hardhat for testing and development.

  1. Deploy the VotingSystem contract (second terminal):
yarn deploy

This deploys the VotingSystem smart contract to your local network.

  1. Start the Next.js frontend (third terminal):
yarn start

Visit the application at http://localhost:3000

How It Works

  1. Create an Election: Navigate to the Create page to set up a new election with candidates, voting system type, and eligible voter emails
  2. Vote: Eligible voters receive OTPs via email and can cast their votes on the election page
  3. Verify: Voters can verify their votes were recorded correctly by comparing the blockchain and database records on the Verify page
  4. View Results: Election results are displayed in real-time with visual charts

Project Structure

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

Smart Contract

The VotingSystem contract handles:

  • Storing votes on the blockchain with authorization hashes
  • Retrieving votes by election ID
  • Ensuring vote immutability and transparency

Related Repositories

  • Backend API: bohemian-backend - Handles voter authentication, email distribution, and database storage

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

Built With Scaffold-ETH 2

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.

About

Frontend for bohemian voting system

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages