# trevormbugua030-bit/my-spotify-mini-player architecture

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

- Interactive diagram: https://gitdiagram.com/trevormbugua030-bit/my-spotify-mini-player
- Repository: https://github.com/trevormbugua030-bit/my-spotify-mini-player

## Overview

This is a single-file GTK 4/libadwaita controller for Spotify. The principal workflow is launching the player, connecting to Spotify over MPRIS, displaying playback state, and sending playback controls. The same module also includes Spotify launching and asynchronous album-art retrieval with a local cache. The graph reflects the sampled excerpts and README; callback wiring and some implementation details fall in omitted sections, so those relationships are not inferred.

Main entry points: [`spotify-mini-player.py`](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py) (Player application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Player interface"]
  node_app["Player application"]
  node_ui["Player UI"]
end

subgraph group_playback["Playback integration"]
  node_mpris["MPRIS D-Bus"]
  node_state["Playback state"]
  node_controls["Playback controls"]
end

subgraph group_artwork["Artwork"]
  node_art_loader["Art retrieval"]
  node_art_cache["Art cache"]
end

node_user(("User"))
node_spotify["Spotify desktop"]

node_user -->|"launches"| node_app
node_app -->|"builds"| node_ui
node_app -->|"connects"| node_mpris
node_mpris -->|"provides state"| node_state
node_state -->|"updates display"| node_ui
node_ui -.->|"requests controls"| node_controls
node_controls -->|"sends commands"| node_mpris
node_mpris -->|"controls playback"| node_spotify
node_art_loader -->|"caches artwork"| node_art_cache
node_art_loader -.->|"fetches art"| node_spotify
node_ui -->|"opens Spotify"| node_app

click node_app "https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py"
click node_ui "https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py"
click node_state "https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py"
click node_controls "https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py"
click node_art_loader "https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py"
click node_art_cache "https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.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_app,node_ui,node_user toneBlue
class node_mpris,node_state,node_controls toneAmber
class node_art_loader,node_art_cache toneMint
class node_spotify toneIndigo
```

## Components

### Player interface

- [Player application](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py): `spotify-mini-player.py`
- [Player UI](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py): `spotify-mini-player.py`

### Playback integration

- **MPRIS D-Bus**
- [Playback state](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py): `spotify-mini-player.py`
- [Playback controls](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py): `spotify-mini-player.py`

### Artwork

- [Art retrieval](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py): `spotify-mini-player.py`
- [Art cache](https://github.com/trevormbugua030-bit/my-spotify-mini-player/blob/main/spotify-mini-player.py): `spotify-mini-player.py`

### Other components

- **User**
- **Spotify desktop**

## Connections

- User → Player application: launches (evidence: `README.md`)
- Player application → Player UI: builds (evidence: `spotify-mini-player.py`)
- Player application → MPRIS D-Bus: connects (evidence: `README.md`)
- MPRIS D-Bus → Playback state: provides state (evidence: `spotify-mini-player.py`)
- Playback state → Player UI: updates display (evidence: `spotify-mini-player.py`)
- Player UI → Playback controls: requests controls (evidence: `spotify-mini-player.py`)
- Playback controls → MPRIS D-Bus: sends commands (evidence: `README.md`)
- MPRIS D-Bus → Spotify desktop: controls playback (evidence: `README.md`)
- Art retrieval → Art cache: caches artwork (evidence: `spotify-mini-player.py`)
- Art retrieval → Spotify desktop: fetches art
- Player UI → Player application: opens Spotify (evidence: `spotify-mini-player.py`)
