How sbalsara05/formula-function works
f(x) is a motorsport analytics product for F1, F2 and F3, combining a Next.js browsing experience with a FastAPI backend. The intended user journey spans driver profiles and career/telemetry analysis, team and venue exploration, and lap comparison; the backend also exposes standings and analytics endpoints. The sampled backend shows live standings backed by Jolpica and team data backed by Supabase, while several driver, lap and venue endpoints are placeholders. Frontend route-to-component and frontend-to-API wiring was not established by the excerpts, so those links are omitted.
Main entry points: main.py FastAPI application · DriverPage.tsx Driver profile · teams.py Team endpoints · jolpica.py Jolpica client
Components 30
Web experience
- Series hub
frontend/src/app/f/[series]/page.tsx - Driver route
frontend/src/app/f/[series]/driver/[slug]/page.tsx - Team route
frontend/src/app/f/[series]/team/[slug]/page.tsx - Venue route
frontend/src/app/f/[series]/venue/[slug]/page.tsx - Era route
frontend/src/app/f/[series]/era/[slug]/page.tsx - Lap routes
frontend/src/app/f/[series]/driver/[slug]/laps/page.tsx - Lap detail route
frontend/src/app/f/[series]/driver/[slug]/laps/[lapId]/page.tsx - Lap comparison route
frontend/src/app/f/[series]/compare/laps/[lapA]/[lapB]/page.tsx
API and domain
- FastAPI application
backend/app/main.py - Driver endpoints
backend/app/routers/drivers.py - Team endpoints
backend/app/routers/teams.py - Venue endpoints
backend/app/routers/venues.py - Lap endpoints
backend/app/routers/laps.py - Domain schemas
backend/app/models/schemas.py
Persistence and feeds
- Supabase access
backend/app/database.py - Supabase store
- Jolpica client
backend/app/services/jolpica.py - Jolpica API
Analytics views
- Driver profile
frontend/src/components/driver/DriverPage.tsx - Career reel
frontend/src/components/driver/CyclingReel.tsx - Era imagery
frontend/src/components/driver/EraImage.tsx - Driving signature
frontend/src/components/driver/RadarChart.tsx - Career trajectory
frontend/src/components/driver/TrajectoryModule.tsx - Lap analysis
frontend/src/components/driver/LapAnalysisPage.tsx - Lap comparison
frontend/src/components/driver/ComparePageClient.tsx - Team profile
frontend/src/components/team/TeamPage.tsx - Venue profile
frontend/src/components/venue/VenuePage.tsx - Circuit map
frontend/src/components/venue/TrackMap.tsx - Era feature
frontend/src/components/era/F1EraPage.tsx
Other components
- Motorsport fan
Connections 20
- Motorsport fan → Series hub: browses
- Driver profile → Career reel: renders
frontend/src/components/driver/DriverPage.tsx - Driver profile → Era imagery: renders
frontend/src/components/driver/DriverPage.tsx - Driver profile → Driving signature: renders
frontend/src/components/driver/DriverPage.tsx - Driver profile → Career trajectory: renders
frontend/src/components/driver/DriverPage.tsx - Venue profile → Circuit map: renders
frontend/src/components/venue/VenuePage.tsx - FastAPI application → Driver endpoints: registers
backend/app/main.py - FastAPI application → Team endpoints: registers
backend/app/main.py - FastAPI application → Venue endpoints: registers
backend/app/main.py - FastAPI application → Lap endpoints: registers
backend/app/main.py - FastAPI application → Jolpica client: fetches standings
backend/app/main.py - Driver endpoints → Domain schemas: validates responses
backend/app/routers/drivers.py - Driver endpoints → Jolpica client: requests standings
backend/app/routers/drivers.py - Team endpoints → Domain schemas: validates responses
backend/app/routers/teams.py - Team endpoints → Jolpica client: requests standings
backend/app/routers/teams.py - Team endpoints → Supabase access: queries
backend/app/routers/teams.py - Venue endpoints → Domain schemas: validates responses
backend/app/routers/venues.py - Lap endpoints → Domain schemas: validates responses
backend/app/routers/laps.py - Supabase access → Supabase store: creates client
backend/app/database.py - Jolpica client → Jolpica API: requests data
backend/app/services/jolpica.py