All Projects
Intermediate · Case Study

Voter Management

Election integrity engineered in C++.

A secure voter management system built in C++ with a web interface — handling voter registration, authentication, ballot casting, and result tabulation with strict validation rules, object-oriented architecture, and data persistence across sessions.

C++JavaScriptNode.js
GitHub
Voter Management

The Problem

What needed solving.

Digital voting systems are notoriously hard to get right. Most student-built systems have no meaningful access control, allow double-voting, and store results in memory that disappears on restart. Building a system that is actually secure — even as a prototype — requires thinking about trust boundaries, authentication, and data integrity from the start.

The Solution

How I solved it.

A C++ backend implementing a complete voter lifecycle — registration with unique voter ID generation, PIN-based authentication, single-vote enforcement via a voted flag, result tabulation, and JSON file persistence. A Node.js API layer exposes this to a minimal web frontend.

Features

What it does.

Authenticated Voting

Voters authenticate with their unique ID and PIN before accessing the ballot. Failed authentication is logged with a lockout after 3 attempts.

Authenticated Voting

Double-Vote Prevention

A voted flag is set atomically when a ballot is cast — subsequent vote attempts by the same voter are rejected at the C++ layer before reaching the ballot.

Live Result Tabulation

Admin panel shows real-time vote counts per candidate, voter turnout percentage, and a final results declaration when the election closes.

Persistent Data Storage

Voter records and vote counts are serialised to JSON files — the system recovers full state on restart with zero data loss.

System Architecture

How it's built.

Core EngineC++Voter registry, authentication, ballot casting, result tabulation
PersistenceJSON filesVoter records, vote counts, election state serialisation
API BridgeNode.jsHTTP endpoints calling C++ subprocess for each operation
FrontendJavaScriptVoter portal, admin results dashboard

Technology Stack

Backend

C++

API Bridge

Node.js

Frontend

JavaScript

Challenges & Solutions

Real problems, real fixes.

Challenge

Synchronising concurrent vote requests to the C++ subprocess without race conditions.

Solution

Made each Node.js request spawn a fresh C++ process with file locking — only one process modifies the voter record file at a time.

Challenge

C++ subprocess crashing silently and corrupting the voter file.

Solution

Added a write-to-temp-then-rename strategy — the voter file is only replaced atomically after a successful write, preventing partial writes from corrupting state.

Demo & Screenshots

See it live.

Voter Management system

Voter authentication and ballot interface

Explore the full source code and documentation.

View on GitHub← All Projects