# kevinw14/nascarpylon architecture

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

- Interactive diagram: https://gitdiagram.com/kevinw14/nascarpylon
- Repository: https://github.com/kevinw14/nascarpylon

## Overview

NascarPylon is a terminal NASCAR live-race monitor. The user selects a series in the program; the client loads NASCAR’s operations feed to find that series’ live-feed URL, fetches and parses race data, and the terminal refreshes the standings every two seconds with lap, flag, and position-change indicators. The feed models also parse vehicle pit stops, while the operations feed exposes driver-points URLs that this workflow does not fetch. Relationships reflect the shown calls and object construction; no separate storage layer is present.

Main entry points: [`src/main.py`](https://github.com/kevinw14/nascarpylon/blob/main/src/main.py) (Race monitor), [`src/ApiClient.py`](https://github.com/kevinw14/nascarpylon/blob/main/src/ApiClient.py) (API client), [`src/LiveFeed.py`](https://github.com/kevinw14/nascarpylon/blob/main/src/LiveFeed.py) (Live race feed), [`src/Vehicle.py`](https://github.com/kevinw14/nascarpylon/blob/main/src/Vehicle.py) (Vehicle data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Terminal display"]
  node_main["Race monitor<br/>[main.py]"]
  node_colors["Terminal colors<br/>[Colors.py]"]
end

subgraph group_access["Feed access"]
  node_client["API client<br/>[ApiClient.py]"]
end

subgraph group_models["Feed models"]
  node_flags["Flag states<br/>[FlagStatus.py]"]
  node_series["Race series<br/>[Series.py]"]
  node_ops["Operations feed<br/>[OpsFeed.py]"]
  node_live["Live race feed<br/>[LiveFeed.py]"]
  node_vehicle["Vehicle data<br/>[Vehicle.py]"]
  node_pitstop["Pit stop data<br/>[PitStop.py]"]
end

node_user(("Operator"))
node_nascar(("NASCAR feed service"))

node_user -->|"runs"| node_main
node_main -->|"requests feed"| node_client
node_main -->|"selects series"| node_series
node_main -->|"formats flags"| node_flags
node_main -->|"colors output"| node_colors
node_client -->|"fetches feeds"| node_nascar
node_client -->|"parses operations"| node_ops
node_client -->|"parses live data"| node_live
node_client -->|"selects feed URL"| node_series
node_live -->|"parses flag state"| node_flags
node_live -->|"builds vehicles"| node_vehicle
node_vehicle -->|"builds pit stops"| node_pitstop

click node_main "https://github.com/kevinw14/nascarpylon/blob/main/src/main.py"
click node_colors "https://github.com/kevinw14/nascarpylon/blob/main/src/Colors.py"
click node_flags "https://github.com/kevinw14/nascarpylon/blob/main/src/FlagStatus.py"
click node_series "https://github.com/kevinw14/nascarpylon/blob/main/src/Series.py"
click node_client "https://github.com/kevinw14/nascarpylon/blob/main/src/ApiClient.py"
click node_ops "https://github.com/kevinw14/nascarpylon/blob/main/src/OpsFeed.py"
click node_live "https://github.com/kevinw14/nascarpylon/blob/main/src/LiveFeed.py"
click node_vehicle "https://github.com/kevinw14/nascarpylon/blob/main/src/Vehicle.py"
click node_pitstop "https://github.com/kevinw14/nascarpylon/blob/main/src/PitStop.py"

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_main,node_colors toneBlue
class node_client toneAmber
class node_flags,node_series,node_ops,node_live,node_vehicle,node_pitstop toneMint
class node_user,node_nascar toneIndigo
```

## Components

### Terminal display

- [Race monitor](https://github.com/kevinw14/nascarpylon/blob/main/src/main.py): `src/main.py`
- [Terminal colors](https://github.com/kevinw14/nascarpylon/blob/main/src/Colors.py): `src/Colors.py`

### Feed access

- [API client](https://github.com/kevinw14/nascarpylon/blob/main/src/ApiClient.py): `src/ApiClient.py`

### Feed models

- [Flag states](https://github.com/kevinw14/nascarpylon/blob/main/src/FlagStatus.py): `src/FlagStatus.py`
- [Race series](https://github.com/kevinw14/nascarpylon/blob/main/src/Series.py): `src/Series.py`
- [Operations feed](https://github.com/kevinw14/nascarpylon/blob/main/src/OpsFeed.py): `src/OpsFeed.py`
- [Live race feed](https://github.com/kevinw14/nascarpylon/blob/main/src/LiveFeed.py): `src/LiveFeed.py`
- [Vehicle data](https://github.com/kevinw14/nascarpylon/blob/main/src/Vehicle.py): `src/Vehicle.py`
- [Pit stop data](https://github.com/kevinw14/nascarpylon/blob/main/src/PitStop.py): `src/PitStop.py`

### Other components

- **Operator**
- **NASCAR feed service**

## Connections

- Operator → Race monitor: runs (evidence: `src/main.py`)
- Race monitor → API client: requests feed (evidence: `src/main.py`)
- Race monitor → Race series: selects series (evidence: `src/main.py`)
- Race monitor → Flag states: formats flags (evidence: `src/main.py`)
- Race monitor → Terminal colors: colors output (evidence: `src/main.py`)
- API client → NASCAR feed service: fetches feeds (evidence: `src/ApiClient.py`)
- API client → Operations feed: parses operations (evidence: `src/ApiClient.py`)
- API client → Live race feed: parses live data (evidence: `src/ApiClient.py`)
- API client → Race series: selects feed URL (evidence: `src/ApiClient.py`)
- Live race feed → Flag states: parses flag state (evidence: `src/LiveFeed.py`)
- Live race feed → Vehicle data: builds vehicles (evidence: `src/LiveFeed.py`)
- Vehicle data → Pit stop data: builds pit stops (evidence: `src/Vehicle.py`)
