Skip to content

Test Submission #4

Closed
shirishaKodimala wants to merge 4 commits into
everest-engineering:mainfrom
shirishaKodimala:001-room-setup-lobby
Closed

Test Submission #4
shirishaKodimala wants to merge 4 commits into
everest-engineering:mainfrom
shirishaKodimala:001-room-setup-lobby

Conversation

@shirishaKodimala
Copy link
Copy Markdown

@shirishaKodimala shirishaKodimala commented May 27, 2026

Summary

Implements room setup and lobby functionality: host designation, room code validation, auto-polling lobby, and host-only game start.

Changes

Backend

  • backend/src/models/game.ts — Added hostId field to Room and RoomSnapshot; extended RoomStatus to include "playing"
  • backend/src/services/roomStore.ts — Creator is now automatically set as hostId on room creation; hostId exposed in snapshots; new startGame() service validates host + 2+ players before transitioning room to "playing"
  • backend/src/api/schemas.ts — Added startRoomSchema; roomCodeParamsSchema now rejects empty codes with .min(1)
  • backend/src/api/rooms.ts — New POST /rooms/:code/start endpoint with 403 (not host) / 400 (not enough players) error handling; improved join error message to "Room not found. Please check the code and try again"

Frontend

  • frontend/src/services/api.ts — Added startGame() API method; updated RoomSnapshot type with hostId and "playing" status
  • frontend/src/state/roomStore.ts — Added startGame() method to RoomStore class
  • frontend/src/pages/LobbyPage.tsx — Auto-polls every 2s via setInterval; shows "Host" badge on creator; start button disabled for non-hosts / < 2 players; auto-redirects to /game when status becomes "playing"
  • frontend/src/pages/JoinRoomPage.tsx — Client-side validation rejects empty room codes with "Please enter a room code"

Specs

  • All design artifacts generated: plan.md, research.md, data-model.md, contracts/api.md, quickstart.md, tasks.md

Testing

  • Both backend and frontend compile cleanly with tsc --noEmit
  • See specs/001-room-setup-lobby/quickstart.md for manual testing scenarios

Contributor

@salauddin-ee salauddin-ee changed the title 001 room setup lobby Test Submission May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants