# RTSport Build — Integration Spec ## Build Date 2026-05-01 ## Source of Truth - **Contract:** `docs/contract.md` (v0.2) - **Repo:** https://github.com/NightKnight64/rtsport - **Commits:** - `0891503` — Add API & data contract v0.2 - `f666d09` — Add product brief and roadmap - `f8065ab` — Initial commit: frontend mock v0.1 ## Architecture ``` Backend (Socrates) Frontend (Daedalus) │ │ ▼ ▼ FastAPI + PostgreSQL HTMX + Jinja2 │ │ └────────── contract ──────────┘ ``` ## Integration Points ### Data Flow 1. Frontend POSTs to `POST /api/v1/events/sideline-entry` 2. Backend validates against Pydantic schemas 3. Backend writes to PostgreSQL with `school_id` isolation 4. Backend returns updated athlete status 5. Frontend re-renders HTMX partial ### Contract Alignment - All Pydantic schemas in `contract.md` §1 are source of truth - Frontend mocks already aligned (per Matt) - No retcon needed ### FERPA Gate - API layer strips `clinical_notes` for non-AT roles - `visibility` defaults to `["at"]` on all writes - Role-based access matrix enforced via FastAPI dependency ## Shared Directory Layout ``` shared/build-20260501/ SPEC.md ← This file (integration contract) docs/ ← Cloned from repo contract.md product-brief.md roadmap.md frontend/ ← Cloned from repo index.html ... backend/ ← Socrates writes here app/ models/ api/ tests/ integration.md ← Both update as they work ``` ## Status | Component | Status | Owner | |-----------|--------|-------| | Contract review | Ready to start | Socrates | | Backend scaffold | Not started | Socrates | | Frontend alignment | Already aligned | Daedalus (on standby) | | Integration tests | Not started | Pending |