RTSport — Frontend Unification & Offline Architecture Plan
2026-05-09 | Daedalus subagent
Track 1: Wire Frontend to Real API (Implementation Plan)
The frontend dashboards (Coach, Parent, AT, AD) currently talk to in-memory mock APIs served by the HoffDesk proxy on port 8000. The real RTSport API runs on port 8001 with persistent SQLite data, JWT auth, role guards, and full CRUD.
Key findings:
- The proxy (rtsport_api_proxy.py) is correctly mounted but the running server still has old mock routes loaded (process needs restart)
- Coach/Parent mock routes (rtsport_coach_api.py, rtsport_parent_api.py) are commented out in the source main_v2.py but the running uvicorn process was started before those changes
- The real API response shapes differ from what the frontend JS expects — particularly the Coach dashboard
- The real DB has users (coach, AT, parent, admin) but parent user has no children linked (parent_ids is empty for all athletes)
- Messages exist only in the mock layer (no backend messages table/endpoints)
Work Required
See TRACK1-IMPLEMENTATION.md for the full plan with file paths, change descriptions, and ordering.
Summary:
1. Restart the HoffDesk proxy → mock routes gone, proxy routing to port 8001 works
2. Update frontend JS to match real API response shapes
3. Link parent user to children in DB
4. Add Messages table + endpoints to real API (persistence required)
5. Auth guard + remove auto-login from dashboards
Track 2: Offline-First Architecture
The 3-tap sideline entry MUST work without internet. Sidelines have terrible signal. See TRACK2-OFFLINE-ARCH.md for the full design.
Summary:
- ServiceWorker for static asset cache (Cache First)
- IndexedDB with 6 object stores mirroring server tables
- Last-write-wins sync with queue-based uploader
- Cached JWT auth with offline grace period (configurable, e.g. 4 hours)
- Estimated effort: 2-3 weeks for a minimal working implementation
Files in this directory
| File | What |
|---|---|
SPEC.md |
This file — summary of both tracks |
TRACK1-IMPLEMENTATION.md |
Implementation plan for Track 1 |
TRACK2-OFFLINE-ARCH.md |
Offline architecture design document |