A full-stack Online Voting System built using Next.js (Frontend) and Node.js + Express + MongoDB (Backend). This system allows users to vote online and admins to manage elections securely.
#User (Voter)
- Login as voter
- View available elections
- Cast vote
- See confirmation
#Admin
- Login as admin
- Create candidates
- View vote counts
- Manage elections
#🛠️Tech Stack
- Next.js (React)
- Tailwind CSS
- Node.js
- Express.js
- MongoDB (Atlas)
- JWT Authentication
online-voting-system/ → Frontend (Next.js)
voting-app/backend/ → Backend (Express API)
::Backend (.env)
MONGO_URI=your_mongodb_url
PORT=5000
JWT_SECRET=your_secret_key
:: Frontend (.env.local)
NEXT_PUBLIC_API_URL=https://your-backend-url.onrender.com
::Backend
cd backend
npm install
npm startcd online-voting-system
npm install
npm run devOpen browser:
http://localhost:3000
::Backend Deployed on Render
::Frontend Runs on Next.js
| Method | Endpoint |
|---|---|
| GET | /api/votes |
| POST | /api/votes |
| POST | /api/auth/login |
This project is useful for:
- College elections
- Student voting systems
- Online polling platforms
Eby P J
Caroline Shaju
B.Tech Students
India