# jwh3times/apexracers architecture

> Architecture diagram of the GitHub repository jwh3times/apexracers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jwh3times/apexracers
- Repository: https://github.com/jwh3times/apexracers

## Overview

ApexRacers is an iRacing companion for comparing lap-time percentiles and choosing competitive cars in weekly series. Drivers enter through the React app, which routes catalog, series, race, driver, rival, and telemetry features; the API provides the corresponding product services and persists data. Separately, an ingestion worker acquires iRacing catalog and race data for the same database. The README documents these capabilities and the current access boundary; sampled source confirms selected routing, authentication, persistence, and race-detail reads, but not every feature’s internal calls.

Main entry points: [`web/src/App.tsx`](https://github.com/jwh3times/apexracers/blob/main/web/src/App.tsx) (App routing), [`src/ApexRacers.Data/AppDbContext.cs`](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Data/AppDbContext.cs) (EF data context), [`src/ApexRacers.Api/Program.cs`](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Program.cs) (ASP.NET API), [`src/ApexRacers.Ingestion/Worker.cs`](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Ingestion/Worker.cs) (Ingestion worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_series_ui["Series and schedule"]
  node_driver_ui["Driver insights"]
  node_racing_ui["Race views"]
  node_catalog_ui["Catalog explorer"]
  node_rivals_ui["Rivals and leaderboards"]
  node_telemetry_ui["Telemetry uploads"]
end

subgraph group_api["API and domain services"]
  node_api["ASP.NET API<br/>[Program.cs]"]
  node_race_detail["Race details"]
  node_product_services["Product services<br/>[Services]"]
end

subgraph group_data["Persistence and domain"]
  node_dbcontext["EF data context<br/>[AppDbContext.cs]"]
  node_race_data["Race domain data<br/>[Subsession.cs]"]
  node_catalog_data["Catalog and weeks<br/>[Season.cs]"]
  node_database[("PostgreSQL")]
end

subgraph group_ingestion["Data acquisition"]
  node_worker["Ingestion worker<br/>[Worker.cs]"]
  node_ingest_program["Worker startup<br/>[Program.cs]"]
end

subgraph group_identity["Identity lifecycle"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_auth_store["Authorization store"]
end

node_driver(("Driver"))
node_iracing(("iRacing"))

node_driver -->|"uses"| node_app
node_app -->|"routes to"| node_series_ui
node_app -->|"routes to"| node_driver_ui
node_app -->|"routes to"| node_racing_ui
node_app -->|"routes to"| node_catalog_ui
node_app -->|"routes to"| node_rivals_ui
node_app -->|"routes to"| node_telemetry_ui
node_app -.->|"requests"| node_api
node_api -->|"registers"| node_auth
node_api -->|"registers"| node_product_services
node_api -->|"registers"| node_race_detail
node_api -->|"configures"| node_dbcontext
node_race_detail -->|"queries"| node_dbcontext
node_dbcontext -.->|"persists"| node_database
node_dbcontext -->|"maps"| node_race_data
node_dbcontext -.->|"maps"| node_catalog_data
node_auth -->|"uses"| node_auth_store
node_auth_store -->|"queries"| node_dbcontext
node_ingest_program -->|"starts"| node_worker
node_worker -.->|"acquires data"| node_iracing
node_worker -.->|"writes"| node_dbcontext

click node_app "https://github.com/jwh3times/apexracers/blob/main/web/src/App.tsx"
click node_series_ui "https://github.com/jwh3times/apexracers/tree/main/web/src/features/series"
click node_driver_ui "https://github.com/jwh3times/apexracers/tree/main/web/src/features/driver"
click node_racing_ui "https://github.com/jwh3times/apexracers/tree/main/web/src/features/racing"
click node_catalog_ui "https://github.com/jwh3times/apexracers/tree/main/web/src/features/catalog"
click node_rivals_ui "https://github.com/jwh3times/apexracers/tree/main/web/src/features/rivals"
click node_telemetry_ui "https://github.com/jwh3times/apexracers/tree/main/web/src/features/telemetry"
click node_api "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Program.cs"
click node_auth "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Services/AuthService.cs"
click node_race_detail "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Services/SubsessionDetailService.cs"
click node_product_services "https://github.com/jwh3times/apexracers/tree/main/src/ApexRacers.Api/Services"
click node_auth_store "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Data/DriverAuthorityStore.cs"
click node_dbcontext "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Data/AppDbContext.cs"
click node_race_data "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Core/Models/Subsession.cs"
click node_catalog_data "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Core/Models/Season.cs"
click node_worker "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Ingestion/Worker.cs"
click node_ingest_program "https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Ingestion/Program.cs"

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_app,node_series_ui,node_driver_ui,node_racing_ui,node_catalog_ui,node_rivals_ui,node_telemetry_ui toneBlue
class node_api,node_race_detail,node_product_services toneAmber
class node_dbcontext,node_race_data,node_catalog_data,node_database toneMint
class node_worker,node_ingest_program toneRose
class node_auth,node_auth_store,node_driver,node_iracing toneIndigo
```

## Components

### Web experience

- [App routing](https://github.com/jwh3times/apexracers/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Series and schedule](https://github.com/jwh3times/apexracers/tree/main/web/src/features/series): `web/src/features/series`
- [Driver insights](https://github.com/jwh3times/apexracers/tree/main/web/src/features/driver): `web/src/features/driver`
- [Race views](https://github.com/jwh3times/apexracers/tree/main/web/src/features/racing): `web/src/features/racing`
- [Catalog explorer](https://github.com/jwh3times/apexracers/tree/main/web/src/features/catalog): `web/src/features/catalog`
- [Rivals and leaderboards](https://github.com/jwh3times/apexracers/tree/main/web/src/features/rivals): `web/src/features/rivals`
- [Telemetry uploads](https://github.com/jwh3times/apexracers/tree/main/web/src/features/telemetry): `web/src/features/telemetry`

### API and domain services

- [ASP.NET API](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Program.cs): `src/ApexRacers.Api/Program.cs`
- [Race details](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Services/SubsessionDetailService.cs): `src/ApexRacers.Api/Services/SubsessionDetailService.cs`
- [Product services](https://github.com/jwh3times/apexracers/tree/main/src/ApexRacers.Api/Services): `src/ApexRacers.Api/Services`

### Persistence and domain

- [EF data context](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Data/AppDbContext.cs): `src/ApexRacers.Data/AppDbContext.cs`
- [Race domain data](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Core/Models/Subsession.cs): `src/ApexRacers.Core/Models/Subsession.cs`
- [Catalog and weeks](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Core/Models/Season.cs): `src/ApexRacers.Core/Models/Season.cs`
- **PostgreSQL**

### Data acquisition

- [Ingestion worker](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Ingestion/Worker.cs): `src/ApexRacers.Ingestion/Worker.cs`
- [Worker startup](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Ingestion/Program.cs): `src/ApexRacers.Ingestion/Program.cs`

### Identity lifecycle

- [Authentication](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Api/Services/AuthService.cs): `src/ApexRacers.Api/Services/AuthService.cs`
- [Authorization store](https://github.com/jwh3times/apexracers/blob/main/src/ApexRacers.Data/DriverAuthorityStore.cs): `src/ApexRacers.Data/DriverAuthorityStore.cs`

### Other components

- **Driver**
- **iRacing**

## Connections

- Driver → App routing: uses (evidence: `web/src/App.tsx`)
- App routing → Series and schedule: routes to (evidence: `web/src/App.tsx`)
- App routing → Driver insights: routes to (evidence: `web/src/App.tsx`)
- App routing → Race views: routes to (evidence: `web/src/App.tsx`)
- App routing → Catalog explorer: routes to (evidence: `web/src/App.tsx`)
- App routing → Rivals and leaderboards: routes to (evidence: `web/src/App.tsx`)
- App routing → Telemetry uploads: routes to (evidence: `web/src/App.tsx`)
- App routing → ASP.NET API: requests (evidence: `README.md`)
- ASP.NET API → Authentication: registers (evidence: `src/ApexRacers.Api/Program.cs`)
- ASP.NET API → Product services: registers (evidence: `src/ApexRacers.Api/Program.cs`)
- ASP.NET API → Race details: registers (evidence: `src/ApexRacers.Api/Program.cs`)
- ASP.NET API → EF data context: configures (evidence: `src/ApexRacers.Api/Program.cs`)
- Race details → EF data context: queries (evidence: `src/ApexRacers.Api/Services/SubsessionDetailService.cs`)
- EF data context → PostgreSQL: persists
- EF data context → Race domain data: maps (evidence: `src/ApexRacers.Data/AppDbContext.cs`)
- EF data context → Catalog and weeks: maps (evidence: `src/ApexRacers.Data/AppDbContext.cs`)
- Authentication → Authorization store: uses (evidence: `src/ApexRacers.Api/Services/AuthService.cs`)
- Authorization store → EF data context: queries (evidence: `src/ApexRacers.Data/DriverAuthorityStore.cs`)
- Worker startup → Ingestion worker: starts (evidence: `src/ApexRacers.Ingestion/Program.cs`)
- Ingestion worker → iRacing: acquires data (evidence: `README.md`)
- Ingestion worker → EF data context: writes (evidence: `README.md`)
