This is a full-stack secure voting application with voter registration, authentication, voting, and real-time results.
- Frontend: React with Tailwind CSS
- Backend: Node.js + Express
- Database: SQLite
- Authentication: JWT (JSON Web Tokens)
- Security: Bcrypt password hashing, secure PIN storage
- Node.js (v14 or higher)
- npm or yarn
The system automatically creates the following tables:
- Stores voter registration information
- Includes encrypted PIN for authentication
- Tracks verification status
- Stores election details (title, dates, status)
- Supports multiple simultaneous elections
- Links candidates to specific elections and positions
- Stores candidate details (name, party, biography)
- Records all cast votes
- Prevents duplicate voting per position
- Generates unique vote hashes for audit trails
- Tracks all system actions (registration, login, voting)
- Stores IP addresses and timestamps for security
- JWT tokens with 24-hour expiration
- Secure password hashing with bcrypt (10 rounds)
- Token verification middleware on protected routes
- Unique vote hashes prevent tampering
- One vote per position per voter enforcement
- Database constraints prevent duplicate votes
- All actions logged with timestamps
- IP address and user agent tracking
- Comprehensive audit log for investigations
- PINs are never stored in plain text
- SQL injection protection via parameterized queries
- CORS enabled for frontend-backend communication
- Click "Register as New Voter"
- Fill in all required fields
- Create a PIN (minimum 4 digits)
- Submit registration
- Note your voter card number
- Use your National ID and PIN
- Access the voting ballot
- Select candidates for each position
- Green checkmarks indicate your selections
- View live results at any time
- Click "View Live Results"
- See real-time vote counts and percentages
- Results update immediately as votes are cast