A real-time polling application where users can create custom polls, join rooms, vote, and view results instantly. Built with React and WebSocket for seamless live interaction.
- ✅ Create Polls: Set custom questions and options.
- 🔗 Join Rooms: Join existing polls using a room code.
- ⚡ Real-Time Voting: See votes update live across all participants.
- 🎛️ Master Controls: End the poll early as the poll creator.
- 🕒 Room Expiry: Inactive rooms auto-delete after 15 minutes.
- ✍️ Custom Questions: Full flexibility to define your poll content.
- React – For building dynamic UIs
- WebSocket – Real-time updates via WS connections
- Node.js – Lightweight server runtime
- ws – WebSocket library for the backend
- Docker – Containerized deployment
- Nginx – Serves the frontend
- Node.js (v16 or higher)
- Docker (optional, for containerized setup)
-
Clone the repository
git clone https://github.com/your-username/real-time-poll-app.git cd real-time-poll-app -
Install dependencies
# Backend cd backend npm install # Frontend cd ../frontend npm install
-
Start the servers
# Backend cd ../backend npm start # Frontend cd ../frontend npm start
-
Access the app Open your browser at: http://localhost:3000
-
DEPLOYED LINK Live Demo Check out the deployed version: real-time-polling-app-deployed.netlify.app
- Enter your name
- Add a custom question and options
- Click Create Poll to get a room code
- Enter your name
- Enter the room code shared by the creator
- Choose an option
- Watch votes update in real-time
- The poll creator can end the session at any time
Build and run everything using Docker Compose:
docker-compose up --buildApp will be live at: http://localhost:3000
real-time-poll-app/
├── backend/
│ ├── index.js # WebSocket server logic
│ ├── package.json # Backend dependencies
│ └── Dockerfile # Backend container config
├── frontend/
│ ├── src/
│ │ ├── App.js # Main React component
│ │ ├── App.css # Styling
│ │ └── index.js # React entry point
│ ├── public/
│ │ └── index.html # Base HTML template
│ ├── package.json # Frontend dependencies
│ └── Dockerfile # Frontend container config
├── docker-compose.yml # Orchestration config
└── README.md # Project docs
- No additional configuration required
- WebSocket server runs on port 8080 by default
08399ea6deaf37b934305020b8ac4c3559057d60
