# nexusjuan12/nostalgiavision architecture

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

- Interactive diagram: https://gitdiagram.com/nexusjuan12/nostalgiavision
- Repository: https://github.com/nexusjuan12/nostalgiavision

## Overview

NostalgiaVision is a self-hosted Plex-to-live-TV web app. Users connect a Plex server, select libraries to sync, build a rolling schedule, then browse the EPG and watch programs as playback advances. The main domain stages are library discovery and caching, channel matching, schedule generation, and guide/playback delivery. The graph includes documented UI capabilities whose wiring is not fully visible in the sampled source; those links are limited to the Flask app’s documented role and the listed templates.

Main entry points: [`app.py`](https://github.com/nexusjuan12/nostalgiavision/blob/main/app.py) (Flask app and API), [`library_sync.py`](https://github.com/nexusjuan12/nostalgiavision/blob/main/library_sync.py) (Library sync), [`scheduler.py`](https://github.com/nexusjuan12/nostalgiavision/blob/main/scheduler.py) (Schedule generation), [`templates/index.html`](https://github.com/nexusjuan12/nostalgiavision/blob/main/templates/index.html) (Guide and settings UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_ui["Guide and settings UI<br/>[index.html]"]
  node_player_ui["Playback UI<br/>[player.html]"]
  node_web_app["Flask app and API<br/>[app.py]"]
end

subgraph group_library["Library and channels"]
  node_library_sync["Library sync<br/>[library_sync.py]"]
  node_channel_defs["Channel definitions<br/>[channels.py]"]
end

subgraph group_schedule["Scheduling"]
  node_schedule_engine["Schedule generation<br/>[scheduler.py]"]
end

subgraph group_integrations["Persistence and Plex"]
  node_plex_client["Plex API client<br/>[plex_client.py]"]
  node_sqlite[("Content and EPG database<br/>[database.py]")]
end

node_viewer(("Viewer"))
node_plex_server["Plex Media Server"]

node_viewer -->|"uses"| node_web_ui
node_web_ui -->|"requests API"| node_web_app
node_web_app -->|"serves guide"| node_web_ui
node_web_app -->|"serves playback"| node_player_ui
node_web_app -->|"starts sync"| node_library_sync
node_library_sync -->|"fetches libraries"| node_plex_client
node_plex_client -->|"queries metadata"| node_plex_server
node_library_sync -->|"writes cache"| node_sqlite
node_web_app -->|"reads and writes"| node_sqlite
node_web_app -->|"requests schedule"| node_schedule_engine
node_schedule_engine -->|"uses configs"| node_channel_defs
node_schedule_engine -->|"reads content; writes EPG"| node_sqlite
node_web_app -->|"connects to Plex"| node_plex_client
node_web_app -->|"creates stream URL"| node_plex_server
node_player_ui -->|"plays HLS stream"| node_plex_server

click node_web_ui "https://github.com/nexusjuan12/nostalgiavision/blob/main/templates/index.html"
click node_player_ui "https://github.com/nexusjuan12/nostalgiavision/blob/main/templates/player.html"
click node_web_app "https://github.com/nexusjuan12/nostalgiavision/blob/main/app.py"
click node_library_sync "https://github.com/nexusjuan12/nostalgiavision/blob/main/library_sync.py"
click node_channel_defs "https://github.com/nexusjuan12/nostalgiavision/blob/main/channels.py"
click node_schedule_engine "https://github.com/nexusjuan12/nostalgiavision/blob/main/scheduler.py"
click node_plex_client "https://github.com/nexusjuan12/nostalgiavision/blob/main/plex_client.py"
click node_sqlite "https://github.com/nexusjuan12/nostalgiavision/blob/main/database.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_web_ui,node_player_ui,node_web_app,node_viewer toneBlue
class node_library_sync,node_channel_defs toneAmber
class node_schedule_engine,node_plex_server toneMint
class node_plex_client,node_sqlite toneRose
```

## Components

### Web experience

- [Guide and settings UI](https://github.com/nexusjuan12/nostalgiavision/blob/main/templates/index.html): `templates/index.html`
- [Playback UI](https://github.com/nexusjuan12/nostalgiavision/blob/main/templates/player.html): `templates/player.html`
- [Flask app and API](https://github.com/nexusjuan12/nostalgiavision/blob/main/app.py): `app.py`

### Library and channels

- [Library sync](https://github.com/nexusjuan12/nostalgiavision/blob/main/library_sync.py): `library_sync.py`
- [Channel definitions](https://github.com/nexusjuan12/nostalgiavision/blob/main/channels.py): `channels.py`

### Scheduling

- [Schedule generation](https://github.com/nexusjuan12/nostalgiavision/blob/main/scheduler.py): `scheduler.py`

### Persistence and Plex

- [Plex API client](https://github.com/nexusjuan12/nostalgiavision/blob/main/plex_client.py): `plex_client.py`
- [Content and EPG database](https://github.com/nexusjuan12/nostalgiavision/blob/main/database.py): `database.py`

### Other components

- **Viewer**
- **Plex Media Server**

## Connections

- Viewer → Guide and settings UI: uses
- Guide and settings UI → Flask app and API: requests API
- Flask app and API → Guide and settings UI: serves guide
- Flask app and API → Playback UI: serves playback
- Flask app and API → Library sync: starts sync
- Library sync → Plex API client: fetches libraries
- Plex API client → Plex Media Server: queries metadata
- Library sync → Content and EPG database: writes cache
- Flask app and API → Content and EPG database: reads and writes
- Flask app and API → Schedule generation: requests schedule
- Schedule generation → Channel definitions: uses configs
- Schedule generation → Content and EPG database: reads content; writes EPG
- Flask app and API → Plex API client: connects to Plex
- Flask app and API → Plex Media Server: creates stream URL
- Playback UI → Plex Media Server: plays HLS stream
