1// SportsMates.md
2// ---------------------------
3
4# SportsMates
5
6Live sports scoring and permanent athlete records for schools — score matches live, let parents follow via public links, keep per-student records across seasons.
7
8**TYPE:** Web Application
9**STATUS:** Live
10**LIVE:** https://sportsmates-three.vercel.app
11**DEV:** http://localhost:3100
12**WORKSPACE:** ~/GitHub/sportsmates
13**GITHUB:** nikanjuri/sportsmates (private)
14
15---
16
17## FEATURES
18
19- Live match scoring with an append-only ball-event model across cricket, football, basketball, and athletics
20- Offline-first scoring console with single-writer lease, takeover, and undo
21- Public spectator links so parents can follow from anywhere
22- Permanent per-student athlete records across seasons and sports
23- Multi-tenant schools with roles and row-level security
24- Durable student identity with guardians and student logins
25- House system with category-board standings and a parental-consent ledger (DPDP/AADC)
26- Safe social layer — fixed-emoji reactions, house feed, and staff-approved captain feed
27- Optional AI match recap; Vitest unit tests and Playwright e2e
28
29---
30
31## TECHNOLOGIES
32
33- Next.js 16 (App Router)
34- React 18
35- TypeScript
36- Supabase (Postgres, Auth, RLS, Realtime)
37- Vitest
38- Playwright
39- Vercel
40
41---
42
43## NOTES
44
45SportsMates gives schools and colleges live sports scoring plus a permanent athlete record. The MVP core loop is live across four day-one sports — cricket, football, basketball, and athletics: score a match live, parents watch via a public link, and results persist into a per-student record that survives across seasons.
46
47### Scoring engine
48
49The scorer domain models competitions, teams, players, and matches on top of an append-only event table, so every ball/point is auditable and the engine can replay state. Scoring works through flaky venue connectivity — offline tolerance and sync are covered by dedicated Vitest suites.
50
51### Built multi-tenant from day one
52
53Schools are isolated tenants with role-based access enforced by Postgres row-level security. Student identity is durable: guardians link to students, students get their own logins, and the athletic record follows them season over season.
54
55### Spectator experience
56
57Every match gets a public link with realtime updates — no app install, no account. Parents follow from anywhere while the scorer works courtside.