Skip to content

bismay70/election-poll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

98 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—ณ๏ธ Election Poll System

A full-stack SaaS-style web application that enables secure online elections with role-based access control (RBAC).
Built using React (frontend) and Node.js/Express + MongoDB (backend).

The platform provides role-based dashboards, secure voting, real-time analytics, and modern UI/UX.


๐ŸŒ Deployment

Application communication flow:

flowchart TD
    A[Frontend] -->|Axios API Requests| B[Node.js / Express Backend]
    B --> C[(Database)]
    B -->|JWT Authentication| D[Protected API Routes]
    A -. CORS Policy .-> B
Loading

๐Ÿงญ System Architecture

flowchart LR

    A[React Frontend - Client]

    A --> B[Admin Dashboard]
    A --> C[Candidate Dashboard]
    A --> D[Voter Dashboard]

    B -->|Axios API Requests| E[Express API Routes]
    C -->|Axios API Requests| E
    D -->|Axios API Requests| E

    E --> F[Auth Middleware - JWT Verification]
    F --> G[Role Middleware - RBAC Authorization]

    G --> H[Controller Logic]
    H --> I[Model Layer]
    I --> J[(MongoDB Atlas Database)]
Loading

๐Ÿš€ Features

  • Clean and feature-based modular folder structure for scalability and maintainability.

๐Ÿ‘ค Authentication & Roles

Secure authentication using JWT tokens and role-based access control (RBAC).

Supported roles:

Admin

  • Manage candidates
  • Monitor voter participation
  • View election statistics and analytics
  • Manage candidate credentials

Candidate

  • View personal vote count
  • View current rank among candidates
  • Analyze vote share and voter participation

Voter

  • Cast vote securely
  • Vote only once
  • Receive confirmation after voting

๐Ÿ—ณ๏ธ Voting System

  • Secure single-vote mechanism
  • Dynamic candidate list fetched from backend
  • Duplicate voting prevention
  • Confirmation message after voting
  • Server-side validation for vote integrity

๐Ÿ“Š Results & Analytics

Candidate Dashboard

  • View personal vote count
  • View candidate rank
  • Analyze vote share using charts
  • View voter participation metrics

Voter Dashboard

  • View available candidates
  • Cast a vote securely
  • Receive voting confirmation
  • View voting status

Admin Dashboard

  • View vote counts of all candidates
  • Monitor election statistics
  • Real-time election analytics

๐Ÿ“ก Real-Time Updates

The system supports real-time analytics updates using WebSockets, enabling dynamic dashboard updates without page refresh.


๐ŸŽจ Frontend (React + SaaS-style UI)

Modern frontend built with React and TailwindCSS featuring a SaaS-style dashboard interface.

Features:

  • Responsive design
  • Role-based dashboards
  • Skeleton loading states
  • Interactive charts and analytics
  • Smooth UI animations using Framer Motion
  • Interactive UI components using Swiper.js
  • Custom toast notifications
  • Demo login credentials for testing

๐Ÿ”ง Backend (Node.js, Express, MongoDB)

Backend built using Node.js and Express following RESTful architecture.

Capabilities:

  • Authentication APIs
  • Voting APIs
  • Candidate management APIs
  • Analytics APIs
  • Role-based middleware protection
  • MongoDB Atlas data persistence

๐Ÿ”’ Security

The system includes multiple security layers:

  • Password hashing using bcrypt
  • JWT-based authentication
  • Protected API routes
  • Role-based access control (RBAC)
  • Duplicate vote prevention
  • Secure CORS configuration
  • Environment variable protection

Voting confirmation message:

โ€œYour vote has been recorded securely.โ€


๐Ÿ—๏ธ Tech Stack

Frontend

  • React
  • TailwindCSS
  • React Router
  • Axios
  • Recharts
  • Swiper.js
  • Framer Motion
  • React Hot Toast
  • lucide-react

Backend

  • Node.js
  • Express.js
  • MongoDB Atlas
  • JWT Authentication
  • bcrypt
  • WebSockets

Deployment

  • Frontend: Vercel
  • Backend: Render

๐Ÿงช Demo Accounts

The login page includes demo accounts for testing different roles. Available roles:

  • Admin
  • Candidate
  • Voter

Users can click a demo account to automatically fill login credentials.


๐Ÿ“ธ Screenshots

Login Page Admin Dashboard
Login Admin
Candidate Analytics Voting Page
Analytics Voting

๐Ÿ”ฎ Future Plans

  • OTP-based phone verification for voters
  • Facial recognition authentication for secure voting
  • Multi-election/event support
  • JWT refresh tokens for improved authentication security
  • Email notifications after successful voting
  • Election scheduling system
  • Advanced analytics dashboards
  • Further UI/UX enhancements and accessibility improvements

โญ Project Highlights

This project demonstrates:

  • Full-stack web development
  • Secure authentication systems
  • Role-based architecture (RBAC)
  • Real-time analytics dashboards
  • Modern SaaS-style UI
  • Production-ready architecture
  • Designed to scale for multi-election systems

About

ElectPoll is a modern, user-friendly online voting solution bringing transparency and efficiency to elections. Voters get a personalized dashboard with secure one-time voting, status tracking, and instant digital Voter ID cards. Admins can manage elections with real-time analytics, geographic insights, and interactive scheduling tools. Built with R

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors