- Search hospitals
- View doctor/counter queues under a hospital
- Mock payment (₹1) -> generate token
- Live tracking: current token, people ahead, estimated wait time
- Token saved in
localStorage
- Simple admin login (username/password)
- Create hospitals
- Create multiple queues per hospital
- Real-time controls: Next Token and Skip Token
LineLess India/
backend/
.env.example
package.json
src/
app.js
db.js
server.js
controllers/
adminController.js
hospitalsController.js
queuesController.js
tokensController.js
middleware/
adminAuth.js
models/
Hospital.js
Queue.js
Token.js
routes/
admin.js
hospitals.js
index.js
queues.js
tokens.js
services/
queueService.js
socket/
setupSocket.js
utils/
queueMath.js
frontend/
.env.example
package.json
index.html
postcss.config.js
tailwind.config.js
vite.config.js
src/
App.jsx
main.jsx
api/client.js
components/
PaymentModal.jsx
QRCodeCard.jsx
lib/storage.js
pages/
HospitalSearchPage.jsx
QueuePage.jsx
admin/
AdminDashboardPage.jsx
AdminLoginPage.jsx
styles/
index.css
- Node.js (LTS)
- MongoDB running locally (default below)
- Ports:
- Backend:
5000 - Frontend:
5173
- Backend:
cd backend
cp .env.example .env
npm install
npm run devBackend environment defaults:
MONGO_URI=mongodb://127.0.0.1:27017/lineLessIndiaADMIN_USERNAME=adminADMIN_PASSWORD=adminJWT_SECRET=lineLessIndia-secret
In another terminal:
cd frontend
cp .env.example .env
npm install
npm run devOpen http://localhost:5173
- Go to
http://localhost:5173/admin/login - Login with
admin / admin - Create a hospital
- Add one or more queues (doctor/counter)
- Use Next Token / Skip Token to advance the queue
- On
/, search and select a hospital - Click Join Queue
- Click Confirm Payment (mock)
- You’ll get a token and see live updates
Base URL: http://localhost:5000
POST /hospitals(admin auth)GET /hospitals?q=...
POST /queues(admin auth) body:{ hospitalId, name, avgTimePerUser }GET /queues/:hospitalId
POST /token/:queueIdbody:{ mockPayment: true }GET /queue-status/:queueId?tokenNumber=...
POST /next/:queueId(admin auth)POST /skip/:queueId(admin auth)
- Client emits:
joinQueuewith{ queueId } - Server emits to that room:
queue:updatewith:queueId,hospitalId,queueNamecurrentTokenavgTimePerUserwaitingTokensandwaitingCountnextTokenNumber
Rooms are queue:${queueId}.
tokenNumber = queue.currentToken + waitingTokens.length + 1estimatedWaitTime = peopleAhead * avgTimePerUser
Prototype note: for simplicity this version doesn’t implement a distributed lock for simultaneous token creation.