How akshat12bhardwaj/f1-race-prediction works
APEX is an educational F1 race-prediction product. Users configure a historical driver/car lineup, circuit, weather and two model choices; the frontend sends the scenario to FastAPI, which predicts an order that the UI presents as standings and an illustrative 3D replay. The graph also preserves the documented data, feature, training and evaluation branches. Source-index references and README statements support the main connections; unsampled implementation details are not expanded into speculative call chains.
Main entry points: App.jsx Race dashboard · api.py FastAPI service · simulate.py Scenario simulator · multi_sim.py Model pair simulation
Components 26
Race experience
- Race dashboard
frontend/src/App.jsx - Lineup editor
frontend/src/components/LineupEditor.jsx - Lineup rules
frontend/src/lineup.js - Race conditions
frontend/src/components/Conditions.jsx - Circuit picker
frontend/src/components/CircuitPicker.jsx - API client
frontend/src/api.js - Standings panel
frontend/src/components/RaceBoard.jsx - 3D race replay
frontend/src/components/Track3D.jsx - Replay motion
frontend/src/motion.js
Prediction engine
- FastAPI service
src/api.py - Scenario simulator
src/simulate.py - Model pair simulation
src/multi_sim.py - Model algorithms
src/algorithms.py - Race ranking
src/ranking.py - Prediction logic
src/predict.py
Historical data
- Weather features
src/weather.py - Race features
src/features.py - Driver ratings
src/driver_ratings.py - Data collection
src/collect.py - Jolpica client
src/api_client.py - Raw data validation
src/validate_raw.py
Model research
- Algorithm training
src/train_algorithms.py - Policy definitions
src/policies.py - Policy analysis
src/policy_analysis.py
Other components
- Race creator
- Jolpica F1 data
Connections 27
- Race creator → Race dashboard: configures
- Race dashboard → Lineup editor: edits grid
frontend/src/App.jsx - Lineup editor → Lineup rules: checks assignments
frontend/src/components/LineupEditor.jsx - Race dashboard → Race conditions: sets weather
frontend/src/App.jsx - Race dashboard → Circuit picker: selects circuit
frontend/src/App.jsx - Race dashboard → API client: requests prediction
frontend/src/App.jsx - API client → FastAPI service: sends scenario
- FastAPI service → Scenario simulator: runs scenario
src/api.py - FastAPI service → Model pair simulation: compares models
src/api.py - FastAPI service → Prediction logic: requests prediction
src/api.py - Scenario simulator → Race features: builds inputs
src/simulate.py - Scenario simulator → Driver ratings: uses driver form
src/simulate.py - Scenario simulator → Race ranking: ranks race
src/simulate.py - Model pair simulation → Model algorithms: scores models
src/multi_sim.py - Model pair simulation → Race ranking: uses ranking model
src/multi_sim.py - Model pair simulation → Scenario simulator: uses race simulation
src/multi_sim.py - Race features → Weather features: uses weather data
src/features.py - FastAPI service → Standings panel: returns standings
- Race dashboard → 3D race replay: renders race
frontend/src/App.jsx - 3D race replay → Replay motion: computes replay
frontend/src/components/Track3D.jsx - Race dashboard → Standings panel: shows standings
frontend/src/App.jsx - Data collection → Jolpica client: fetches history
src/collect.py - Jolpica client → Jolpica F1 data: requests race data
src/api_client.py - Raw data validation → Weather features: validates weather
src/validate_raw.py - Algorithm training → Model algorithms: trains models
src/train_algorithms.py - Algorithm training → Race features: uses features
src/train_algorithms.py - Policy analysis → Policy definitions: analyzes policies
src/policy_analysis.py