# harshulchess77-arch/jc-apex architecture

> Architecture diagram of the GitHub repository harshulchess77-arch/jc-apex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshulchess77-arch/jc-apex
- Repository: https://github.com/harshulchess77-arch/jc-apex

## Overview

JC-APEX is a live electric-racing telemetry and race-operations platform. Its main workflow is receiver telemetry captured in a browser over Web Serial, stored and broadcast through Supabase, then presented to pit and driver devices; crews can also export session CSV. The repository documents an optional Python serial bridge, weather polling, strategy advice, maps, race operations, and driver/vehicle management. Some page and gateway implementations were not sampled, so their relationships are shown only where the README or excerpts establish them.

Main entry points: [`web/src/App.jsx`](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/App.jsx) (Route and provider shell), [`gateway/run_bridge.py`](https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/run_bridge.py) (Python bridge), [`web/src/hooks/telemetry/telemetry-serial.js`](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/telemetry/telemetry-serial.js) (Browser serial ingest), [`web/src/hooks/telemetry/telemetry-ingest.js`](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/telemetry/telemetry-ingest.js) (Telemetry ingest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Telemetry capture"]
  node_serial["Browser serial ingest"]
  node_ingest["Telemetry ingest"]
  node_demo["Demo simulator<br/>[Demo.jsx]"]
end

subgraph group_live["Live race operations"]
  node_dashboard["Telemetry dashboard"]
  node_pit["Pit operations<br/>[PitCenter.jsx]"]
  node_driver["Driver HUD<br/>[DriverHUD.jsx]"]
  node_director["Race director<br/>[RaceDirector.jsx]"]
  node_circuit["Circuit mapping<br/>[CircuitMap.jsx]"]
  node_profiles["Driver profiles<br/>[DriverProfile.jsx]"]
  node_standings["Championship standings"]
  node_benchmarks["Race benchmarks<br/>[Benchmarks.jsx]"]
  node_vehicle["Vehicle configuration<br/>[VehicleConfig.jsx]"]
  node_comms["Live communications<br/>[LiveComms.jsx]"]
end

subgraph group_intelligence["Race intelligence"]
  node_strategy["Strategy library"]
  node_oracle["AI driving oracle"]
  node_weather["Weather engine<br/>[weather_engine.py]"]
end

subgraph group_platform["Shared platform"]
  node_telemetry[("Telemetry history")]
  node_realtime["Supabase Realtime"]
  node_settings["App settings<br/>[AppSettings.jsx]"]
  node_app["Route and provider shell<br/>[App.jsx]"]
  node_supabase["Supabase client<br/>[supabaseClient.js]"]
  node_driver_service["Driver profile service<br/>[driverService.js]"]
end

subgraph group_bridge["Optional gateway"]
  node_bridge["Python bridge<br/>[run_bridge.py]"]
  node_ai_engine["Gateway AI oracle<br/>[ai_oracle.py]"]
  node_station["Weather station adapter<br/>[station_adapter.py]"]
end

node_crew(("Pit crew devices"))
node_receiver{{"LoRa receiver"}}

node_receiver -->|"sends serial data"| node_serial
node_serial -->|"parses packets"| node_ingest
node_ingest -->|"inserts packets"| node_telemetry
node_telemetry -->|"broadcasts inserts"| node_realtime
node_realtime -->|"streams updates"| node_crew
node_crew -->|"views live data"| node_dashboard
node_crew -->|"opens operations"| node_pit
node_crew -->|"opens HUD"| node_driver
node_app -->|"routes to"| node_pit
node_app -->|"routes to"| node_driver
node_app -->|"routes to"| node_director
node_app -->|"routes to"| node_circuit
node_app -->|"routes to"| node_dashboard
node_crew -->|"views track map"| node_circuit
node_crew -->|"views strategy"| node_strategy
node_crew -.->|"manages drivers"| node_profiles
node_crew -.->|"views standings"| node_standings
node_crew -.->|"views benchmarks"| node_benchmarks
node_crew -.->|"configures app"| node_settings
node_crew -.->|"configures vehicle"| node_vehicle
node_crew -.->|"uses communications"| node_comms
node_crew -->|"starts simulation"| node_demo
node_supabase -->|"serves profile queries"| node_driver_service
node_bridge -->|"uploads telemetry"| node_telemetry
node_bridge -->|"integrates oracle"| node_ai_engine
node_bridge -->|"uses weather engine"| node_weather
node_weather -->|"adapts station data"| node_station

click node_serial "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/telemetry/telemetry-serial.js"
click node_ingest "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/telemetry/telemetry-ingest.js"
click node_dashboard "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/TelemetryDashbaord.jsx"
click node_pit "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/PitCenter.jsx"
click node_driver "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/DriverHUD.jsx"
click node_director "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/RaceDirector.jsx"
click node_circuit "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/CircuitMap.jsx"
click node_strategy "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/StrategyLibrary.jsx"
click node_oracle "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/useAIDrivingOracle.js"
click node_weather "https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/weather_engine.py"
click node_profiles "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/DriverProfile.jsx"
click node_standings "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/ChampionshipStandings.jsx"
click node_benchmarks "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/Benchmarks.jsx"
click node_settings "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/AppSettings.jsx"
click node_vehicle "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/VehicleConfig.jsx"
click node_comms "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/LiveComms.jsx"
click node_demo "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/Demo.jsx"
click node_bridge "https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/run_bridge.py"
click node_ai_engine "https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/ai_oracle.py"
click node_station "https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/station_adapter.py"
click node_app "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/App.jsx"
click node_supabase "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/lib/supabaseClient.js"
click node_driver_service "https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/lib/driverService.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_serial,node_ingest,node_demo toneBlue
class node_dashboard,node_pit,node_driver,node_director,node_circuit,node_profiles,node_standings,node_benchmarks,node_vehicle,node_comms toneAmber
class node_strategy,node_oracle,node_weather toneMint
class node_telemetry,node_realtime,node_settings,node_app,node_supabase,node_driver_service toneRose
class node_bridge,node_ai_engine,node_station,node_crew,node_receiver toneIndigo
```

## Components

### Telemetry capture

- [Browser serial ingest](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/telemetry/telemetry-serial.js): `web/src/hooks/telemetry/telemetry-serial.js`
- [Telemetry ingest](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/telemetry/telemetry-ingest.js): `web/src/hooks/telemetry/telemetry-ingest.js`
- [Demo simulator](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/Demo.jsx): `web/src/pages/Demo.jsx`

### Live race operations

- [Telemetry dashboard](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/TelemetryDashbaord.jsx): `web/src/pages/TelemetryDashbaord.jsx`
- [Pit operations](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/PitCenter.jsx): `web/src/pages/PitCenter.jsx`
- [Driver HUD](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/DriverHUD.jsx): `web/src/pages/DriverHUD.jsx`
- [Race director](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/RaceDirector.jsx): `web/src/pages/RaceDirector.jsx`
- [Circuit mapping](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/CircuitMap.jsx): `web/src/pages/CircuitMap.jsx`
- [Driver profiles](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/DriverProfile.jsx): `web/src/pages/DriverProfile.jsx`
- [Championship standings](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/ChampionshipStandings.jsx): `web/src/pages/ChampionshipStandings.jsx`
- [Race benchmarks](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/Benchmarks.jsx): `web/src/pages/Benchmarks.jsx`
- [Vehicle configuration](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/VehicleConfig.jsx): `web/src/pages/VehicleConfig.jsx`
- [Live communications](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/LiveComms.jsx): `web/src/pages/LiveComms.jsx`

### Race intelligence

- [Strategy library](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/StrategyLibrary.jsx): `web/src/pages/StrategyLibrary.jsx`
- [AI driving oracle](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/hooks/useAIDrivingOracle.js): `web/src/hooks/useAIDrivingOracle.js`
- [Weather engine](https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/weather_engine.py): `gateway/weather_engine.py`

### Shared platform

- **Telemetry history**
- **Supabase Realtime**
- [App settings](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/pages/AppSettings.jsx): `web/src/pages/AppSettings.jsx`
- [Route and provider shell](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Supabase client](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/lib/supabaseClient.js): `web/src/lib/supabaseClient.js`
- [Driver profile service](https://github.com/harshulchess77-arch/jc-apex/blob/main/web/src/lib/driverService.js): `web/src/lib/driverService.js`

### Optional gateway

- [Python bridge](https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/run_bridge.py): `gateway/run_bridge.py`
- [Gateway AI oracle](https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/ai_oracle.py): `gateway/ai_oracle.py`
- [Weather station adapter](https://github.com/harshulchess77-arch/jc-apex/blob/main/gateway/station_adapter.py): `gateway/station_adapter.py`

### Other components

- **Pit crew devices**
- **LoRa receiver**

## Connections

- LoRa receiver → Browser serial ingest: sends serial data
- Browser serial ingest → Telemetry ingest: parses packets
- Telemetry ingest → Telemetry history: inserts packets
- Telemetry history → Supabase Realtime: broadcasts inserts
- Supabase Realtime → Pit crew devices: streams updates
- Pit crew devices → Telemetry dashboard: views live data
- Pit crew devices → Pit operations: opens operations
- Pit crew devices → Driver HUD: opens HUD
- Route and provider shell → Pit operations: routes to (evidence: `web/src/App.jsx`)
- Route and provider shell → Driver HUD: routes to (evidence: `web/src/App.jsx`)
- Route and provider shell → Race director: routes to (evidence: `web/src/App.jsx`)
- Route and provider shell → Circuit mapping: routes to (evidence: `web/src/App.jsx`)
- Route and provider shell → Telemetry dashboard: routes to (evidence: `web/src/App.jsx`)
- Pit crew devices → Circuit mapping: views track map
- Pit crew devices → Strategy library: views strategy
- Pit crew devices → Driver profiles: manages drivers
- Pit crew devices → Championship standings: views standings
- Pit crew devices → Race benchmarks: views benchmarks
- Pit crew devices → App settings: configures app
- Pit crew devices → Vehicle configuration: configures vehicle
- Pit crew devices → Live communications: uses communications
- Pit crew devices → Demo simulator: starts simulation
- Supabase client → Driver profile service: serves profile queries (evidence: `web/src/lib/driverService.js`)
- Python bridge → Telemetry history: uploads telemetry
- Python bridge → Gateway AI oracle: integrates oracle (evidence: `gateway/run_bridge.py`)
- Python bridge → Weather engine: uses weather engine (evidence: `gateway/run_bridge.py`)
- Weather engine → Weather station adapter: adapts station data (evidence: `gateway/weather_engine.py`)
