Decentralized, transparent, and privacy-first voting platform
TrustBallot is a full-stack decentralized voting application that enables secure, transparent, and verifiable elections on the blockchain. Built with modern web technologies and designed for real-time updates.
- 🗳️ Blockchain Voting - All votes recorded on-chain for transparency
- 🔐 Secure & Verifiable - Smart contract enforced security
- ⚡ Real-time Updates - Live vote counts and election state
- 👥 Voter Management - Self-registration and admin controls
- 🎨 Modern UI - Beautiful, responsive 8-bit retro theme
- 📱 Mobile Responsive - Works seamlessly on all devices
- 🔄 Complete Lifecycle - Create → Start → Vote → End → Results
- React 19 + TypeScript - Modern UI framework
- Vite - Lightning-fast build tool
- Tailwind CSS 4 - Utility-first styling
- Framer Motion - Smooth animations
- wagmi + RainbowKit - Ethereum wallet integration
- React Router DOM 7 - Client-side routing
- Node.js + Express - REST API server
- MongoDB - User authentication
- Pinata - IPFS image storage
- JWT - Secure authentication
- Nodemailer - Email notifications
- Solidity - Ethereum smart contracts
- Hardhat - Development framework
- TrustBallot.sol - Main voting contract
- Node.js ≥ 18
- pnpm (recommended) or npm
- MetaMask or compatible wallet
- MongoDB database
- Pinata account (for IPFS)
- Clone the repository
git clone <repository-url>
cd Trust_Ballot- Install dependencies
Frontend:
cd tballot
pnpm installBackend:
cd Backend
pnpm installContracts:
cd Contracts
pnpm install- Set up environment variables
Frontend (.env):
VITE_API_URL=http://localhost:3000
VITE_PINATA_JWT=your_pinata_jwt
VITE_GATEWAY_URL=your_gateway_urlBackend (.env):
PORT=3000
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
PINATA_API_KEY=your_pinata_key
PINATA_SECRET_API_KEY=your_pinata_secret- Deploy smart contract
cd Contracts
npx hardhat compile
npx hardhat run scripts/deploy.ts --network sepolia- Run the application
Backend:
cd Backend
pnpm devFrontend:
cd tballot
pnpm devVisit: https://trust-ballot-zujo.vercel.app/
Trust_Ballot/
├── 📱 tballot/ # Frontend React App
│ ├── src/
│ │ ├── Pages/ # Main pages
│ │ ├── Contracts/ # Blockchain interactions
│ │ ├── components/ # UI components
│ │ └── config/ # Configuration
│ └── package.json
│
├── 🔧 Backend/ # Express API Server
│ ├── server.ts # Main server
│ ├── routes/ # API routes
│ ├── models/ # Database models
│ └── controllers/ # Business logic
│
└── ⛓️ Contracts/ # Smart Contracts
├── contracts/ # Solidity contracts
├── scripts/ # Deployment scripts
└── hardhat.config.ts
- Visit landing page
- Connect wallet (MetaMask)
- Register as voter
- View candidates
- Cast vote
- See real-time results
- Connect wallet (owner address)
- Start election
- Add candidates
- Monitor votes in real-time
- End election
- View winner
- ✨ 8-bit retro theme
- 🎬 Smooth animations
- 🔔 Toast notifications
- 🔐 Blockchain verification
- 🛡️ One vote per voter
- 👑 Owner-only controls
- 📦 IPFS storage
- 🔑 JWT authentication
- 📊 Election state management
- 👥 Voter registration
- 🎯 Candidate management
- 🗳️ Voting mechanism
- 🏆 Winner calculation
--
- Platform: Vercel
- URL: https://trust-ballot-zujo.vercel.app
- Status: ✅ Deployed
- Platform: Render
- URL: https://trust-ballot.onrender.com
- Status: ✅ Deployed
- Network: Sepolia Testnet
- Status: ✅ Deployed
This project is licensed under the MIT License - see the LICENSE file for details.
✨ Decentralized - No single point of failure
🔒 Transparent - All votes verifiable on-chain
⚡ Fast - Optimized for performance
🎨 Beautiful - Modern, responsive UI
📱 Mobile-First - Works on all devices