|
| 1 | +# Real-Time Polling System |
| 2 | + |
| 3 | +A real-time polling and chat application where a teacher can create live questions and students can answer instantly. |
| 4 | +Built using **Node.js, Express, Socket.IO, MongoDB** on the backend and **React, Tailwind CSS** on the frontend. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 🔗 Live Links |
| 9 | + |
| 10 | +- **Frontend:** https://real-time-polling-system-frontend.vercel.app/ |
| 11 | +- **Backend:** https://real-time-polling-system-1.onrender.com/ |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## 🚀 Features |
| 16 | + |
| 17 | +- Real-time polling using Socket.IO |
| 18 | +- Live results update for teacher and students |
| 19 | +- Automatic timeout handling (unanswered students are treated as answered) |
| 20 | +- Teacher cannot create next question until current one finishes |
| 21 | +- Real-time chat between teacher and students |
| 22 | +- Students only see live questions (no old questions) |
| 23 | +- Teacher disconnect automatically ends the current question |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 🖥️ Run Locally |
| 28 | + |
| 29 | +### 1️⃣ Clone the repository |
| 30 | + |
| 31 | +```bash |
| 32 | +git clone https://github.com/chandankumarm55/Real-Time-Polling-System.git |
| 33 | +cd Real-Time-Polling-System |
| 34 | +``` |
| 35 | + |
| 36 | +### 2️⃣ Backend Setup |
| 37 | + |
| 38 | +Create a `.env` file inside the `server` folder: |
| 39 | + |
| 40 | +```env |
| 41 | +PORT=5000 |
| 42 | +NODE_ENV=development |
| 43 | +MONGODB_URI=mongodb+srv://chandan:chandan228@cluster0.tvto3to.mongodb.net/ |
| 44 | +``` |
| 45 | + |
| 46 | +Install dependencies and start server: |
| 47 | + |
| 48 | +```bash |
| 49 | +cd server |
| 50 | +npm install |
| 51 | +npm run dev |
| 52 | +``` |
| 53 | + |
| 54 | +Backend will run at: |
| 55 | + |
| 56 | +``` |
| 57 | +http://localhost:5000 |
| 58 | +``` |
| 59 | + |
| 60 | +### 3️⃣ Frontend Setup |
| 61 | + |
| 62 | +Create a `.env` file inside the `client` folder: |
| 63 | + |
| 64 | +```env |
| 65 | +VITE_SOCKET_URL=http://localhost:5000 |
| 66 | +VITE_API_URL=http://localhost:5000/api |
| 67 | +``` |
| 68 | + |
| 69 | +Install dependencies and start frontend: |
| 70 | + |
| 71 | +```bash |
| 72 | +cd client |
| 73 | +npm install |
| 74 | +npm run dev |
| 75 | +``` |
| 76 | + |
| 77 | +Frontend will run at: |
| 78 | + |
| 79 | +``` |
| 80 | +http://localhost:5173 |
| 81 | +``` |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | + |
| 86 | +## 👨💻 Author |
| 87 | + |
| 88 | +**Chandan Kumar** |
| 89 | +GitHub: [chandankumarm55](https://github.com/chandankumarm55) |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## ⭐ Support |
| 94 | + |
| 95 | +If you like this project, feel free to star the repository ⭐ |
0 commit comments