# hemanth2332/tuitify architecture

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

- Interactive diagram: https://gitdiagram.com/hemanth2332/tuitify
- Repository: https://github.com/hemanth2332/tuitify

## Overview

Tuitify is a keyboard-driven terminal streaming app. The main flow is user search or selection in the TUI, YouTube-backed discovery, VLC playback, and radio recommendations that can refill the listening queue. The TUI also handles playback controls, cached search results, artwork, progress, and theme preferences. The graph includes the documented artwork and theme capabilities; source excerpts are partial, so uncertain wiring is omitted.

Main entry points: [`src/tui/tui.py`](https://github.com/hemanth2332/tuitify/blob/main/src/tui/tui.py) (TUI controller), [`src/youtube/service.py`](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/service.py) (YouTube service), [`src/youtube/radio.py`](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/radio.py) (Radio engine), [`src/youtube/player.py`](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/player.py) (VLC player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal interface"]
  node_app["App entry<br/>[main.py]"]
  node_tui["TUI controller<br/>[tui.py]"]
  node_keys["Keybindings<br/>[keybindings.py]"]
end

subgraph group_discovery["Discovery and radio"]
  node_searcher["Search wrapper<br/>[searcher.py]"]
  node_service["YouTube service<br/>[service.py]"]
  node_radio["Radio engine<br/>[radio.py]"]
  node_trackutils["Track utilities<br/>[utils.py]"]
end

subgraph group_playback["Streaming playback"]
  node_player["VLC player<br/>[player.py]"]
end

subgraph group_presentation["UI preferences"]
  node_settings["Theme settings<br/>[settings.json]"]
  node_styles["TUI styles<br/>[styles.tcss]"]
end

node_user(("Listener"))
node_vlc["VLC engine"]
node_youtube["YouTube services"]

node_user -->|"starts"| node_app
node_app -->|"runs"| node_tui
node_user -->|"controls"| node_tui
node_tui -->|"uses bindings"| node_keys
node_tui -->|"searches"| node_searcher
node_searcher -->|"delegates"| node_service
node_service -->|"searches and fetches"| node_youtube
node_tui -->|"starts playback"| node_player
node_player -->|"gets stream info"| node_service
node_player -->|"plays audio"| node_vlc
node_tui -->|"requests next track"| node_radio
node_radio -->|"fetches recommendations"| node_service
node_radio -->|"cleans and ranks"| node_trackutils
node_tui -->|"reads and writes"| node_settings
node_tui -.->|"uses styles"| node_styles

click node_app "https://github.com/hemanth2332/tuitify/blob/main/main.py"
click node_tui "https://github.com/hemanth2332/tuitify/blob/main/src/tui/tui.py"
click node_keys "https://github.com/hemanth2332/tuitify/blob/main/src/tui/keybindings.py"
click node_searcher "https://github.com/hemanth2332/tuitify/blob/main/src/search/searcher.py"
click node_service "https://github.com/hemanth2332/tuitify/blob/main/src/youtube/service.py"
click node_radio "https://github.com/hemanth2332/tuitify/blob/main/src/youtube/radio.py"
click node_trackutils "https://github.com/hemanth2332/tuitify/blob/main/src/youtube/utils.py"
click node_player "https://github.com/hemanth2332/tuitify/blob/main/src/youtube/player.py"
click node_settings "https://github.com/hemanth2332/tuitify/blob/main/src/tui/settings.json"
click node_styles "https://github.com/hemanth2332/tuitify/blob/main/src/tui/styles.tcss"

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_tui,node_keys toneBlue
class node_searcher,node_service,node_radio,node_trackutils toneAmber
class node_player toneMint
class node_settings,node_styles toneRose
class node_user,node_vlc,node_youtube toneIndigo
```

## Components

### Terminal interface

- [App entry](https://github.com/hemanth2332/tuitify/blob/main/main.py): `main.py`
- [TUI controller](https://github.com/hemanth2332/tuitify/blob/main/src/tui/tui.py): `src/tui/tui.py`
- [Keybindings](https://github.com/hemanth2332/tuitify/blob/main/src/tui/keybindings.py): `src/tui/keybindings.py`

### Discovery and radio

- [Search wrapper](https://github.com/hemanth2332/tuitify/blob/main/src/search/searcher.py): `src/search/searcher.py`
- [YouTube service](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/service.py): `src/youtube/service.py`
- [Radio engine](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/radio.py): `src/youtube/radio.py`
- [Track utilities](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/utils.py): `src/youtube/utils.py`

### Streaming playback

- [VLC player](https://github.com/hemanth2332/tuitify/blob/main/src/youtube/player.py): `src/youtube/player.py`

### UI preferences

- [Theme settings](https://github.com/hemanth2332/tuitify/blob/main/src/tui/settings.json): `src/tui/settings.json`
- [TUI styles](https://github.com/hemanth2332/tuitify/blob/main/src/tui/styles.tcss): `src/tui/styles.tcss`

### Other components

- **Listener**
- **VLC engine**
- **YouTube services**

## Connections

- Listener → App entry: starts (evidence: `README.md`)
- App entry → TUI controller: runs (evidence: `main.py`)
- Listener → TUI controller: controls (evidence: `README.md`)
- TUI controller → Keybindings: uses bindings (evidence: `src/tui/tui.py`)
- TUI controller → Search wrapper: searches (evidence: `src/tui/tui.py`)
- Search wrapper → YouTube service: delegates (evidence: `src/search/searcher.py`)
- YouTube service → YouTube services: searches and fetches (evidence: `src/youtube/service.py`)
- TUI controller → VLC player: starts playback (evidence: `src/tui/tui.py`)
- VLC player → YouTube service: gets stream info (evidence: `src/youtube/player.py`)
- VLC player → VLC engine: plays audio (evidence: `README.md`)
- TUI controller → Radio engine: requests next track (evidence: `src/tui/tui.py`)
- Radio engine → YouTube service: fetches recommendations (evidence: `src/youtube/radio.py`)
- Radio engine → Track utilities: cleans and ranks (evidence: `src/youtube/radio.py`)
- TUI controller → Theme settings: reads and writes (evidence: `src/tui/tui.py`)
- TUI controller → TUI styles: uses styles (evidence: `README.md`)
