LivePoll is a real-time voting application where users log in with email OTP, create polls, and vote instantly. Registered users receive email alerts when new polls go live.
- Email OTP authentication (JWT-based)
- Automatic email notifications when a new poll is created
- One-time voting with live results via Socket.IO
- Polls auto-close after 12 hours
- Create polls with 2 to 6 options
- Responsive React UI with GSAP animations
- Frontend: React, React Router, Socket.IO Client, GSAP
- Backend: Express.js, Socket.IO, Mongoose, Nodemailer, JWT
- Database: MongoDB
npm run install-allCopy server/.env.example to server/.env and fill in your values:
cp server/.env.example server/.envRequired:
MONGO_URI— MongoDB connection stringJWT_SECRET— secret key for auth tokens
Required for real emails (OTP + poll notifications):
EMAIL_HOST,EMAIL_USER,EMAIL_PASS— SMTP credentials
Gmail setup: Create an App Password and use:
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your@gmail.com
EMAIL_PASS=your_16_char_app_passwordnpm start- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- User enters email on
/login→ receives a 6-digit OTP at that email - After OTP verification, their email is stored in MongoDB as a verified user
- When any logged-in user creates a poll, all verified users receive an email like:
Subject: 📢 New Poll is Live!
Hello John,
Devansh has just started a new poll.
Poll: Who is the greatest football player?
Cast your vote before the poll closes in 12 hours.
Vote Now: http://localhost:3000/poll/12345
npm start— start both frontend and backendnpm run server— backend onlynpm run client— frontend onlynpm run build— build React client