A progressive Node.js framework for building efficient and scalable server-side applications.
A NestJS backend API that allows multiple users to join shared "rooms" (groups) to unlock benefits when the group is full.
✅ Create Group Rooms: Define maximum participants and get unique room identifiers
✅ Join Groups: Users can join available groups until they're full
✅ Real-time Status: Check current participants, completion status, and time remaining
✅ Auto-Expiry: Groups automatically expire after 30 minutes if not completed
✅ JSON Storage: All data persisted in groups.json file
-
NVM Use
nvm use
-
Install dependencies
npm install
-
Start the server
npm run start:dev
-
Test the API
# Create a group curl -X POST http://localhost:3000/groups \ -H "Content-Type: application/json" \ -d '{"name": "Adventure Quest", "maxParticipants": 4}' # Join the group (replace GROUP_ID with actual ID) curl -X POST http://localhost:3000/groups/GROUP_ID/join \ -H "Content-Type: application/json" \ -d '{"userId": "user123"}' # Check group status curl http://localhost:3000/groups/GROUP_ID
| Method | Endpoint | Description |
|---|---|---|
| POST | /groups |
Create a new group room |
| POST | /groups/:id/join |
Join an existing group |
| GET | /groups/:id |
View group status |
| GET | /groups |
Get all groups |
Each group contains:
id: Unique identifier (UUID)name: Group namemaxParticipants: Maximum number of usersuserIds: Array of joined user IDscreatedAt: Creation timestampisComplete: Whether group is fullisExpired: Whether group has expired
- Groups complete when they reach
maxParticipants - Groups expire 30 minutes after creation if not completed
- Users cannot join the same group twice
- No joining full or expired groups
See API_TESTING.md for comprehensive testing examples and scenarios.
- NestJS: Modern Node.js framework
- TypeScript: Type-safe development
- JSON Storage: Simple file-based persistence
- UUID: Unique group identifiers
- CORS Enabled: Cross-origin request support