Scribble lab#149
Open
shivangi-jain20 wants to merge 6 commits into
Open
Conversation
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.
This pull request introduces the foundational engineering constitution for the Scribble multiplayer game and implements the core backend logic for room management, game state transitions, drawing, and guessing. It enforces strict validation, robust error handling, and test coverage for all critical game flows. The most important changes are summarized below.
Project Governance and Standards
.specify/memory/constitution.mdto define long-term engineering principles, enforcing TypeScript typing, immutability, React patterns, strict validation, modularity, and security constraints for all future development.Backend API Enhancements
Expanded
backend/src/api/rooms.tsto support all essential game actions: starting games, submitting guesses, updating/clearing drawings, and restarting rounds, with all routes protected by strict Zod schema validation. Improved error messages for missing rooms. [1] [2] [3]Introduced comprehensive Zod schemas in
backend/src/api/schemas.tsfor all API payloads, including validation for player names, room codes, guesses, drawing data, and participant actions.Game Logic and Data Model
RoomandRoomSnapshotmodels inbackend/src/models/game.tsto include game status (lobby,active,results), host and drawer tracking, secret word, guesses, scores, drawing data, and correct guessers, enabling full round lifecycle and state isolation.Testing and Validation
backend/src/api/schemas.test.tsandbackend/src/services/roomStore.test.tsto verify schema validation, deterministic word selection, state transitions, role enforcement, guess correctness, drawing permissions, and round restarts. [1] [2] [3] [4]Code Quality and Error Handling
Contributor
Email: shivangi.jain@everest.engineering
Role: Developer
These changes lay the groundwork for a robust, secure, and maintainable multiplayer drawing game backend, with clear standards for future development and comprehensive test coverage.