# maizeshark/desk architecture

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

- Interactive diagram: https://gitdiagram.com/maizeshark/desk
- Repository: https://github.com/maizeshark/desk

## Overview

Desk is a smart-desk hardware and software ecosystem, with MQTT linking media services and Home Assistant-facing integrations. The media workflow polls Spotify and Jellyfin or receives playback status, generates album artwork, then serves the image and publishes its URL; a separate Raspberry Pi bridge publishes MPRIS state and handles playback commands. The repository also contains the main electronics and encoder schematics, plus documented audio-matrix and fan-control designs. Software relationships follow excerpts; hardware links follow README descriptions, not net-level inspection.

Main entry points: [`PCB/Tisch.kicad_pcb`](https://github.com/maizeshark/desk/blob/main/PCB/Tisch.kicad_pcb) (Main PCB), [`UI/Docker/main.py`](https://github.com/maizeshark/desk/blob/main/UI/Docker/main.py) (Artwork service), [`Raspi/main.py`](https://github.com/maizeshark/desk/blob/main/Raspi/main.py) (MPRIS MQTT bridge), [`PCB/esp32.kicad_sch`](https://github.com/maizeshark/desk/blob/main/PCB/esp32.kicad_sch) (ESP32-S3 controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hardware["Desk hardware"]
  node_mainpcb["Main PCB<br/>[Tisch.kicad_pcb]"]
  node_controller["ESP32-S3 controller<br/>[esp32.kicad_sch]"]
  node_input["HID and encoders<br/>[hid.kicad_sch]"]
  node_display["Display interface<br/>[display.kicad_sch]"]
  node_hidboard["Encoder input PCB<br/>[encoder.kicad_sch]"]
  node_raspi["Raspberry Pi interface<br/>[raspi.kicad_sch]"]
  node_psu["Power supply<br/>[psu.kicad_sch]"]
end

subgraph group_audio["Audio system"]
  node_audio_design["Audio matrix design<br/>[audio.md]"]
  node_dsp["ADAU1451 DSP<br/>[ADAU1451.kicad_sch]"]
  node_audio_io["Audio converters<br/>[adc.kicad_sch]"]
  node_audio_sources["Digital audio sources<br/>[QCC5125.kicad_sch]"]
end

subgraph group_media["Media services"]
  node_mprissvc["MPRIS MQTT bridge<br/>[main.py]"]
  node_artservice["Artwork service<br/>[main.py]"]
  node_composer["Artwork composer<br/>[image.py]"]
  node_http["Artwork HTTP service<br/>[main.py]"]
end

subgraph group_thermal["Thermal control"]
  node_fan_design["Fan control design<br/>[fan_control.md]"]
  node_fan_circuit["Fan control circuit<br/>[fan.kicad_sch]"]
end

node_user(("Home Assistant user"))
node_player(("MPRIS media player"))
node_broker(("MQTT broker"))
node_spotify(("Spotify API"))
node_jellyfin(("Jellyfin server"))
node_external_gui(("Touchscreen GUI firmware"))

node_mainpcb -->|"integrates"| node_controller
node_mainpcb -->|"integrates"| node_input
node_mainpcb -->|"integrates"| node_display
node_hidboard -->|"provides inputs"| node_input
node_mainpcb -->|"integrates"| node_dsp
node_mainpcb -->|"integrates"| node_audio_io
node_mainpcb -->|"integrates"| node_audio_sources
node_audio_design -->|"describes"| node_dsp
node_mainpcb -->|"integrates"| node_raspi
node_mainpcb -->|"integrates"| node_fan_circuit
node_fan_design -->|"describes"| node_fan_circuit
node_mainpcb -->|"integrates"| node_psu
node_player -->|"provides playback state"| node_mprissvc
node_mprissvc -->|"sends playback commands"| node_player
node_mprissvc -->|"publishes status"| node_broker
node_broker -->|"delivers commands"| node_mprissvc
node_artservice -->|"polls playback"| node_spotify
node_artservice -->|"polls sessions"| node_jellyfin
node_broker -->|"delivers status"| node_artservice
node_artservice -->|"composes artwork"| node_composer
node_artservice -->|"serves artwork"| node_http
node_artservice -->|"publishes image URL"| node_broker
node_user -.->|"controls through"| node_broker
node_external_gui -.->|"controls desk"| node_controller

click node_mainpcb "https://github.com/maizeshark/desk/blob/main/PCB/Tisch.kicad_pcb"
click node_controller "https://github.com/maizeshark/desk/blob/main/PCB/esp32.kicad_sch"
click node_input "https://github.com/maizeshark/desk/blob/main/PCB/hid.kicad_sch"
click node_display "https://github.com/maizeshark/desk/blob/main/PCB/display.kicad_sch"
click node_hidboard "https://github.com/maizeshark/desk/blob/main/HID/encoder.kicad_sch"
click node_audio_design "https://github.com/maizeshark/desk/blob/main/audio.md"
click node_dsp "https://github.com/maizeshark/desk/blob/main/PCB/ADAU1451.kicad_sch"
click node_audio_io "https://github.com/maizeshark/desk/blob/main/PCB/adc.kicad_sch"
click node_audio_sources "https://github.com/maizeshark/desk/blob/main/PCB/QCC5125.kicad_sch"
click node_raspi "https://github.com/maizeshark/desk/blob/main/PCB/raspi.kicad_sch"
click node_mprissvc "https://github.com/maizeshark/desk/blob/main/Raspi/main.py"
click node_artservice "https://github.com/maizeshark/desk/blob/main/UI/Docker/main.py"
click node_composer "https://github.com/maizeshark/desk/blob/main/UI/Docker/image.py"
click node_http "https://github.com/maizeshark/desk/blob/main/UI/Docker/main.py"
click node_fan_design "https://github.com/maizeshark/desk/blob/main/fan_control.md"
click node_fan_circuit "https://github.com/maizeshark/desk/blob/main/PCB/fan.kicad_sch"
click node_psu "https://github.com/maizeshark/desk/blob/main/PCB/psu.kicad_sch"

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_mainpcb,node_controller,node_input,node_display,node_hidboard,node_raspi,node_psu,node_user,node_external_gui toneBlue
class node_audio_design,node_dsp,node_audio_io,node_audio_sources toneAmber
class node_mprissvc,node_artservice,node_composer,node_http,node_spotify,node_jellyfin toneMint
class node_fan_design,node_fan_circuit toneRose
class node_player,node_broker toneIndigo
```

## Components

### Desk hardware

- [Main PCB](https://github.com/maizeshark/desk/blob/main/PCB/Tisch.kicad_pcb): `PCB/Tisch.kicad_pcb`
- [ESP32-S3 controller](https://github.com/maizeshark/desk/blob/main/PCB/esp32.kicad_sch): `PCB/esp32.kicad_sch`
- [HID and encoders](https://github.com/maizeshark/desk/blob/main/PCB/hid.kicad_sch): `PCB/hid.kicad_sch`
- [Display interface](https://github.com/maizeshark/desk/blob/main/PCB/display.kicad_sch): `PCB/display.kicad_sch`
- [Encoder input PCB](https://github.com/maizeshark/desk/blob/main/HID/encoder.kicad_sch): `HID/encoder.kicad_sch`
- [Raspberry Pi interface](https://github.com/maizeshark/desk/blob/main/PCB/raspi.kicad_sch): `PCB/raspi.kicad_sch`
- [Power supply](https://github.com/maizeshark/desk/blob/main/PCB/psu.kicad_sch): `PCB/psu.kicad_sch`

### Audio system

- [Audio matrix design](https://github.com/maizeshark/desk/blob/main/audio.md): `audio.md`
- [ADAU1451 DSP](https://github.com/maizeshark/desk/blob/main/PCB/ADAU1451.kicad_sch): `PCB/ADAU1451.kicad_sch`
- [Audio converters](https://github.com/maizeshark/desk/blob/main/PCB/adc.kicad_sch): `PCB/adc.kicad_sch`
- [Digital audio sources](https://github.com/maizeshark/desk/blob/main/PCB/QCC5125.kicad_sch): `PCB/QCC5125.kicad_sch`

### Media services

- [MPRIS MQTT bridge](https://github.com/maizeshark/desk/blob/main/Raspi/main.py): `Raspi/main.py`
- [Artwork service](https://github.com/maizeshark/desk/blob/main/UI/Docker/main.py): `UI/Docker/main.py`
- [Artwork composer](https://github.com/maizeshark/desk/blob/main/UI/Docker/image.py): `UI/Docker/image.py`
- [Artwork HTTP service](https://github.com/maizeshark/desk/blob/main/UI/Docker/main.py): `UI/Docker/main.py`

### Thermal control

- [Fan control design](https://github.com/maizeshark/desk/blob/main/fan_control.md): `fan_control.md`
- [Fan control circuit](https://github.com/maizeshark/desk/blob/main/PCB/fan.kicad_sch): `PCB/fan.kicad_sch`

### Other components

- **Home Assistant user**
- **MPRIS media player**
- **MQTT broker**
- **Spotify API**
- **Jellyfin server**
- **Touchscreen GUI firmware**

## Connections

- Main PCB → ESP32-S3 controller: integrates (evidence: `README.md`)
- Main PCB → HID and encoders: integrates (evidence: `README.md`)
- Main PCB → Display interface: integrates (evidence: `README.md`)
- Encoder input PCB → HID and encoders: provides inputs (evidence: `README.md`)
- Main PCB → ADAU1451 DSP: integrates (evidence: `README.md`)
- Main PCB → Audio converters: integrates (evidence: `README.md`)
- Main PCB → Digital audio sources: integrates (evidence: `README.md`)
- Audio matrix design → ADAU1451 DSP: describes (evidence: `README.md`)
- Main PCB → Raspberry Pi interface: integrates (evidence: `README.md`)
- Main PCB → Fan control circuit: integrates (evidence: `README.md`)
- Fan control design → Fan control circuit: describes (evidence: `README.md`)
- Main PCB → Power supply: integrates (evidence: `README.md`)
- MPRIS media player → MPRIS MQTT bridge: provides playback state (evidence: `Raspi/main.py`)
- MPRIS MQTT bridge → MPRIS media player: sends playback commands (evidence: `Raspi/main.py`)
- MPRIS MQTT bridge → MQTT broker: publishes status (evidence: `Raspi/main.py`)
- MQTT broker → MPRIS MQTT bridge: delivers commands (evidence: `Raspi/main.py`)
- Artwork service → Spotify API: polls playback (evidence: `UI/Docker/main.py`)
- Artwork service → Jellyfin server: polls sessions (evidence: `UI/Docker/main.py`)
- MQTT broker → Artwork service: delivers status (evidence: `UI/Docker/main.py`)
- Artwork service → Artwork composer: composes artwork (evidence: `UI/Docker/main.py`)
- Artwork service → Artwork HTTP service: serves artwork (evidence: `README.md`)
- Artwork service → MQTT broker: publishes image URL (evidence: `README.md`)
- Home Assistant user → MQTT broker: controls through (evidence: `README.md`)
- Touchscreen GUI firmware → ESP32-S3 controller: controls desk (evidence: `README.md`)
