Skip to content
Sandeep-Reddy-18Public

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BallotNXT πŸ—³οΈ

BallotNXT is a biometric-enabled election management platform that combines a web-based administration portal with desktop hardware integration for secure voter verification. The system integrates fingerprint authentication, facial verification, and role-based access control to streamline election management workflows. It allows Polling Officers and Booth Level Officers to verify voters using a hybrid approach of traditional credentials, physical fingerprint scanning, and facial recognition.

Highlights

β€’ Biometric fingerprint authentication
β€’ Face verification using WebRTC
β€’ Custom Windows URI protocol integration (ballotnxt://)
β€’ Role-Based Access Control (RBAC)
β€’ Real-time WebSocket monitoring
β€’ JWT Authentication.

🌟 Features

  • Multi-Role Dashboards: Distinct interfaces and restricted route access for Admins, Polling Officers (PO), Booth Level Officers (BLO), and standard Voters.
  • Hardware Isolation Bypass: A custom URI protocol (ballotnxt://) that allows the web application to securely trigger local desktop executables, capturing live fingerprint data without violating browser security sandboxes.
  • Hybrid Biometric Engine: Python-based backend that dynamically controls template extraction and matching to a Java-based SecuGen SDK.
  • Facial Verification: WebRTC and Canvas-based frontend integration to verify voter identity via deep-learning facial mapping.
  • Security Features: Implementation of HttpOnly JWT cookies, double-submit CSRF protection, IP-based rate limiting (Flask-Limiter), and Bcrypt password hashing.
  • Real-time Monitoring: WebSocket (SocketIO) integration to instantly alert administrators of failed or suspicious biometric login attempts.

πŸ› οΈ Tech Stack

Component Technology
Frontend HTML5, CSS3, Vanilla JavaScript, WebRTC
Backend Python 3.10+, Flask, WebSockets (Flask-SocketIO)
Database SQLAlchemy (SQLite / MySQL)
Security Flask-JWT-Extended, Flask-Bcrypt, Flask-Limiter
Biometric SDK Java 19, SecuGen FDxSDKPro

πŸ—οΈ Architecture & Workflow

BallotNXT utilizes an Inter-Process Communication (IPC) architecture to solve the browser-to-hardware limitation:

  1. Initiation: An official inputs their ID on the web portal, generating a short-lived Transaction UUID.
  2. Trigger: The browser calls ballotnxt://login?transaction_id=UUID, launching the local Windows scanner application.
  3. Capture: The local app interfaces with the SecuGen scanner, extracts the fingerprint template, and POSTs it directly to the Flask backend.
  4. Matching: The Python backend spawns a Java SDK subprocess (FingerprintMatcher.jar) to validate the template against the SQL database.
  5. Resolution: The web frontend polls the server, detects the successful match, issues a secure JWT, and redirects to the dashboard.

πŸ“‚ Project Structure

BallotNXT/
β”œβ”€β”€ app/                  # Core Flask application
β”‚   β”œβ”€β”€ routes/           # Blueprint controllers (admin, auth, voter, etc.)
β”‚   β”œβ”€β”€ static/           # Vanilla JS, CSS, and UI assets
β”‚   β”œβ”€β”€ templates/        # Jinja2 HTML views
β”‚   β”œβ”€β”€ models.py         # SQLAlchemy database schemas
β”‚   └── decorators.py     # Custom RBAC decorators
β”œβ”€β”€ biometric_lib/        # SecuGen DLLs and JAR files
β”œβ”€β”€ docs/                 # Windows Registry and deployment guides
β”œβ”€β”€ config.py             # Environment configurations
β”œβ”€β”€ run.py                # WSGI entry point
└── seed.py               # Database initialization and demo data

πŸ“Έ Screenshots

Landing

Landing

FAQ

FAQ

Login

Login

Biometric Capture

Biometric Capture

Admin Dashboard

Admin Dashboard

Manage Polling Officer

Manage Po

Manage Booth Level Office

Manage Blo

Manage Voters

Manage Voters

Export Data

Export Data

Exported File

Exported File

Register And Verify Voter

Register And Verify Voter

Voter Login

Voter Login

Voter Dashboard

Voter Dashboard

βš™οΈ Installation

Prerequisites

  • Python 3.10+
  • Java 19 Adoptium Eclipse (Required for the SecuGen Biometric Matcher)
  • SecuGen Hamster U20 Pro & Device Drivers

1. Web Application Setup

# Clone the repository
git clone
cd BallotNXT

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment variables (see below)
cp .env.example .env

# Initialize the database with demo users
python seed.py

# Run the Flask server
python run.py

2. Configuration (.env)

Create a .env file in the root directory:

JWT_SECRET_KEY=your_secure_random_string_here
# DB_USER=root
# DB_PASSWORD=your_db_password
# DB_HOST=localhost
# DB_NAME=ballotnxt

3. Windows Desktop Deployment

To enable the biometric scanner to communicate with the web app:

  1. Ensure the SecuGen .dll and .jar files are placed in the biometric_lib directory.
  2. Run the BallotNXT installer (or follow the guide in docs/) to register the ballotnxt:// URI scheme in the Windows Registry.

πŸ“– Usage Workflow

  1. Admin / Official Login: Navigate to the login page. Select "Official Login" and enter an ECI ID (e.g., ADMIN001). This triggers the local biometric scanner for fingerprint authentication.
  2. Voter Registration (PO): Authenticated Polling Officers can navigate to /api/voters/add_new to register new voters, capturing their demographic details, facial encodings, and physical fingerprints.
  3. Identity Verification (BLO): Booth Level Officers use the /blo/verify endpoint via WebRTC to validate voters against their registered facial profiles in real-time.
  4. Voter Dashboard: Voters log in using standard credentials (EPIC ID + Password) to view their registration and voting status.

License

This project is intended for educational and academic purposes.
The secugen SDK used in this project is completely proprietary.