updating docs
This commit is contained in:
parent
8aaafea3fc
commit
4c48859d00
3 changed files with 30 additions and 311 deletions
|
|
@ -176,37 +176,36 @@ _Note: Deployment was moved ahead of multiplayer — the app is useful without m
|
|||
**Goal:** Players can create and join rooms; the host sees all joined players in real time.
|
||||
**Done when:** Two browser tabs can join the same room and see each other's display names update live via WebSocket.
|
||||
|
||||
- [ ] Write Drizzle schema: `rooms`, `room_players`
|
||||
- [ ] Write and run migration
|
||||
- [ ] `POST /rooms` and `POST /rooms/:code/join` REST endpoints
|
||||
- [ ] `RoomService`: create room with short code, join room, enforce max player limit
|
||||
- [ ] WebSocket server: attach `ws` upgrade handler to Express HTTP server
|
||||
- [ ] WS auth middleware: validate JWT on upgrade
|
||||
- [ ] WS message router: dispatch by `type`
|
||||
- [ ] `room:join` / `room:leave` handlers → broadcast `room:state`
|
||||
- [ ] Room membership tracked in Valkey (ephemeral) + PostgreSQL (durable)
|
||||
- [ ] Define all WS event Zod schemas in `packages/shared`
|
||||
- [ ] Frontend: `/multiplayer/lobby` — create room + join-by-code
|
||||
- [ ] Frontend: `/multiplayer/room/:code` — player list, room code, "Start Game" (host only)
|
||||
- [ ] Frontend: WS client singleton with reconnect
|
||||
- [x] Write Drizzle schema: `lobbies`, `lobby_players`
|
||||
- [x] Write and run migration
|
||||
- [x] `POST /api/v1/lobbies` and `POST /api/v1/lobbies/:code/join` REST endpoints
|
||||
- [x] `LobbyService`: create lobby with Crockford Base32 code, join lobby, enforce max player limit
|
||||
- [x] WebSocket server: attach `ws` upgrade handler to Express HTTP server
|
||||
- [x] WS auth middleware: validate Better Auth session on upgrade
|
||||
- [x] WS message router: dispatch by `type` via Zod discriminated union
|
||||
- [x] `lobby:join` / `lobby:leave` handlers → broadcast `lobby:state`
|
||||
- [x] Lobby membership tracked in PostgreSQL (durable), game state in-memory (Valkey deferred)
|
||||
- [x] Define all WS event Zod schemas in `packages/shared`
|
||||
- [x] Frontend: `/multiplayer` — create lobby + join-by-code
|
||||
- [x] Frontend: `/multiplayer/lobby/:code` — player list, lobby code, "Start Game" (host only)
|
||||
- [x] Frontend: WS client class with typed message handlers
|
||||
|
||||
---
|
||||
|
||||
## Phase 5 — Multiplayer Game
|
||||
|
||||
**Goal:** Host starts a game; all players answer simultaneously in real time; a winner is declared.
|
||||
**Done when:** 2–4 players complete a 10-round game with correct live scores and a winner screen.
|
||||
**Done when:** 2–4 players complete a 3-round game with correct live scores and a winner screen.
|
||||
|
||||
- [ ] `GameService`: generate question sequence, enforce 15s server timer
|
||||
- [ ] `room:start` WS handler → broadcast first `game:question`
|
||||
- [ ] `game:answer` WS handler → collect per-player answers
|
||||
- [ ] On all-answered or timeout → evaluate, broadcast `game:answer_result`
|
||||
- [ ] After N rounds → broadcast `game:finished`, update DB (transactional)
|
||||
- [ ] Frontend: `/multiplayer/game/:code` route
|
||||
- [ ] Frontend: reuse `QuestionCard` + `OptionButton`; add countdown timer
|
||||
- [ ] Frontend: `ScoreBoard` component — live per-player scores
|
||||
- [ ] Frontend: `GameFinished` screen — winner highlight, final scores, play again
|
||||
- [ ] Unit tests for `GameService` (round evaluation, tie-breaking, timeout)
|
||||
- [x] `MultiplayerGameService`: generate question sequence, enforce 15s server timer
|
||||
- [x] `lobby:start` WS handler → broadcast first `game:question`
|
||||
- [x] `game:answer` WS handler → collect per-player answers
|
||||
- [x] On all-answered or timeout → evaluate, broadcast `game:answer_result`
|
||||
- [x] After N rounds → broadcast `game:finished`, update DB (transactional)
|
||||
- [x] Frontend: `/multiplayer/game/:code` route
|
||||
- [x] Frontend: reuse `QuestionCard` + `OptionButton`; round results per player
|
||||
- [x] Frontend: `MultiplayerScoreScreen` — winner highlight, final scores, play again
|
||||
- [x] Unit tests for `LobbyService`, WS auth, WS router
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -236,7 +235,7 @@ Phase 0 (Foundation) ✅
|
|||
└── Phase 2 (Singleplayer UI) ✅
|
||||
├── Phase 3 (Auth) ✅
|
||||
│ └── Phase 6 (Deployment + CI/CD) ✅
|
||||
└── Phase 4 (Multiplayer Lobby)
|
||||
└── Phase 5 (Multiplayer Game)
|
||||
└── Phase 4 (Multiplayer Lobby) ✅
|
||||
└── Phase 5 (Multiplayer Game) ✅
|
||||
└── Phase 7 (Hardening)
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue