Block Ballot
A production-grade university voting platform engineered for tamper-proof elections, high-throughput voter concurrency, and zero duplicate ballots — featuring passwordless WhatsApp OTP authentication, sub-100ms WebSocket tally updates, and verifiable Ethereum smart contract audit trails.
How can universities run tamper-proof, transparent elections online while keeping voter identity private and ensuring one-person-one-vote across thousands of students?
Built a 3-app monorepo (Voter Portal + Admin Dashboard + Backend API) with OTP WhatsApp authentication, real-time Socket.io monitoring, and an optional Ethereum smart contract for immutable on-chain vote verification — deployed to production on Render.
- Concurrency & Integrity: Sustains 5,000+ eligible voters simultaneously with strict 0 duplicate ballots.
- Real-Time Broadcast: Sub-100ms election tally updates propagated via persistent WebSocket connections.
- Auth Pipeline: Passwordless WhatsApp & Email OTP authentication dispatched under 1.2 seconds.
- Auditability: Cryptographic vote receipts with on-chain Ethereum smart contract tally proofs.
- Full Stack Monorepo: Architected 3 decoupled React apps (Voter Portal, Admin Suite, API tier).
- Database & Schemas: Designed MongoDB election schema, indexing strategies, and immutable tally logs.
- Security Engineering: Implemented single-use ballot tokens, JWT session verification, and rate limiting.
- Web3 & Solidity: Authored smart contracts for verifiable election audits with Ethers.js integration.
3-App Monorepo Architecture
Block Ballot is structured as a monorepo with three independent React + Vite apps sharing a single Express + MongoDB backend. Each layer is independently deployable and communicates via a RESTful API, with Socket.io for real-time updates.
VOTER PORTAL
OTP Authentication
Voters log in with their roll number and receive a time-limited OTP via WhatsApp (Baileys) with fallback to email/SMS. JWT tokens manage authenticated sessions.
Ballot & Vote History
Voters see live active elections, cast ballots, and get an instant vote receipt with a hash for later verification. Full vote history and audit trail are accessible post-election.
ADMIN DASHBOARD
Election & Candidate Management
Admins create, schedule and manage elections with defined start/end times, add candidates with photos, and bulk-import voter roll lists via CSV/Excel upload.
Real-time Monitoring
Socket.io pushes live vote counts and participation metrics to the admin panel. Results analytics and a public election dashboard provide full transparency.
BACKEND & BLOCKCHAIN
Express API + MongoDB
RESTful API with Voter, Vote, Election, and Candidate schemas. Transactional vote casting enforces one-person-one-vote. Rate limiting protects OTP endpoints.
Ethereum Smart Contract
Optional Solidity contract deployed on Sepolia testnet via Hardhat. Vote hashes are anchored on-chain via Ethers.js, enabling verifiable and immutable audit records.
What I learned building Block Ballot.
WhatsApp OTP as Primary Auth Channel
Using Baileys (WhatsApp Web API) for OTP delivery gave a significantly better UX than email for university students — but required careful rate-limiting, session persistence, and fallback handling to maintain reliability.
Monorepo Deployment Strategy
Shipping three Vite SPAs (voter, admin, backend) as a single Render Web Service through a unified build pipeline taught the nuances of static-file serving, CORS configuration, and environment management in production.
Blockchain as an Audit Layer
Integrating Ethereum as optional rather than mandatory was a key architectural decision — it kept the system accessible without Web3 wallets while still providing on-chain verifiability for stakeholders who need it.