Why we chose Votex?
7th August 2025, opposition leader from Indian National Congress (India) makes a huge revelation on how 1,00,250 fake votes were created in a single constituency, this alleged voting scam has created a deep sense of distrust among the voters, India - the largest democracy of the entire world is suffering from vote malpractices and the independent board (ECI) refuses to clarify or acknowledge this situation. We are the voters of this country to, and we can't just participate in an unfair race, so we decided to create Votex - a web app that integrates blockchain to promote smooth electoral/voting process and most importantly, keeps the process and transparent and real-time synced.
What Votex Does? (Step by Step)
User Registration & Authentication
- A voter first visits the web app.
- They register/login using their phone number
- Firebase Authentication is used here → it sends a One-Time Password (OTP) to the voter’s number
- The OTP ensures only genuine, unique users can proceed.
Identity Verification (Mock DigiLocker)
- After OTP verification, the voter is asked to upload an ID document (simulating India’s DigiLocker).
- This is stored in Firebase Storage, and a record is added in Firestore.
- While it’s just a mock, it simulates real-world KYC (Know Your Customer) for voting.
Voting Process
- Once verified, the voter is shown the ballot screen with multiple political parties.
- They can select exactly one party and cast their vote.
- When they vote:
The vote is sent to the smart contract deployed on Polygon Mumbai Testnet.
The smart contract checks if this voter’s address/email has already voted.
- If yes → it rejects the vote (double-voting prevention).
- If no → it records the vote permanently. The contract emits an event containing:
- Voter address (or ID hash)
- Timestamp
- Party voted for
Vote Confirmation
- After casting, the voter gets:
- A success message ** The transaction hash (txHash) from the blockchain This txHash acts as proof that their vote is permanently recorded and cannot be changed.
Real-Time Results Dashboard
- On the results page, users can see:
- Live total votes per party
- Vote percentages
- A progress bar UI with TailwindCSS
- The frontend keeps polling results every 30 seconds (via the Express API, which queries both Firestore and blockchain).
Vote Ledger
A transparent ledger view lists all votes with:
- Party voted for
- Timestamp
- Transaction hash (so anyone can verify on Mumbai blockchain explorer).
This ensures public verifiability → anyone can see that votes exist on-chain, though without exposing personal details.
Security & Double Voting Prevention
- The smart contract enforces one-vote-per-user logic.
- Firebase ensures unique identity verification (OTP + ID upload).
- The combination of off-chain identity management (Firebase) + on-chain immutable voting (Polygon) ensures security and fairness.
Architecture in Action
Flow Diagram (textual):
[User Browser] ↓ React Frontend (UI + Components) ↓ Firebase Authentication (Email OTP) ↓ Upload ID (Firebase Storage + Firestore) ↓ Vote Cast → Express API ↓ Smart Contract (Polygon Mumbai Testnet) ↓ Event Emitted → Stored in Firestore ↓ Results Dashboard + Vote Ledger (Live Updates)
Why This Matters
- Secure: Blockchain prevents tampering and fraud.
- Transparent: Everyone can view the ledger + txHashes.
- Real-Time: Firebase + API provide instant results.
- Simple: A voter can complete the process in under 5 minutes (perfect for demo).
In short - Votex is a web app where voters register via OTP, upload ID, cast one vote, get blockchain proof of their vote, and then see real-time results + a public ledger. It’s a hackathon-scale simulation of how elections could be modernized using blockchain + Firebase + Express + React.
How we built it?
Disclaimer for Hackathon Prototype This project was developed under strict hackathon constraints of time, resources, and zero budget. To ensure a functional demo, certain components have been mocked or simplified while still preserving the intended architecture and demonstrating feasibility. Mocked / Simplified Components Mock DigiLocker Integration → Instead of connecting to the real DigiLocker API (requires government clearance), we simulated document verification through a Firebase file upload. Simplified Authentication → Used Firebase OTP instead of Aadhaar/KYC identity verification. Testnet Deployment → Votes are recorded on the Polygon Mumbai Testnet to avoid mainnet gas costs. In real-world deployment, this would be shifted to mainnet or an enterprise blockchain. Centralized API for Blockchain Writes → For hackathon speed and free usage, our Express backend signs blockchain transactions. A production-ready version would use MetaMask/WalletConnect to let voters sign their own transactions securely. Why Zero Cost Was Important We intentionally built this with only free-tier services (Firebase, Vercel, Mumbai Testnet). This proved that a secure, transparent digital voting system can be prototyped with no budget — making it highly accessible and scalable for future development. No funds were spent on hosting, APIs, or blockchain gas fees. Path to Production Replace mocked DigiLocker with official DigiLocker / Aadhaar APIs. Shift from Firebase OTP to government KYC systems. Deploy contracts on Polygon mainnet or a dedicated permissioned chain. Add zk-SNARKs for ballot secrecy. Scale horizontally to handle millions of voters securely. We started with the idea that voting needs to be secure, verifiable, and transparent. From there, we broke the system into three layers — Frontend, Backend/API, and Blockchain — and iteratively built each piece.
Frontend (React + Tailwind)
We used Create React App with TailwindCSS to quickly scaffold a clean, responsive UI. Components were split into: Auth (OTP login, ID upload) Voting Page (party selection, vote button) Results Dashboard (real-time tally) Ledger View (public list of votes with txHashes) We focused on a smooth user journey: register → verify → vote → see results. To simulate real-time transparency, we added auto-refresh every 30 seconds on the results page.
Backend / API (Node.js + Express)
We built a simple Express API that sits between the frontend and the blockchain/Firebase. Why? Because directly hitting the blockchain from the frontend is messy and exposes private keys. So the API handles: Vote casting → takes user’s choice, calls the smart contract on Polygon Mumbai, returns txHash. Ledger fetching → queries blockchain events + Firestore and sends structured data to frontend. Result aggregation → counts votes per party, streams totals back to frontend. This separation also makes the app scalable and secure.
Authentication + Data Storage (Firebase)
Firebase gave us fast, hackathon-ready auth. We implemented Email OTP login, so each user proves their identity. For KYC-like verification, users upload an ID (mock DigiLocker) → stored in Firebase Storage, with metadata in Firestore. Firestore also stores: Vote metadata (voter ID hash, txHash, timestamp). Aggregated results for quick reads.
Blockchain (Polygon Mumbai Testnet + Solidity)
This was the toughest part for us. We experimented with Hardhat to write a simple Solidity contract that: Maps voter → hasVoted (boolean). Keeps counters for each party. Rejects duplicate votes. Emits events for every vote (address, party, timestamp).
Deploying to Polygon Mumbai Testnet taught us how to connect via Alchemy/Infura RPC. Initially, we struggled with dependency mismatches (Hardhat v3 vs ethers.js plugin), but after downgrading to Hardhat v2, deployment worked smoothly. Once deployed, we tested by casting a few dummy votes via MetaMask → saw them show up on Mumbai explorer. We even tried adding a MetaMask integration on the frontend, but realized for hackathon speed it was easier to let our Express API handle blockchain writes. That way, the frontend just gets back a transaction hash to show users as proof.
Deployment & Demo Setup Frontend → hosted on Vercel for instant deploys. Backend → deployed as a lightweight Node/Express service. Smart Contract → deployed on Polygon Mumbai, accessible via public txHashes. Together, this makes it possible for judges to register, vote, and see results in under 5 minutes, as required by our hackathon plan.
Challenges we ran into?
New Tech Stack, Steep Learning Curve
This was our first time working with a full stack project that combined frontend + backend + blockchain. Understanding how React, Express, Firebase, and Solidity connected was a big challenge. Debugging across multiple layers made it difficult to pinpoint where issues were — UI, API, or smart contract.
Frontend–Backend–Blockchain Integration
Getting the frontend to talk to the backend, and the backend to correctly push transactions to the Polygon testnet, was harder than expected. Managing async flows (vote → txHash → confirmation → Firestore update → frontend refresh) required trial and error. We also realized blockchain is not as instant as Firebase — transactions had delays, which made syncing the UI tricky.
Version & Dependency Incompatibility
We initially used Hardhat v3, which broke compatibility with ethers.js plugins (@nomiclabs/hardhat-ethers). This caused confusing ERESOLVE errors until we rolled back to Hardhat v2. On the frontend, React 19 didn’t play well with CRA (react-scripts), so we downgraded to React 18 for stability.
Blockchain Drawbacks
On the Polygon Mumbai Testnet, transactions sometimes took longer to confirm or failed due to RPC issues. While blockchain gave us immutability, it also introduced latency compared to a normal database. Gas fees were free on testnet, but in production, real costs would have to be managed carefully.
Security Considerations
We had to think about preventing double voting, replay attacks, and fake identities. Since Firebase OTP is weaker than Aadhaar/eKYC, we treated it as a mock. Handling private keys was tricky: should users sign with MetaMask, or should the backend submit votes? For the hackathon, we chose backend signing, but we know this isn’t production-grade secure.
Zero-Budget Constraint
We had to stick to free-tier services only (Firebase, Vercel, Mumbai Testnet). This meant no premium APIs, no real DigiLocker integration, and limited blockchain infra. While it forced creativity, it also meant we had to mock some features.
Accomplishments that we're proud of?
We built a practical, working prototype Within just a hackathon’s timeframe, we connected frontend + backend + Firebase + blockchain into one functional system. It wasn’t just slides or ideas — users can actually register, vote, and see results live.
Proved that secure digital voting is possible at zero cost We created the system entirely with free-tier tools (Firebase, Vercel, Polygon testnet). Demonstrated that even without a budget, technology can address a critical real-world problem.
Blockchain-powered trust and transparency Votes are recorded on-chain, tamper-proof and publicly verifiable. Every voter gets a transaction hash as proof, ensuring unmatched transparency.
Reimagined the election process By combining Firebase real-time updates with blockchain immutability, we showed a new way to think about elections. The project reflects our belief that this is the future of voting — secure, transparent, and trusted.
Overcame tough technical challenges From version conflicts to blockchain latency, we learned how to debug across multiple layers. These struggles turned into learning milestones that made our system stronger.
What we learned?
How to integrate a full-stack system We learned how to connect frontend (React + Tailwind), backend (Express), Firebase (auth + storage), and blockchain (Solidity on Polygon) into one pipeline. This taught us how different technologies communicate, and how to debug issues across multiple layers.
Practical blockchain development We got hands-on experience writing and deploying a Solidity smart contract on the Polygon Mumbai Testnet. Learned about gas fees, transaction delays, and why blockchain is powerful but also challenging compared to normal databases. Version and dependency management Hardhat, ethers.js, and React all had version conflicts that forced us to downgrade and stabilize. We now understand the importance of choosing stable, compatible versions in real-world projects. Security & real-world trade-offs We explored how to prevent double voting, fake identities, and tampering. Learned why hackathon shortcuts (like Firebase OTP or backend signing) are fine for demos, but why production needs wallet-based signing + stronger KYC.
Building under constraints With zero budget and 4 days, we learned how to use free-tier tools effectively and mock features where needed. This taught us to prioritize practical working solutions over “perfect but unfinished” ideas.
Teamwork under pressure
We divided roles (frontend, backend, blockchain) but constantly collaborated to connect everything. Learned how important communication is when dealing with multiple moving parts.
What's next for Votex?
National-Scale Relevance Elections in countries like India involve hundreds of millions of voters. Traditional systems face challenges: fraud, manual counting errors, logistical costs, and delays. Votex can modernize this by providing: Tamper-proof voting via blockchain. Instant, transparent results with real-time dashboards. Public verifiability — every citizen can check the ledger without relying on intermediaries.
Scaling for National Level Identity Verification: Replace Firebase OTP with Aadhaar/DigiLocker APIs or official voter ID integration. Use biometric or government e-KYC systems for strong voter authentication. Blockchain Infrastructure: Deploy on Polygon mainnet or a permissioned government blockchain for national elections. Use zk-SNARKs or other cryptographic methods to ensure ballot secrecy while preserving transparency. Performance & Scale: Optimize smart contracts for millions of transactions. Use layer-2 solutions (e.g., Polygon, zk-rollups) to reduce gas fees and latency. User Access: Support mobile-first design, since a majority of voters in India access services via smartphones. Integrate offline verification + local polling station devices for areas with poor internet.
Real-World Impact Trust in Democracy: Restores citizen confidence by making elections verifiable and tamper-proof. Cost Reduction: Reduces expenses for EVMs, ballot papers, and manual counting staff. Faster Results: Final tally in minutes instead of days. Inclusivity: Enables remote and overseas citizens to vote securely.
Global Relevance Beyond India, many democracies face fraud, mistrust, or low turnout. Votex can serve as a blueprint for blockchain-based elections worldwide, adapted to each country’s voter ID systems.
Built With
- custom-rest-apis
- ethers.js
- express.js
- firebase
- github
- hardhat
- javascript
- lucid-react
- node.js
- polygon-mumbai-testnet
- react
- solidity
- tailwindcss
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.