From 231d34d7c4d88f7b2c43310bab8b596529c6b988 Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 19 Mar 2026 08:06:02 +0800 Subject: [PATCH] docs: update PROGRESS.md with v2 complete build info --- PROGRESS.md | 168 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 128 insertions(+), 40 deletions(-) diff --git a/PROGRESS.md b/PROGRESS.md index efb99a7..7e80c9e 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -1,53 +1,141 @@ -# ServeSync Demo β€” Build Complete βœ… +# ServeSync Demo β€” Court Manager Dashboard v2 πŸ“ -**Completed by Forge on 2026-03-19** +**Rebuilt by Nemo on 2026-03-19** ## Live URLs -- **App:** http://servesync-demo.juankibin.space (domain) -- **Direct:** http://192.168.1.167:8092 -- **API Docs:** http://192.168.1.167:8092/api/docs (if enabled) +- **App:** http://192.168.1.167:8092 +- **API Docs:** http://192.168.1.167:8092/api/docs - **Gitea:** http://192.168.1.159:3000/kibin/servesync-demo -## What's Built +## What Changed (v2 Rebuild) +Complete rewrite from player-facing app to **single Court Manager dashboard**. -### Backend (FastAPI + PostgreSQL + Redis) -- `/api/players/` β€” Player profiles, ELO ratings, membership tiers -- `/api/courts/` β€” Court management, booking, availability -- `/api/matches/` β€” Full matchmaking system (open + skill-based) -- `/api/tournaments/` β€” Double elimination tournament engine -- `/api/screen/` β€” TV display API with real-time data -- `/api/admin/seed` β€” POST to re-seed demo data -- WebSocket endpoints: `/ws/court/{id}`, `/ws/overview`, `/ws/matches` +## Architecture +- Backend: FastAPI + PostgreSQL + Redis + WebSocket +- Frontend: Vue 3 + Vite + Tailwind CSS + Pinia +- Nginx: reverse proxy (baked Dockerfile, no bind mounts) +- Deploy: Gitea push β†’ Coolify CI/CD auto-deploy -### Frontend (Vue 3 + Tailwind) -- `/` Dashboard β€” Live court grid, leaderboard, tournament summary, quick actions -- `/courts` β€” Court booking with time slot selection -- `/matchmaking` β€” Stage 1 Open + Stage 2 Skill-Based lobby -- `/tournament` β€” Full double elimination bracket viewer with score entry -- `/players` β€” Player directory with tier/ELO display -- `/screen/:courtId` β€” TV display mode (court 1-4 or overview) +## Features Built -### Seed Data -- 12 demo players (Bronzeβ†’Elite, 850-1850 ELO) -- 4 courts (2x Sport Court, 2x Cushioned Tournament Grade) -- 3 active matches (Open, Skill-Based, Tournament) -- 2 lobby matches -- 1 in-progress tournament with full bracket +### Feature 1: Player Management `/players` +- Add new player (name, contact, skill level: Beginner/Intermediate/Advanced/Elite) +- Edit player profile + skill +- View player list with stats (matches played, W/L, current ELO) +- Delete player +- Table sorted by ELO descending -## Matchmaking Implementation -- **Stage 1 Open:** Free join, no restrictions -- **Stage 2 Skill-Based:** ELO Β±200 constraint enforced -- **Stage 3 Tournament:** Double elimination, winners/losers brackets, Grand Final -- Auto-assigns available court when match starts -- ELO updates calculated via standard K=32 formula +### Feature 2: Court Reservation `/courts` +- View all 4 courts with status (Available/In Use/Reserved/Maintenance) +- Manual status override (4 quick buttons per court) +- Reserve a court: group name, start/end time, notes +- Delete reservation +- 2-column grid layout -## Re-seeding -If data gets stale or needs refresh: +### Feature 3: Match Event Builder `/events/new` (3-step wizard) +**Step 1 β€” Event Setup:** +- Event name +- Format toggle: Singles / Doubles +- Courts count input +- Player selection from roster (multi-select) +- Real-time stage calculation preview: + - Teams count, suggested stages, elimination rounds + - Auto-updates stage config suggestions + +**Step 2 β€” Stage Configurator:** +- Auto-generated stage cards based on calculation +- Editable: name, match type, rounds, advance count +- Add/remove stages +- Match types: Open Match, Skill-Based, Round Robin, Tournament + +**Step 3 β€” Done!** +- Creates event β†’ adds players β†’ creates stages β†’ generates brackets +- Redirects to event control panel + +### Feature 4: Live Court View `/` (Main Dashboard) +- 2Γ—2 court grid with real-time status +- Each court: name, type, status badge, current match, score, elapsed time +- Inline score entry from dashboard +- Start queued matches from "Upcoming" panel +- Active event banner with quick link +- 5-second auto-refresh + +### Event Control Panel `/events/:id` +- Stage tabs (pending/active/completed) +- Matches listed by round with status +- Enter score β†’ auto-advances bracket (places winner in next match) +- Start match β†’ auto-assigns available court +- Manual court reassign +- Player list sidebar +- Bracket summary for tournament stages +- Start/Complete event controls + +### Screen View `/screen/:courtId` +- Full-screen TV display (no nav bar) +- Giant player names and score +- Elapsed timer +- Court status display +- 3-second refresh +- Bottom nav for court switching + +## Backend API +``` +GET /api/players/ List all players (sorted by ELO) +POST /api/players/ Add player +GET /api/players/:id Get player +PUT /api/players/:id Update player +DELETE /api/players/:id Delete player + +GET /api/courts/ List all courts + reservations +POST /api/courts/ Create court +PATCH /api/courts/:id/status Update court status +GET /api/courts/:id/reservations +POST /api/courts/:id/reservations Create reservation +DELETE /api/courts/reservations/:id + +GET /api/events/ List all events +POST /api/events/ Create event +GET /api/events/calculate Stage calculation (GET with params) +GET /api/events/:id Get full event detail (stages, matches, players) +PUT /api/events/:id Update event +POST /api/events/:id/players Add player to event +DELETE /api/events/:id/players/:pid Remove player +POST /api/events/:id/stages Add stage +PUT /api/events/:id/stages/:sid Update stage +POST /api/events/:id/stages/:sid/generate Generate matches +POST /api/events/:id/start Start event (activates first stage) +POST /api/events/:id/complete Mark event complete + +GET /api/matches/:id Get match detail +POST /api/matches/:id/start Start match (auto-assigns court) +POST /api/matches/:id/score Enter score (auto-advances bracket, updates ELO) +PATCH /api/matches/:id/court Assign/reassign court + +GET /api/dashboard/ Live court view data +GET /api/dashboard/screen/:id TV display data + +POST /api/admin/seed Re-seed demo data + +WS /ws/dashboard Dashboard WebSocket +WS /ws/screen/:id Screen WebSocket +``` + +## Seed Data +- **8 Players:** Marco (Elite 1852), Ana (Advanced 1645), Carlos (Advanced 1583), + Diana (Intermediate 1402), Lisa (Intermediate 1318), Tony (Intermediate 1281), + Maria (Beginner 947), Jake (Beginner 883) +- **4 Courts:** A, B (Sport Court Premium), C, D (Cushioned Tournament Grade) +- **Court C & D:** In-use (live semifinal matches) +- **Reservations:** Court A reserved today 2pm, Court B maintenance tomorrow +- **Event 1:** "Spring Singles Open" β€” Completed, full bracket history +- **Event 2:** "Summer Tournament" β€” Active, Round 2 semifinals in progress + +## Coolify +- App UUID: `ycw8wg8gk08gwcwc8wwwwww8` +- CI/CD: Gitea push β†’ auto-deploy +- DB volume: `pgdata` (persistent) + +## Re-seed ```bash curl -X POST http://192.168.1.167:8092/api/admin/seed ``` - -## Infrastructure -- Coolify App UUID: ycw8wg8gk08gwcwc8wwwwww8 -- Gitea webhook CI/CD: Active (pushes trigger auto-deploy) -- DB volume: `pgdata` (persistent across deployments)