# plamere/playlistminer architecture

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

- Interactive diagram: https://gitdiagram.com/plamere/playlistminer
- Repository: https://github.com/plamere/playlistminer

## Overview

The Playlist Miner is a browser app whose documented workflow searches Spotify playlists by keyword, aggregates and ranks their tracks, and lets users save the resulting top songs as a playlist. The tree also contains a separate Spotify playlist crawler and offline track-processing script, plus the Underscore utility. The README establishes the app’s capabilities, but the page source is not excerpted, so runtime wiring between browser components is not asserted. The crawler-to-processor file handoff is visible in their excerpts.

Main entry points: [`index.html`](https://github.com/plamere/playlistminer/blob/master/index.html) (Keyword search), [`scripts/crawl.py`](https://github.com/plamere/playlistminer/blob/master/scripts/crawl.py) (Playlist crawler), [`scripts/proc.py`](https://github.com/plamere/playlistminer/blob/master/scripts/proc.py) (Track processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web_app["Playlist Miner app"]
  node_app["Playlist Miner<br/>[index.html]"]
  node_settings["Spotify settings<br/>[config.js]"]
  node_playlist_matches["Matching playlists<br/>[index.html]"]
  node_track_aggregation["Track aggregation<br/>[index.html]"]
  node_top_songs["Top songs<br/>[index.html]"]
end

subgraph group_spotify["Spotify integration"]
  node_keyword_search["Keyword search<br/>[index.html]"]
  node_playlist_save["Save playlist<br/>[index.html]"]
end

subgraph group_offline["Offline track tools"]
  node_crawler["Playlist crawler<br/>[crawl.py]"]
  node_track_pickle["Track counts file"]
  node_processor["Track processor<br/>[proc.py]"]
end

subgraph group_shared["Browser utility"]
  node_underscore["Underscore utilities<br/>[underscore-min.js]"]
end

node_user(("Playlist seeker"))
node_spotify_api{{"Spotify Web API"}}

node_user -->|"uses"| node_app
node_app -->|"accepts keywords"| node_keyword_search
node_keyword_search -->|"searches playlists"| node_spotify_api
node_keyword_search -->|"finds matches"| node_playlist_matches
node_playlist_matches -->|"aggregates tracks"| node_track_aggregation
node_track_aggregation -->|"ranks songs"| node_top_songs
node_top_songs -->|"offers saving"| node_playlist_save
node_playlist_save -->|"saves playlist"| node_spotify_api
node_crawler -->|"searches and reads"| node_spotify_api
node_crawler -->|"writes counts"| node_track_pickle
node_track_pickle -->|"loads counts"| node_processor

click node_app "https://github.com/plamere/playlistminer/blob/master/index.html"
click node_settings "https://github.com/plamere/playlistminer/blob/master/config.js"
click node_keyword_search "https://github.com/plamere/playlistminer/blob/master/index.html"
click node_playlist_matches "https://github.com/plamere/playlistminer/blob/master/index.html"
click node_track_aggregation "https://github.com/plamere/playlistminer/blob/master/index.html"
click node_top_songs "https://github.com/plamere/playlistminer/blob/master/index.html"
click node_playlist_save "https://github.com/plamere/playlistminer/blob/master/index.html"
click node_crawler "https://github.com/plamere/playlistminer/blob/master/scripts/crawl.py"
click node_processor "https://github.com/plamere/playlistminer/blob/master/scripts/proc.py"
click node_underscore "https://github.com/plamere/playlistminer/blob/master/lib/underscore-min.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_app,node_settings,node_playlist_matches,node_track_aggregation,node_top_songs toneBlue
class node_keyword_search,node_playlist_save toneAmber
class node_crawler,node_track_pickle,node_processor,node_spotify_api toneMint
class node_underscore toneRose
class node_user toneIndigo
```

## Components

### Playlist Miner app

- [Playlist Miner](https://github.com/plamere/playlistminer/blob/master/index.html): `index.html`
- [Spotify settings](https://github.com/plamere/playlistminer/blob/master/config.js): `config.js`
- [Matching playlists](https://github.com/plamere/playlistminer/blob/master/index.html): `index.html`
- [Track aggregation](https://github.com/plamere/playlistminer/blob/master/index.html): `index.html`
- [Top songs](https://github.com/plamere/playlistminer/blob/master/index.html): `index.html`

### Spotify integration

- [Keyword search](https://github.com/plamere/playlistminer/blob/master/index.html): `index.html`
- [Save playlist](https://github.com/plamere/playlistminer/blob/master/index.html): `index.html`

### Offline track tools

- [Playlist crawler](https://github.com/plamere/playlistminer/blob/master/scripts/crawl.py): `scripts/crawl.py`
- **Track counts file**
- [Track processor](https://github.com/plamere/playlistminer/blob/master/scripts/proc.py): `scripts/proc.py`

### Browser utility

- [Underscore utilities](https://github.com/plamere/playlistminer/blob/master/lib/underscore-min.js): `lib/underscore-min.js`

### Other components

- **Playlist seeker**
- **Spotify Web API**

## Connections

- Playlist seeker → Playlist Miner: uses (evidence: `README.md`)
- Playlist Miner → Keyword search: accepts keywords (evidence: `README.md`)
- Keyword search → Spotify Web API: searches playlists (evidence: `README.md`)
- Keyword search → Matching playlists: finds matches (evidence: `README.md`)
- Matching playlists → Track aggregation: aggregates tracks (evidence: `README.md`)
- Track aggregation → Top songs: ranks songs (evidence: `README.md`)
- Top songs → Save playlist: offers saving (evidence: `README.md`)
- Save playlist → Spotify Web API: saves playlist (evidence: `README.md`)
- Playlist crawler → Spotify Web API: searches and reads (evidence: `scripts/crawl.py`)
- Playlist crawler → Track counts file: writes counts (evidence: `scripts/crawl.py`)
- Track counts file → Track processor: loads counts (evidence: `scripts/proc.py`)
