# thebluesurf3r/apextelemetry architecture

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

- Interactive diagram: https://gitdiagram.com/thebluesurf3r/apextelemetry
- Repository: https://github.com/thebluesurf3r/apextelemetry

## Overview

ApexTelemetry collects Gran Turismo 7 UDP packets, decrypts and parses valid telemetry, then logs it to a database. The sampled Python code shows PostgreSQL storage, despite the README describing SQLite; database configuration and actual dbt model dependencies were not sampled. The transform tree documents staging and analysis models, so they appear as a separate analytics branch without guessed wiring.

Main entry points: [`src/main.py`](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/main.py) (Pipeline Runner), [`src/collector.py`](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/collector.py) (UDP Listener), [`src/storage.py`](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/storage.py) (Telemetry Storage), [`src/decoder.py`](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/decoder.py) (Decrypt and Parse)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Packet Capture"]
  node_listener["UDP Listener<br/>[collector.py]"]
end

subgraph group_pipeline["Telemetry Pipeline"]
  node_runner["Pipeline Runner<br/>[main.py]"]
  node_decoder["Decrypt and Parse<br/>[decoder.py]"]
end

subgraph group_storage["Persistence"]
  node_storage_code["Telemetry Storage<br/>[storage.py]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_analytics["Analytics Models"]
  node_staging["Telemetry Staging<br/>[stg_telemetry.sql]"]
  node_session_summary["Session Summary"]
  node_latest_lap["Latest Lap<br/>[fct_latest_lap.sql]"]
  node_gear_analysis["Gear Analysis"]
  node_integrity["Data Integrity"]
end

node_game(("Gran Turismo 7"))

node_game -->|"sends UDP"| node_listener
node_runner -->|"receives packets"| node_listener
node_runner -->|"sends heartbeat"| node_listener
node_runner -->|"decrypts and parses"| node_decoder
node_runner -->|"logs packet"| node_storage_code
node_storage_code -->|"creates table and inserts"| node_postgres

click node_runner "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/main.py"
click node_listener "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/collector.py"
click node_decoder "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/decoder.py"
click node_storage_code "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/storage.py"
click node_staging "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/stg_telemetry.sql"
click node_session_summary "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/fct_session_summary.sql"
click node_latest_lap "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/fct_latest_lap.sql"
click node_gear_analysis "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/fct_gear_analysis.sql"
click node_integrity "https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/obs_data_integrity.sql"

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_listener toneBlue
class node_runner,node_decoder toneAmber
class node_storage_code,node_postgres toneMint
class node_staging,node_session_summary,node_latest_lap,node_gear_analysis,node_integrity toneRose
class node_game toneIndigo
```

## Components

### Packet Capture

- [UDP Listener](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/collector.py): `src/collector.py`

### Telemetry Pipeline

- [Pipeline Runner](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/main.py): `src/main.py`
- [Decrypt and Parse](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/decoder.py): `src/decoder.py`

### Persistence

- [Telemetry Storage](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/src/storage.py): `src/storage.py`
- **PostgreSQL**

### Analytics Models

- [Telemetry Staging](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/stg_telemetry.sql): `transform/models/stg_telemetry.sql`
- [Session Summary](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/fct_session_summary.sql): `transform/models/marts/fct_session_summary.sql`
- [Latest Lap](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/fct_latest_lap.sql): `transform/models/marts/fct_latest_lap.sql`
- [Gear Analysis](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/fct_gear_analysis.sql): `transform/models/marts/fct_gear_analysis.sql`
- [Data Integrity](https://github.com/thebluesurf3r/apextelemetry/blob/feature/postgres-migration/transform/models/marts/obs_data_integrity.sql): `transform/models/marts/obs_data_integrity.sql`

### Other components

- **Gran Turismo 7**

## Connections

- Gran Turismo 7 → UDP Listener: sends UDP
- Pipeline Runner → UDP Listener: receives packets
- Pipeline Runner → UDP Listener: sends heartbeat
- Pipeline Runner → Decrypt and Parse: decrypts and parses
- Pipeline Runner → Telemetry Storage: logs packet
- Telemetry Storage → PostgreSQL: creates table and inserts
