# jaeke131/nba-pipeline architecture

> Architecture diagram of the GitHub repository jaeke131/nba-pipeline, 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/jaeke131/nba-pipeline
- Repository: https://github.com/jaeke131/nba-pipeline

## Overview

This repository is an in-progress NBA player-game-log ETL project. Its implemented extraction workflow requests regular-season logs from the NBA Stats API and saves timestamped raw JSON; transformation and database loading are not yet wired into that workflow. The transform module contains schema, type, and duplicate checks, while table creation executes the PostgreSQL schema. API and dashboard capabilities are planned, not implemented. The graph reflects documented plans separately; no orchestration between extraction, transformation, and loading is evidenced in the sampled source.

Main entry points: [`etl/app/load/create_tables.py`](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/load/create_tables.py) (Table creation), [`etl/app/extract/extract_player_game_logs.py`](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/extract/extract_player_game_logs.py) (Game-log extractor), [`etl/app/db/connection.py`](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/db/connection.py) (Database connection), [`etl/app`](https://github.com/jaeke131/nba-pipeline/tree/main/etl/app) (Planned API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Data acquisition"]
  node_extractor["Game-log extractor"]
  node_raw_data["Raw JSON files"]
end

subgraph group_processing["Data preparation"]
  node_transformer["Schema and type transform"]
end

subgraph group_persistence["PostgreSQL storage"]
  node_table_setup["Table creation<br/>[create_tables.py]"]
  node_db_connection["Database connection<br/>[connection.py]"]
  node_schema["Fact-table schema<br/>[schema.sql]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_analytics["Planned analytics"]
  node_api_planned["Planned API"]
  node_dashboard_planned["Planned React dashboard"]
end

node_operator(("Pipeline operator"))
node_nba_api["NBA Stats API"]

node_operator -->|"runs"| node_extractor
node_extractor -->|"requests logs"| node_nba_api
node_extractor -->|"writes JSON"| node_raw_data
node_table_setup -->|"uses engine"| node_db_connection
node_table_setup -->|"reads SQL"| node_schema
node_table_setup -->|"executes schema"| node_postgres
node_db_connection -->|"connects"| node_postgres
node_postgres -.->|"serves modeled data"| node_api_planned
node_api_planned -.->|"serves analytics"| node_dashboard_planned

click node_extractor "https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/extract/extract_player_game_logs.py"
click node_raw_data "https://github.com/jaeke131/nba-pipeline/tree/main/etl/app/data/raw"
click node_transformer "https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/transform/transform_player_game_logs.py"
click node_table_setup "https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/load/create_tables.py"
click node_db_connection "https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/db/connection.py"
click node_schema "https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/db/schema.sql"
click node_api_planned "https://github.com/jaeke131/nba-pipeline/tree/main/etl/app"
click node_dashboard_planned "https://github.com/jaeke131/nba-pipeline/tree/main/etl/app"

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_extractor,node_raw_data toneBlue
class node_transformer toneAmber
class node_table_setup,node_db_connection,node_schema,node_postgres,node_nba_api toneMint
class node_api_planned,node_dashboard_planned toneRose
class node_operator toneIndigo
```

## Components

### Data acquisition

- [Game-log extractor](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/extract/extract_player_game_logs.py): `etl/app/extract/extract_player_game_logs.py`
- [Raw JSON files](https://github.com/jaeke131/nba-pipeline/tree/main/etl/app/data/raw): `etl/app/data/raw`

### Data preparation

- [Schema and type transform](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/transform/transform_player_game_logs.py): `etl/app/transform/transform_player_game_logs.py`

### PostgreSQL storage

- [Table creation](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/load/create_tables.py): `etl/app/load/create_tables.py`
- [Database connection](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/db/connection.py): `etl/app/db/connection.py`
- [Fact-table schema](https://github.com/jaeke131/nba-pipeline/blob/main/etl/app/db/schema.sql): `etl/app/db/schema.sql`
- **PostgreSQL**

### Planned analytics

- [Planned API](https://github.com/jaeke131/nba-pipeline/tree/main/etl/app): `etl/app`
- [Planned React dashboard](https://github.com/jaeke131/nba-pipeline/tree/main/etl/app): `etl/app`

### Other components

- **Pipeline operator**
- **NBA Stats API**

## Connections

- Pipeline operator → Game-log extractor: runs
- Game-log extractor → NBA Stats API: requests logs
- Game-log extractor → Raw JSON files: writes JSON
- Table creation → Database connection: uses engine
- Table creation → Fact-table schema: reads SQL
- Table creation → PostgreSQL: executes schema
- Database connection → PostgreSQL: connects
- PostgreSQL → Planned API: serves modeled data
- Planned API → Planned React dashboard: serves analytics
