Skip to content

Assignment#9

Open
swathi-manthri wants to merge 6 commits into
everest-engineering:mainfrom
swathi-manthri:assignment
Open

Assignment#9
swathi-manthri wants to merge 6 commits into
everest-engineering:mainfrom
swathi-manthri:assignment

Conversation

@swathi-manthri
Copy link
Copy Markdown

@swathi-manthri swathi-manthri commented May 29, 2026

Summary

Contributor

Swathi Manthri and others added 6 commits May 29, 2026 17:23
…oint

- Room model gains hostId (set to first participant on createRoom)
- RoomStatus expanded to lobby | playing | result on backend + frontend
- Name validation: trim + min(1) via Zod; Zod errors surface field message
- POST /rooms/:code/start: host-only, requires ≥2 players, sets status playing
- Fix starter bug: API base URL was pointing to /bug path
- Add backend tests for hostId, startGame gates (non-host 403, <2 players 403)
- Add spec/plan/tasks/data-model/contract artifacts for Feature Group 1

Traces to: FR-001, FR-002, FR-003, FR-004, FR-008, FR-011

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…tion

- CreateRoomPage: trim + empty-check before API call (FR-004)
- JoinRoomPage: trim + empty-check for name and code; uppercase normalise (FR-004, FR-005)
- LobbyPage: replace manual refresh with setInterval polling every 2s (FR-006, FR-007)
- LobbyPage: auto-navigate to /game when poll detects status === playing
- LobbyPage: host-only Start Game button, enabled only when >=2 players (FR-009)
- LobbyPage: non-hosts see waiting message instead of start button
- api.ts: add startRoom() for POST /rooms/:code/start
- roomStore: add startRoom() action

Traces to: FR-004, FR-005, FR-006, FR-007, FR-008, FR-009

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ware visibility

- Room model gains drawerId and secretWord (set on startGame)
- startGame sets drawerId = hostId, secretWord = STARTER_WORDS[0] ("rocket")
- toRoomSnapshot: secretWord included only when viewer === drawerId (FR-003, FR-004)
- All toRoomSnapshot call sites pass participantId for role-aware responses
- GamePage: shows role (Drawer/Guesser), secret word card for drawer only (FR-005, FR-006)
- Backend tests: drawerId set, secretWord set, visibility per viewer role
- Add spec/plan/tasks artifacts for Feature Group 2

Traces to: FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…coring

- Room model gains guesses[] and scores map (init on startGame)
- POST /rooms/:code/guess: trim, empty-check (400), case-insensitive compare,
  correct=100 incorrect=0 scoring (FR-002, FR-003)
- GET /rooms/:code returns guesses + scores in snapshot for all viewers (FR-004)
- DrawingCanvas: freehand HTML5 canvas with Clear button for drawer (FR-008, FR-009)
- GuessForm: wired with validation and onSubmit prop (FR-010)
- Scoreboard: renders participant scores from room snapshot (FR-007)
- ResultPanel: renders guess history with correct/incorrect indicators (FR-006)
- GamePage: polls every 2s for synced history + scores; clears on unmount (FR-005)
- Backend tests: guess stored, correct/incorrect scoring, empty rejected, case-insensitive

Traces to: FR-001 through FR-010

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- endGame(): host-only, playing→result status transition (FR-001)
- restartGame(): host-only, result→lobby; clears guesses/scores/drawerId/secretWord;
  participants preserved (FR-002, FR-007)
- POST /rooms/:code/end and POST /rooms/:code/restart routes
- toRoomSnapshot: secretWord revealed to all viewers when status is "result" (FR-003)
- ResultPage: shows correct word, scoreboard, guess history; host-only Restart button;
  polls every 2s; auto-navigates to /lobby on status="lobby" (FR-003, FR-004, FR-006)
- GamePage: poll auto-navigates to /result on status="result" (FR-005)
- GamePage: host-only End Round button
- /result route added
- Backend tests: endGame/restartGame status transitions, 403/400 gates, participant preservation

Traces to: FR-001 through FR-007

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Covers starter vs. added features, tradeoffs (polling, deterministic word,
server-side visibility, restart design), and AI usage notes with commit
traceability back to spec functional requirements.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant