Repository navigation
Scribble lab - #53
Open
DivyaSaiPagidipally wants to merge 28 commits into
Open
Scribble lab#53DivyaSaiPagidipally wants to merge 28 commits into
DivyaSaiPagidipally wants to merge 28 commits into
Conversation
…al components, and 80% test coverage principles
- plan.md: architecture decisions, tech choices, and phased approach - data-model.md: Room and Participant entity definitions with field descriptions - contracts/rooms-api.md: full REST API contract for room CRUD, start, and leave - research.md: trade-off notes on polling vs WebSockets, in-memory storage - quickstart.md: local dev setup and manual verification steps
- tasks.md: 29 tasks across 8 phases (setup → foundation → US1–US5 → polish) - Groups tasks by user story with parallel execution annotations - Targets 90% test coverage with unit tests included per story
Backend: - Extend Room model with hostId; Participant with isHost flag - Add Zod validation: name ≤32 chars, alphanumeric 4-char room codes - Uppercase-normalise room codes for case-insensitive isolation - Add startGame transition (lobby→game) gated to host + ≥2 players - Add leaveRoom: host leave destroys room, guest leave removes participant - Add POST /rooms/:code/start and DELETE /rooms/:code/leave endpoints - 17 unit tests covering host designation, isolation, and state transitions Frontend: - Display host badge next to the creator name in LobbyPage - Auto-poll room state every 2s; show reconnection warning on failure - Start Game button visible to host only; disabled until ≥2 players - Redirect all participants to /game when status transitions to 'game' - Redirect guests to landing page when host destroys the room - Client-side empty-name guard on CreateRoomPage and JoinRoomPage - 5 API service unit tests
Summarises implemented behaviour across all five user stories: host tracking, join validation, multi-room isolation, lobby auto-polling, and host-only game start with 2-player gate.
…ement Spec fixes (002-room-setup-lobby): - spec.md: mark status as Implemented; fix SC-003 from 200ms to 2.5s (bounded by 2s poll interval); lock FR-004 cadence from ~2s to exact 2000ms - plan.md: update constitution check from 80% to 90% test coverage; correct project structure diagram to show actual src-level test file paths - data-model.md: fix leave endpoint verb from POST to DELETE - tasks.md: mark T001 (dependency verification) as complete Tooling: - common.sh: disable check_feature_branch enforcement to allow single long-lived branch workflow (scribble-lab); original validation preserved as commented-out block for easy re-enabling
19-item lightweight self-review checklist (CHK001–CHK019) validating
spec/plan/tasks quality across six dimensions:
- Requirement completeness: US1–US5 FR traceability, edge case coverage
- Requirement clarity: ambiguous terms ("immediately", "temporary", "automatically")
- Requirement consistency: HTTP verb alignment, polling cadence, coverage %
- Acceptance criteria quality: measurability of SC-002/SC-003/SC-004
- Scenario coverage: post-start join, duplicate names, participant cap (gaps)
- Plan & tasks consistency: task-to-FR traceability, project structure accuracy
Surfaces 5 unresolved gaps (CHK003/004/013/014/015) to decide before
writing the next feature spec.
- CHK004 now marked fixed: POST /rooms/:code/join returns 409 Conflict if room.status === 'game' - CHK013 now marked fixed: same restriction for guests joining after game start Ensures no participants can join a game already in progress, preventing broken state. Refs: implementation-readiness checklist (CHK004, CHK013)
…wer-only word visibility
… interaction (Feature 004)
…s clear, guess input validation, normalized secret word matching, scoring, and scoreboard/log UI
…result and restart (Feature 005)
…updates, API endpoints, frontend dashboard, redirect effects, and unit tests
Replace in-memory Map with node:sqlite-backed room repository. DB defaults to backend/data/scribble.db (DB_PATH override); tests use :memory:. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the core game lifecycle features and resolves starter codebase gaps for Branded Scribble, a multiplayer drawing and guessing game. The implementation spans all four target feature groups:
Room Setup & Lobby:
~2sintervals to dynamically update player lists.Game Start & Drawer Flow:
drawer, guests asguessers)."rocket").Gameplay Interaction:
Result & Restart:
"lobby", removing roles, resetting scores to 0, and cleanly redirecting all players back to the lobby.Gaps & Assumptions Resolved:
/bugsuffix in the frontend API base URL fallback, restoring client-server connectivity.Contributor