# jnyambok/my-spotify-wrapped architecture

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

- Interactive diagram: https://gitdiagram.com/jnyambok/my-spotify-wrapped
- Repository: https://github.com/jnyambok/my-spotify-wrapped

## Overview

This is a personal Spotify listening-history analytics product: an export is loaded into BigQuery, transformed and tested with dbt, exported as aggregate JSON, and presented in a static dashboard. The README documents the staging → intermediate → marts structure and dashboard capabilities; the sampled sources show the loader, pipeline orchestration, and mart export. Individual dbt model dependencies and dashboard implementation details were not sampled, so the graph shows documented stage-level flow rather than inferred model-to-model calls.

Main entry points: [`export/export_data.py`](https://github.com/jnyambok/my-spotify-wrapped/blob/main/export/export_data.py) (Mart exporter), [`spotify_dbt/models/intermediate/int_track_weekly_plays.sql`](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/intermediate/int_track_weekly_plays.sql) (Weekly track plays), [`pipeline.py`](https://github.com/jnyambok/my-spotify-wrapped/blob/main/pipeline.py) (Pipeline runner), [`extract/load.py`](https://github.com/jnyambok/my-spotify-wrapped/blob/main/extract/load.py) (Export loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_loader["Export loader<br/>[load.py]"]
  node_raw_store[("BigQuery raw tables")]
end

subgraph group_model["dbt analytics"]
  node_staging["Staging models"]
  node_weekly["Weekly track plays"]
  node_totals["Listening totals"]
  node_tracks["Top tracks<br/>[fct_top_tracks.sql]"]
  node_artists["Top artists"]
  node_daily["Daily listening"]
  node_heatmap["Listening heatmap"]
  node_skip["Skip buckets"]
  node_monthly["Monthly listening"]
  node_obsessions["Track obsessions<br/>[fct_obsessions.sql]"]
  node_library["Unplayed library"]
  node_wrapped["Wrapped comparison"]
end

subgraph group_publish["Dashboard publishing"]
  node_orchestrator["Pipeline runner<br/>[pipeline.py]"]
  node_exporter["Mart exporter<br/>[export_data.py]"]
  node_data_json["Dashboard data<br/>[data.json]"]
end

subgraph group_dashboard["Listening dashboard"]
  node_dashboard["Static dashboard<br/>[app.js]"]
end

node_listener(("Listener"))
node_spotify_export["Spotify data export"]

node_listener -->|"requests data"| node_spotify_export
node_spotify_export -->|"provides archive"| node_loader
node_orchestrator -->|"runs load"| node_loader
node_loader -->|"loads tables"| node_raw_store
node_orchestrator -->|"builds models"| node_staging
node_raw_store -->|"stages data"| node_staging
node_staging -->|"transforms"| node_weekly
node_weekly -->|"feeds marts"| node_totals
node_weekly -->|"feeds marts"| node_tracks
node_weekly -->|"feeds marts"| node_artists
node_weekly -->|"feeds marts"| node_daily
node_weekly -->|"feeds marts"| node_heatmap
node_weekly -->|"feeds marts"| node_skip
node_weekly -->|"feeds marts"| node_monthly
node_weekly -->|"feeds marts"| node_obsessions
node_weekly -->|"feeds marts"| node_library
node_weekly -->|"feeds marts"| node_wrapped
node_orchestrator -->|"runs export"| node_exporter
node_exporter -->|"queries"| node_totals
node_exporter -->|"queries"| node_tracks
node_exporter -->|"queries"| node_artists
node_exporter -->|"queries"| node_daily
node_exporter -->|"queries"| node_heatmap
node_exporter -->|"queries"| node_skip
node_exporter -->|"queries"| node_monthly
node_exporter -->|"queries"| node_obsessions
node_exporter -->|"queries"| node_library
node_exporter -->|"queries"| node_wrapped
node_exporter -->|"writes JSON"| node_data_json
node_data_json -->|"loads data"| node_dashboard
node_listener -->|"views insights"| node_dashboard

click node_loader "https://github.com/jnyambok/my-spotify-wrapped/blob/main/extract/load.py"
click node_staging "https://github.com/jnyambok/my-spotify-wrapped/tree/main/spotify_dbt/models/staging"
click node_weekly "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/intermediate/int_track_weekly_plays.sql"
click node_totals "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_listening_totals.sql"
click node_tracks "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_top_tracks.sql"
click node_artists "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_top_artists.sql"
click node_daily "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_daily_listening.sql"
click node_heatmap "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_listening_heatmap.sql"
click node_skip "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_skip_buckets.sql"
click node_monthly "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_monthly_listening.sql"
click node_obsessions "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_obsessions.sql"
click node_library "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_library_unplayed.sql"
click node_wrapped "https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_wrapped_2025.sql"
click node_orchestrator "https://github.com/jnyambok/my-spotify-wrapped/blob/main/pipeline.py"
click node_exporter "https://github.com/jnyambok/my-spotify-wrapped/blob/main/export/export_data.py"
click node_data_json "https://github.com/jnyambok/my-spotify-wrapped/blob/main/docs/data.json"
click node_dashboard "https://github.com/jnyambok/my-spotify-wrapped/blob/main/docs/app.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_loader,node_raw_store toneBlue
class node_staging,node_weekly,node_totals,node_tracks,node_artists,node_daily,node_heatmap,node_skip,node_monthly,node_obsessions,node_library,node_wrapped toneAmber
class node_orchestrator,node_exporter,node_data_json toneMint
class node_dashboard toneRose
class node_listener,node_spotify_export toneIndigo
```

## Components

### Data ingestion

- [Export loader](https://github.com/jnyambok/my-spotify-wrapped/blob/main/extract/load.py): `extract/load.py`
- **BigQuery raw tables**

### dbt analytics

- [Staging models](https://github.com/jnyambok/my-spotify-wrapped/tree/main/spotify_dbt/models/staging): `spotify_dbt/models/staging`
- [Weekly track plays](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/intermediate/int_track_weekly_plays.sql): `spotify_dbt/models/intermediate/int_track_weekly_plays.sql`
- [Listening totals](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_listening_totals.sql): `spotify_dbt/models/marts/fct_listening_totals.sql`
- [Top tracks](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_top_tracks.sql): `spotify_dbt/models/marts/fct_top_tracks.sql`
- [Top artists](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_top_artists.sql): `spotify_dbt/models/marts/fct_top_artists.sql`
- [Daily listening](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_daily_listening.sql): `spotify_dbt/models/marts/fct_daily_listening.sql`
- [Listening heatmap](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_listening_heatmap.sql): `spotify_dbt/models/marts/fct_listening_heatmap.sql`
- [Skip buckets](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_skip_buckets.sql): `spotify_dbt/models/marts/fct_skip_buckets.sql`
- [Monthly listening](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_monthly_listening.sql): `spotify_dbt/models/marts/fct_monthly_listening.sql`
- [Track obsessions](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_obsessions.sql): `spotify_dbt/models/marts/fct_obsessions.sql`
- [Unplayed library](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_library_unplayed.sql): `spotify_dbt/models/marts/fct_library_unplayed.sql`
- [Wrapped comparison](https://github.com/jnyambok/my-spotify-wrapped/blob/main/spotify_dbt/models/marts/fct_wrapped_2025.sql): `spotify_dbt/models/marts/fct_wrapped_2025.sql`

### Dashboard publishing

- [Pipeline runner](https://github.com/jnyambok/my-spotify-wrapped/blob/main/pipeline.py): `pipeline.py`
- [Mart exporter](https://github.com/jnyambok/my-spotify-wrapped/blob/main/export/export_data.py): `export/export_data.py`
- [Dashboard data](https://github.com/jnyambok/my-spotify-wrapped/blob/main/docs/data.json): `docs/data.json`

### Listening dashboard

- [Static dashboard](https://github.com/jnyambok/my-spotify-wrapped/blob/main/docs/app.js): `docs/app.js`

### Other components

- **Listener**
- **Spotify data export**

## Connections

- Listener → Spotify data export: requests data (evidence: `README.md`)
- Spotify data export → Export loader: provides archive (evidence: `extract/load.py`)
- Pipeline runner → Export loader: runs load (evidence: `pipeline.py`)
- Export loader → BigQuery raw tables: loads tables (evidence: `extract/load.py`)
- Pipeline runner → Staging models: builds models (evidence: `pipeline.py`)
- BigQuery raw tables → Staging models: stages data (evidence: `README.md`)
- Staging models → Weekly track plays: transforms (evidence: `README.md`)
- Weekly track plays → Listening totals: feeds marts (evidence: `README.md`)
- Weekly track plays → Top tracks: feeds marts (evidence: `README.md`)
- Weekly track plays → Top artists: feeds marts (evidence: `README.md`)
- Weekly track plays → Daily listening: feeds marts (evidence: `README.md`)
- Weekly track plays → Listening heatmap: feeds marts (evidence: `README.md`)
- Weekly track plays → Skip buckets: feeds marts (evidence: `README.md`)
- Weekly track plays → Monthly listening: feeds marts (evidence: `README.md`)
- Weekly track plays → Track obsessions: feeds marts (evidence: `README.md`)
- Weekly track plays → Unplayed library: feeds marts (evidence: `README.md`)
- Weekly track plays → Wrapped comparison: feeds marts (evidence: `README.md`)
- Pipeline runner → Mart exporter: runs export (evidence: `pipeline.py`)
- Mart exporter → Listening totals: queries (evidence: `export/export_data.py`)
- Mart exporter → Top tracks: queries (evidence: `export/export_data.py`)
- Mart exporter → Top artists: queries (evidence: `export/export_data.py`)
- Mart exporter → Daily listening: queries (evidence: `export/export_data.py`)
- Mart exporter → Listening heatmap: queries (evidence: `export/export_data.py`)
- Mart exporter → Skip buckets: queries (evidence: `export/export_data.py`)
- Mart exporter → Monthly listening: queries (evidence: `export/export_data.py`)
- Mart exporter → Track obsessions: queries (evidence: `export/export_data.py`)
- Mart exporter → Unplayed library: queries (evidence: `export/export_data.py`)
- Mart exporter → Wrapped comparison: queries (evidence: `export/export_data.py`)
- Mart exporter → Dashboard data: writes JSON (evidence: `export/export_data.py`)
- Dashboard data → Static dashboard: loads data (evidence: `README.md`)
- Listener → Static dashboard: views insights (evidence: `README.md`)
