SecureVote is a state-of-the-art voting application that combines biometric identity verification (Face Recognition) with blockchain technology to ensure immutable and transparent election results.
- Mobile App: React Native / Expo (Tailwind CSS, Lucide Icons)
- Backend Server: Node.js / Express (Prisma ORM, PostgreSQL, JWT Authentication)
- Blockchain: Ethereum / Hardhat (Solidity Smart Contracts)
- Biometric Service: FastAPI / OpenCV (Face Recognition)
Before you begin, ensure you have the following installed:
- Node.js: v18.x or higher
- PostgreSQL: v14.x or higher
- Python: v3.9+ (with
pip) - Git: For cloning the repository
If you are on Windows and have all prerequisites configured, you can launch all services at once using the provided PowerShell script:
./run_all.ps1- Start your PostgreSQL server.
- Create a database named
voter_db. - Configure environment variables in
server/.env:PORT=5000 DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@localhost:5432/voter_db?schema=public" JWT_SECRET="your_secure_secret" DEMO_OTP="123456"
Install dependencies for all sub-projects:
# Root (Frontend)
npm install
# Backend Server
cd server && npm install && cd ..
# Blockchain
cd blockchain && npm install && cd ..
# Face Service
cd face_service && pip install -r requirements.txt && cd ..- Start a local Hardhat node:
cd blockchain npx hardhat node - In a NEW terminal, deploy the smart contract:
cd blockchain npx hardhat run scripts/deploy.js --network localhost
- Sync the database schema:
cd server npx prisma db push - Seed the admin account:
node seed-admin.js
- Start the server:
npm start
The face service has a fallback mode if face_recognition (which requires complex C++ setup on Windows) is not installed.
- Basic setup (Fallback Mode):
cd face_service pip install fastapi uvicorn pydantic opencv-python numpy uvicorn main:app --reload --port 8000 - For Real Face Recognition, refer to the detailed guide in face_service/README.md.
- Start the Expo development server:
npm start
- Scan the QR code with your Expo Go app (Android) or Camera (iOS).
- Voter ID:
ADMIN-001 - Password:
admin123
/app: Expo Router file-based screens./server: Node.js Express API and Prisma schema./blockchain: Hardhat project for Solidity contracts./face_service: Python FastAPI service for facial verification./src: React Native components and state management.
- Database Connection: Ensure PostgreSQL is running and the
DATABASE_URLinserver/.envis correct. - Blockchain Transactions: If transactions fail, ensure the Hardhat node is running and the contract has been deployed to the
localhostnetwork. - Python Dependencies: If
pip installfails, ensure you have Python 3.9+ and pip installed.
Built with ❤️ for Secure and Transparent Democracy.