# edubr029/esp32-spotify-player architecture

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

- Interactive diagram: https://gitdiagram.com/edubr029/esp32-spotify-player
- Repository: https://github.com/edubr029/esp32-spotify-player

## Overview

The product bridges Spotify playback on a Linux host to an ESP32 OLED display. Its main workflow polls playback fields through playerctl, formats them as semicolon-delimited serial records, and sends them to the device for display. The C source shows the host-side polling, formatting, serial setup, and keyboard/signal exits. The README documents the ESP32 display and protocol, but the Arduino source was not sampled, so the device-side parsing and rendering details are not inferred.

Main entry points: [`playerctl_to_serial.c`](https://github.com/edubr029/esp32-spotify-player/blob/main/playerctl_to_serial.c) (Serial Bridge), [`esp32-spotify-player.ino`](https://github.com/edubr029/esp32-spotify-player/blob/main/esp32-spotify-player.ino) (Playback Display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Linux Host Bridge"]
  node_bridge["Serial Bridge"]
  node_playerctl["playerctl Queries"]
end

subgraph group_device["ESP32 Display"]
  node_display["Playback Display"]
  node_oled["OLED Screen"]
end

node_user(("Operator"))
node_spotify["Spotify Playback"]
node_serial["Serial Port"]

node_user -->|"runs with options"| node_bridge
node_bridge -->|"queries playback"| node_playerctl
node_playerctl -->|"reads playback"| node_spotify
node_bridge -->|"writes records"| node_serial
node_serial -.->|"delivers records"| node_display
node_display -.->|"renders playback"| node_oled

click node_bridge "https://github.com/edubr029/esp32-spotify-player/blob/main/playerctl_to_serial.c"
click node_playerctl "https://github.com/edubr029/esp32-spotify-player/blob/main/playerctl_to_serial.c"
click node_display "https://github.com/edubr029/esp32-spotify-player/blob/main/esp32-spotify-player.ino"

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_bridge,node_playerctl toneBlue
class node_display,node_oled toneAmber
class node_user,node_spotify,node_serial toneIndigo
```

## Components

### Linux Host Bridge

- [Serial Bridge](https://github.com/edubr029/esp32-spotify-player/blob/main/playerctl_to_serial.c): `playerctl_to_serial.c`
- [playerctl Queries](https://github.com/edubr029/esp32-spotify-player/blob/main/playerctl_to_serial.c): `playerctl_to_serial.c`

### ESP32 Display

- [Playback Display](https://github.com/edubr029/esp32-spotify-player/blob/main/esp32-spotify-player.ino): `esp32-spotify-player.ino`
- **OLED Screen**

### Other components

- **Operator**
- **Spotify Playback**
- **Serial Port**

## Connections

- Operator → Serial Bridge: runs with options (evidence: `README.md`)
- Serial Bridge → playerctl Queries: queries playback (evidence: `playerctl_to_serial.c`)
- playerctl Queries → Spotify Playback: reads playback (evidence: `playerctl_to_serial.c`)
- Serial Bridge → Serial Port: writes records (evidence: `playerctl_to_serial.c`)
- Serial Port → Playback Display: delivers records (evidence: `README.md`)
- Playback Display → OLED Screen: renders playback (evidence: `README.md`)
