Skip to content

sheix-khizar/VotingSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—³οΈ Simple Voting System (Full Stack)

A basic full-stack voting system using React JS, Tailwind CSS, Node.js, Express.js, and MySQL (XAMPP) with login authentication.


πŸ”§ Features

  • βœ… User Registration & Login (Session-based)
  • πŸ—³οΈ Vote for your favorite candidate (once per user)
  • πŸ›‘οΈ Authentication & session management
  • πŸ’Ύ All data stored locally using MySQL (via XAMPP)
  • 🎨 Simple responsive UI using Tailwind CSS

πŸ“ Project Structure

voting-system/
β”œβ”€β”€ client/        # Frontend (React + Tailwind)
β”œβ”€β”€ server/        # Backend (Node.js + Express)
β”‚   └── db.sql     # SQL script to create database and tables

πŸš€ Getting Started

βœ… Prerequisites

  • Node.js and npm
  • XAMPP (with MySQL)
  • Git

πŸ“¦ Backend Setup (Node.js + Express)

  1. Open terminal and navigate to the server folder
  2. Run:
    npm install
    node server.js
  3. The backend will start on http://localhost:5000

🎨 Frontend Setup (React + Tailwind CSS)

  1. Open terminal and navigate to the client folder
  2. Run:
    npm install
    npm start
  3. Frontend will run at http://localhost:3000

πŸ› οΈ MySQL Setup (XAMPP)

  1. Start Apache and MySQL using XAMPP
  2. Open http://localhost/phpmyadmin
  3. Import the db.sql file from the server folder to create:
    • Database: voting_db
    • Tables: users, votes

πŸ’‘ Default Flow

  1. User registers with a username and password
  2. User logs in and is authenticated
  3. After login, user can vote for a candidate
  4. Each user can vote only once

πŸ“· Screenshots

Voting System Preview


πŸ“œ License

This project is open source and free to use for educational purposes.


Releases

No releases published

Packages

No packages published