Intermediate6h 31m

Full Stack Polling App with MERN Stack

Build a production-ready Polling application from scratch using MongoDB, Express, React, and Node.js. Includes JWT authentication, multiple poll types (single-choice, yes/no, rating, image-based), voting with live results, bookmarks, and admin controls to close or delete polls.

MongoDBExpressReactNode.jsJWTTailwind

What You'll Build

User signup & login with JWT authentication
Create polls with multiple types (single-choice, yes/no, rating, image-based)
View all polls in a paginated list
Filter polls by type (rating, image, yes/no, single-choice)
Vote on polls and view live results
Bookmark favourite polls for quick access
View all polls you have previously voted on
Admin: close polls once finished
Admin: delete polls
Role-based access control (user vs admin)

What You'll Learn

MERN stack project architecture from scratch
JWT auth with role-based access control (admin vs user)
Designing flexible MongoDB schemas for multiple poll types
REST API with Express โ€” CRUD, filtering, and aggregation
React state management for voting and bookmarks
Conditional UI rendering based on poll type
Live poll result visualisation after voting
Admin-only route protection on both frontend and backend

Tech Stack

MongoDBStores users, polls, votes, and bookmarks as flexible documents โ€” ideal for varied poll type schemas.
ExpressPowers the REST API covering auth, poll CRUD, voting, bookmarking, filtering, and admin operations.
ReactDrives the UI โ€” poll cards, voting UI, results charts, filter sidebar, and bookmark management.
Node.jsServer runtime connecting the Express API to MongoDB Atlas with environment-based config.
JWTSecures all protected routes; admin role is encoded in the token payload for access control.
TailwindUtility-first CSS for building a clean, responsive polling UI without custom stylesheets.
๐Ÿ’ฌ

Frequently Asked Questions

What prior knowledge do I need for this project?

Basic React and Node.js knowledge is recommended. If you have completed a beginner MERN project like a Notes App, you are well prepared for this one.

What makes this project different from a basic CRUD app?

This project introduces role-based access control, multiple dynamic data types (four poll types with different schemas), voting logic with result aggregation, and a bookmark system โ€” concepts that closely mirror real-world applications.

What is included in the source code?

You get the full React frontend, Express backend, Mongoose models, a .env.example, and a README with step-by-step local setup and deployment instructions.

How does the admin functionality work?

Admin access is controlled via a role field in the JWT payload. Admin users see additional controls on poll cards to close or delete polls โ€” regular users do not see these options.

Do I need to pay for any external service?

No. MongoDB Atlas free tier is sufficient, and both Render (backend) and Vercel (frontend) offer free hosting plans that work perfectly for this project.

Can I extend this project with new poll types?

Yes โ€” the poll schema and frontend rendering are designed to be extensible. Adding a new poll type means adding a schema variant and a matching React component.