badminton-match is the operational app for running badminton sessions end to
end: planning players and courts, generating doubles schedules, publishing live
session state, tracking scores, managing tournaments, and exporting social
graphics.
It is intentionally separate from MDEF. This repo owns operations. MDEF
owns analytics and long-term rating/history concerns.
- configure title, date, courts, court hours, and slot duration
- define player count and player pool
- apply fixed-match constraints
- generate balanced doubles schedules
- retry generation for better schedule quality
- publish a live session and open it from a shared link
- mark games played
- enter and revise scores
- swap players between games
- swap full game slots
- mark players absent
- rename players inside the published session
- browse historical sessions
- browse known players
- inspect player stats: wins, losses, points for/against, top partners, top opponents
- assign 16 pairs into 4 groups
- compute standings
- propagate knockout bracket automatically
- score tournament matches
- generate tournament visuals
- generate Instagram-style session graphics
- generate standings and bracket visuals
| Layer | Tools |
|---|---|
| App | React 19, TypeScript, Vite |
| State | Zustand, TanStack React Query |
| Routing | React Router |
| UI | Tailwind CSS v4 |
| PWA | vite-plugin-pwa |
| Backend | Supabase Postgres + PostgREST RPC |
This branch is the Supabase migration branch.
Current runtime direction:
- app runtime source of truth: schema
bm - frontend RPC target:
bm.*via Supabase PostgREST profile headers - historical bridge: Google Sheets ->
badminton_match->bm - current local/runtime target:
bmonly
Important clarification:
badminton_matchis historical migration context, not the intended runtime ownership model for this apppublic.bm_*wrappers may still exist for compatibility, but this app should not rely on them
npm ciCopy .env.local.example to .env.local and fill in:
VITE_SUPABASE_URL=...
VITE_SUPABASE_KEY=...Apply the Supabase migration stack under:
For the current runtime shape, the important end state is:
- schema
bmexists and is current - schema
bmis exposed in Supabase API settings - removed legacy schemas such as
badminton_matchare also removed from exposed schemas
If you are reconstructing the full local migration history, use the runbook:
npm run devnpm run checksource .env.local
npm run check:smokeSmoke coverage includes:
- session list
- player list
- session fetch
- tournament fetch
- session republish/version increment
- session absent mutation
- session swap mutation
- session played/score mutation
- player stats fetch
- tournament republish/version increment
- tournament score mutation
Current branch status:
npm run checkpassesnpm run check:smokepasses against the active Supabase project
docs/handbook/current-status.mddocs/handbook/product-overview.mddocs/handbook/architecture.mddocs/handbook/data-model.mddocs/handbook/features-and-routes.mddocs/handbook/supabase-migration.mddocs/handbook/bm-supabase-runbook.mddocs/handbook/mdef-integration.mddocs/handbook/roadmap.md
Use docs/superpowers/ for implementation history and rationale, not as the
current source of truth.
badminton-match should remain the operational source app:
- session planning
- live session control
- tournament administration
MDEF should remain the analytics destination:
- canonical players and aliases
- exported match history
- rating and longitudinal analysis
What is already working on the Supabase branch:
- create and publish sessions
- open shared session links
- mark played and enter scores
- load session history
- load player history and stats
- load and update tournament state
What is still not “fully final”:
- richer automated end-to-end regression coverage
- tournament normalization beyond snapshot-first persistence
- longer-term export contract into
MDEF