🗳️   CSE 3522 · DBMS Laboratory · UIU

Digital Democracy Reimagined. A secure, database-driven e-voting platform built for transparency.

VoteChain is a full-stack web application that modernizes elections through robust database design, role-based access control, and real-time result generation — powered by MySQL and PHP.

Explore Demo → Read Documentation
5
DB Tables
3
User Roles
3NF
Normalized
100%
Duplicate-proof
🔒
Secure Auth
Session-based login with hashed passwords
🗳️
One-Person-One-Vote
DB-enforced duplicate prevention
📊
Live Results
Real-time vote aggregation via SQL
🌐
Area-Based Voting
Geo-scoped elections per region
Role-Based Access
Admin, Voter, Candidate separation
🔄
Election Lifecycle
Application → Voting → Ended states
// documentation

System Architecture
& Database Design

A deep dive into the DBMS concepts powering VoteChain — from entity relationships to the SQL queries that keep every vote honest.

01 / Schema

Relational Schema

Five normalized tables in 3NF, connected via foreign keys with strong referential integrity.

TablePrimary KeyForeign Keys
VOTERSvoter_id PK
ADMINSadmin_id PK
ELECTIONSelection_id PK
CANDIDATEScandidate_id PKelection_id FK
VOTESvote_id PKvoter_id, election_id, candidate_id FK
02 / Queries

Result Aggregation Query

The heart of the system — a LEFT JOIN ensures zero-vote candidates still appear in results.

SQL SELECT c.name, c.symbol, COUNT(v.id) AS votes FROM candidates c LEFT JOIN votes v ON v.candidate_id = c.id WHERE c.election_id = $election_id GROUP BY c.id ORDER BY votes DESC; -- Duplicate vote prevention SELECT id FROM votes WHERE voter_id = $voter_id AND election_id = $election_id;
03 / Lifecycle

Election Lifecycle Flow

Every election progresses through three managed states, controlled exclusively by the admin.

1
APPLICATION Phase
Candidates apply; admin reviews and approves/rejects submissions.
2
VOTING Phase
Eligible voters log in, see area-relevant candidates, and cast one vote.
3
ENDED Phase
Votes tallied in real-time; results published publicly by admin.
04 / Access Control

Role-Based Permissions

Three distinct roles with separate dashboards and strictly scoped database operations.

👤 Voter
  • Register & login
  • View elections
  • Cast one vote
  • View results
🎯 Candidate
  • Apply for election
  • Await approval
  • Participate if approved
🛡️ Admin
  • Manage elections
  • Approve candidates
  • Control lifecycle
  • Reset & publish
05 / Security

Security Architecture

Multi-layered protection against fraud, injection, and unauthorized access.

🔑
Password Hashing
All passwords stored hashed — plaintext never touches the DB.
🍪
Session Authentication
PHP sessions validate every request; role checked on each route.
🚫
Duplicate Prevention
DB-level UNIQUE constraint + pre-insert SELECT check prevent re-voting.
🧹
Input Sanitization
All user inputs sanitized before SQL execution to prevent injection.
06 / Stack

Technology Stack

Built entirely on open-source technologies, locally deployable via XAMPP.

STACK // Database MySQL → DBMS, relational storage // Backend PHP → server-side logic Apache → web server (XAMPP) // Frontend HTML5 → structure CSS3 → styling & layout // Design 3NF → normalization standard RBAC → access model
// interactive demo

See It In Action

Explore the key interfaces of the E-Voting system — from voter login to real-time results and the admin control panel.

Modules
🗳️ Voter Login
📊 Election Results
🛡️ Admin Dashboard
🎯 Candidate Review

🗳️ Voter Login

Registered voters log in with email + password. Status must be ACTIVE to proceed.

🗳️ Voter Login
Login to cast your vote
voter@example.com
••••••••••

📊 Election Results

Real-time vote counts via LEFT JOIN aggregation — Dhaka-18 Constituency.

NATIONAL ELECTION · DHAKA-18 · MEMBER OF PARLIAMENT
Candidate
Symbol
Votes
Status
Kamal
Bottle
2
🏆 Winner
Pial
Boat
0
Tusar
Daripalla
0

🛡️ Admin Dashboard

Central control panel for managing the full election lifecycle.

WELCOME BACK
👋 Yousuf · Admin Control Panel
Create Election
New Single or Multiple constituency election
📋
Manage Elections
Start, pause, and end elections
👤
Approve Candidates
Review and approve/reject applications
📊
Results
View and reset election results

🎯 Candidate Review

Admin approves or rejects candidate applications before the voting phase begins.

Candidate
Status
K
Kamal
Symbol: Bottle · Dhaka-18
✓ Approved
T
Tanvir
Symbol: Dhaner Shish · Dhaka-10
✓ Approved
R
Rafid
Symbol: Nook · Dhaka-10
⏳ Pending
P
Pial
Symbol: Boat · Dhaka-18
✓ Approved
// the team

Built By

Four Computer Science students at United International University, Section F, CSE 3522 — DBMS Laboratory.

AN
Abdullah Al Noor
ID: 0112310479
YK
Yousuf Kamal Himel
ID: 0112310526
MT
Md. Tusar Ali
ID: 0112310577
TA
Md. Tanvir Ahmed
ID: 0112320065
TD
Course Instructor

Tanmoy Bipro Das

Lecturer, Department of Computer Science and Engineering
United International University

// sustainable development

SDG Alignment

VoteChain directly supports the United Nations Sustainable Development Goals through digital democratic empowerment.

16
PEACE, JUSTICE AND STRONG INSTITUTIONS
🕊️

How VoteChain advances SDG 16

  • Transparent Institutions — Real-time result publication eliminates opacity and manual manipulation in vote counting, building public trust in democratic outcomes.
  • Reduced Corruption — One-person-one-vote enforcement and audit-ready vote records make election fraud mathematically difficult and detectable.
  • Inclusive Participation — Digital access removes geographic and physical barriers, enabling broader civic participation for all eligible voters.
  • Accountable Governance — Role-based access ensures every action (approval, vote, result reset) is attributable to a specific authorized user in the database.
  • Rule of Law — System constraints like status validation and session authentication enforce electoral rules automatically, without human discretion or error.
// technology stack
MySQL 8.0
PHP 8.x
Apache
XAMPP
HTML5 / CSS3
3NF Normalization
RBAC
Session Auth
BCrypt Hashing