Tech Stack: Node.js, Express, MongoDB, Mongoose, Zod, JWT, bcrypt, ws (WebSocket)

Duration: 3 hours


Overview

Build a complete backend system with:

Key Assumption: Only ONE class session can be active at a time on WebSocket. No room management needed - all broadcasts go to all connected clients.


Response Format Standard

Success Response

{
  "success": true,
  "data": { ... }
}

Error Response

{
  "success": false,
  "error": "Error message",
}

All HTTP responses MUST follow this format!


JWT Authentication