Metropolis EVoting 2026 is a high-security, blockchain-inspired electronic voting platform designed for the sovereign Smart-City enclave of Metropolis. Built with TypeScript on the MERN stack (MongoDB, Express, React, Node.js), it ensures electoral integrity through cryptographic hashing, immutable audit logs, and real-time consensus monitoring.
- Immutable Blocks: Every vote is encapsulated in a block containing an index, timestamp, vote data, and the hash of the previous block.
- SHA-256 Security: Uses industry-standard cryptographic hashing to ensure that any tampering with a single vote invalidates the entire chain.
- Chain Explorer: A public-facing (or admin-restricted) viewer to inspect the block height and verification status in real-time.
- Multi-Tiered Roles: Distinct interfaces for Voters (Citizens), Candidates, Delegates (Weighted voting), and Administrators (MCEC Authority).
- Identity Verification: Multi-step registration involving "Citizen Social Index" (Verification IDs) and "Identity Access Keys" (Passwords).
- Security Throttling: Automatic account banning after 10 failed login attempts to prevent brute-force attacks.
- Server-Sent Events (SSE): Live synchronization of audit logs, system-wide broadcasts, and result updates without page refreshes.
- Dynamic Notifications: Admin-triggered global alerts for protocol changes or emergency updates.
- Encrypted Results: Vote counts are hidden from all users—including administrators—until the "Consensus" is officially published.
- Anonymous Casting: Biometric data is decoupled from the vote block using cryptographic hashing; participation is visible, but selection remains private.
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS, SCSS |
| State/UI | Framer Motion, Lucide React, Recharts |
| Backend | Node.js, Express.js |
| Database | MongoDB Atlas (Mongoose ODM) |
| Communication | Server-Sent Events (SSE) |
| Security | Crypto (SHA-256), Express-Rate-Limit |
- Node.js (v18+)
- MongoDB Atlas account (or local MongoDB instance)
git clone https://github.com/your-repo/metropolis-evoting-2026.git
cd metropolis-evoting-2026
npm installCreate a .env file in the root directory:
You can copy the content from .env.example. You MUST provide a MONGODB_URI for the database to work.
MONGODB_URI="your_mongodb_connection_string"
NODE_ENV="development"# Install dependencies
npm install
# Build and start the application
npm run build
npm run startThe app will be available at http://localhost:3000.
The application is fully integrated with MongoDB Atlas. All data (Users, Candidates, Blocks, Audit Logs, Notifications) is stored in your cluster.
- Log in to MongoDB Atlas.
- Create a new Cluster (the "Free Tier" is fine).
- Go to Database Access and create a user with a password.
- Go to Network Access and select "Allow Access From Anywhere" (IP
0.0.0.0/0). - Click Connect on your cluster, select "Drivers" (Node.js), and copy the connection string.
- Paste the string into your
.envfile asMONGODB_URI.
To get a live link for your website, you can use Render or Vercel.
Render is highly recommended because it supports Server-Sent Events (SSE) and long-running Node.js processes, which are required for the real-time blockchain audit logs.
Steps for Render:
- Push your code to a GitHub repository.
- Sign in to Render.
- Click New -> Web Service.
- Connect your GitHub repository.
- Runtime: Node
- Build Command:
npm install && npm run build - Start Command:
npm run start - Environment Variables: Go to the Environment tab and add:
MONGODB_URI: Your MongoDB Atlas connection string.NODE_ENV: Set this toproduction.
- Retrieve Link: The live URL is displayed at the top of your Render dashboard (e.g.,
https://metropolis-evoting-2026.onrender.com). - Wait for Green: The link becomes active once the status changes to "Live" in the deployment logs.
Vercel is best for pure frontends. Because this app uses an Express backend with SSE for real-time data, Vercel's serverless architecture may cause connection timeouts. If using Vercel, ensure your MONGODB_URI is added to the project environment variables.
If you want to clear the election board to perform a new test run:
- Log in as Admin (
id: admin123,psw: admin). - Go to the Authority Hub.
- Scroll to the bottom of the sidebar and click "Emergency Protocol Reset".
- This will:
- Delete all cast votes.
- Reset all users so they can vote again.
- Clear the audit logs and real-time alerts.
- Set Voting to Open and Results to Unpublished.
You can also trigger a reset by sending a POST request to the API:
curl -X POST http://localhost:3000/api/admin/reset-election \
-H "Content-Type: application/json" \
-d '{"password": "admin"}'- Admin Privacy: Admins cannot see active vote counts while polling is open to prevent bias.
- Hash Protection: Cryptographic hashes are redacted in some views to prioritize readability and system security.
- Audit Logs: Every critical action is recorded in a tamper-evident audit log stored in MongoDB.