# truelockmc/streambert architecture

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

- Interactive diagram: https://gitdiagram.com/truelockmc/streambert
- Repository: https://github.com/truelockmc/streambert

## Overview

Streambert is an Electron desktop app for discovering, streaming, downloading, and managing movies, TV, and anime. The main user flow is setup with a TMDB token, discover or search for a title, open its detail view, then stream or download it; viewers can also manage subtitles and their library. The graph includes the Electron boundary and documented integrations. Some page-to-IPC wiring is unsampled, so uncertain call paths are omitted.

Main entry points: [`src/App.jsx`](https://github.com/truelockmc/streambert/blob/main/src/App.jsx) (App shell), [`index.js`](https://github.com/truelockmc/streambert/blob/main/index.js) (Electron main), [`src/pages/TVPage.jsx`](https://github.com/truelockmc/streambert/blob/main/src/pages/TVPage.jsx) (Series details), [`src/utils/api.js`](https://github.com/truelockmc/streambert/blob/main/src/utils/api.js) (Metadata API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App shell<br/>[App.jsx]"]
  node_setup["API setup<br/>[SetupScreen.jsx]"]
end

subgraph group_discovery["Discovery and metadata"]
  node_search["Search<br/>[SearchModal.jsx]"]
  node_home["Trending home<br/>[HomePage.jsx]"]
  node_movie["Movie details<br/>[MoviePage.jsx]"]
  node_tv["Series details<br/>[TVPage.jsx]"]
  node_metadata["Metadata API<br/>[api.js]"]
end

subgraph group_watch["Playback and downloads"]
  node_player["Player IPC<br/>[player.js]"]
  node_anime["Anime resolver<br/>[allmanga.js]"]
  node_downloads["Downloads<br/>[DownloadsPage.jsx]"]
  node_downloadipc["Download IPC<br/>[downloads.js]"]
  node_subtitles["Subtitle tools<br/>[subtitles.js]"]
  node_subipc["Subtitle IPC<br/>[subtitles.js]"]
end

subgraph group_personal["Library and preferences"]
  node_library["Watch library<br/>[LibraryPage.jsx]"]
  node_settings["Preferences<br/>[SettingsPage.jsx]"]
  node_webstorage[("Local storage<br/>[storage.js]")]
end

subgraph group_desktop["Electron services"]
  node_main["Electron main<br/>[index.js]"]
  node_preload["Preload bridge<br/>[preload.js]"]
  node_secure["Secure storage IPC<br/>[storage.js]"]
  node_blockstats["Block statistics<br/>[blockStats.js]"]
  node_discord["Discord presence<br/>[discordRpc.js]"]
end

node_user(("Viewer"))
node_anilist(("AniList"))
node_tmdb(("TMDB"))
node_allmanga(("AllManga"))
node_downloader(("vid-dl-cli"))
node_discordservice(("Discord"))

node_user -->|"opens"| node_app
node_app -->|"prompts setup"| node_setup
node_app -->|"shows home"| node_home
node_app -->|"opens search"| node_search
node_app -->|"navigates to"| node_movie
node_app -->|"navigates to"| node_tv
node_search -->|"searches"| node_metadata
node_home -->|"loads listings"| node_metadata
node_movie -->|"loads details"| node_metadata
node_tv -->|"loads details"| node_metadata
node_metadata -->|"fetches metadata"| node_tmdb
node_metadata -.->|"fetches anime metadata"| node_anilist
node_movie -->|"requests playback"| node_player
node_tv -->|"requests playback"| node_player
node_tv -.->|"resolves anime episodes"| node_anime
node_anime -.->|"resolves media"| node_allmanga
node_movie -->|"offers download"| node_downloads
node_tv -->|"offers download"| node_downloads
node_downloads -->|"manages downloads"| node_downloadipc
node_downloadipc -->|"dispatches download"| node_downloader
node_movie -->|"supports subtitles"| node_subtitles
node_tv -->|"supports subtitles"| node_subtitles
node_subtitles -->|"requests subtitle operations"| node_subipc
node_app -->|"navigates to"| node_library
node_app -->|"navigates to"| node_settings
node_settings -->|"reads and writes"| node_webstorage
node_library -->|"persists library data"| node_webstorage
node_main -->|"exposes bridge"| node_preload
node_preload -->|"provides IPC access"| node_app
node_main -->|"registers handlers"| node_anime
node_main -->|"registers handlers"| node_player
node_main -->|"registers handlers"| node_downloadipc
node_main -->|"registers handlers"| node_subipc
node_main -->|"registers handlers"| node_secure
node_main -->|"initializes"| node_blockstats
node_main -->|"registers handlers"| node_discord
node_discord -.->|"updates presence"| node_discordservice

click node_app "https://github.com/truelockmc/streambert/blob/main/src/App.jsx"
click node_setup "https://github.com/truelockmc/streambert/blob/main/src/components/SetupScreen.jsx"
click node_search "https://github.com/truelockmc/streambert/blob/main/src/components/SearchModal.jsx"
click node_home "https://github.com/truelockmc/streambert/blob/main/src/pages/HomePage.jsx"
click node_movie "https://github.com/truelockmc/streambert/blob/main/src/pages/MoviePage.jsx"
click node_tv "https://github.com/truelockmc/streambert/blob/main/src/pages/TVPage.jsx"
click node_metadata "https://github.com/truelockmc/streambert/blob/main/src/utils/api.js"
click node_player "https://github.com/truelockmc/streambert/blob/main/src/ipc/player.js"
click node_anime "https://github.com/truelockmc/streambert/blob/main/src/ipc/allmanga.js"
click node_downloads "https://github.com/truelockmc/streambert/blob/main/src/pages/DownloadsPage.jsx"
click node_downloadipc "https://github.com/truelockmc/streambert/blob/main/src/ipc/downloads.js"
click node_subtitles "https://github.com/truelockmc/streambert/blob/main/src/utils/subtitles.js"
click node_subipc "https://github.com/truelockmc/streambert/blob/main/src/ipc/subtitles.js"
click node_library "https://github.com/truelockmc/streambert/blob/main/src/pages/LibraryPage.jsx"
click node_settings "https://github.com/truelockmc/streambert/blob/main/src/pages/SettingsPage.jsx"
click node_webstorage "https://github.com/truelockmc/streambert/blob/main/src/utils/storage.js"
click node_main "https://github.com/truelockmc/streambert/blob/main/index.js"
click node_preload "https://github.com/truelockmc/streambert/blob/main/preload.js"
click node_secure "https://github.com/truelockmc/streambert/blob/main/src/ipc/storage.js"
click node_blockstats "https://github.com/truelockmc/streambert/blob/main/src/ipc/blockStats.js"
click node_discord "https://github.com/truelockmc/streambert/blob/main/src/ipc/discordRpc.js"

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_setup,node_user toneBlue
class node_search,node_home,node_movie,node_tv,node_metadata toneAmber
class node_player,node_anime,node_downloads,node_downloadipc,node_subtitles,node_subipc toneMint
class node_library,node_settings,node_webstorage toneRose
class node_main,node_preload,node_secure,node_blockstats,node_discord,node_anilist,node_tmdb,node_allmanga,node_downloader,node_discordservice toneIndigo
```

## Components

### App shell

- [App shell](https://github.com/truelockmc/streambert/blob/main/src/App.jsx): `src/App.jsx`
- [API setup](https://github.com/truelockmc/streambert/blob/main/src/components/SetupScreen.jsx): `src/components/SetupScreen.jsx`

### Discovery and metadata

- [Search](https://github.com/truelockmc/streambert/blob/main/src/components/SearchModal.jsx): `src/components/SearchModal.jsx`
- [Trending home](https://github.com/truelockmc/streambert/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Movie details](https://github.com/truelockmc/streambert/blob/main/src/pages/MoviePage.jsx): `src/pages/MoviePage.jsx`
- [Series details](https://github.com/truelockmc/streambert/blob/main/src/pages/TVPage.jsx): `src/pages/TVPage.jsx`
- [Metadata API](https://github.com/truelockmc/streambert/blob/main/src/utils/api.js): `src/utils/api.js`

### Playback and downloads

- [Player IPC](https://github.com/truelockmc/streambert/blob/main/src/ipc/player.js): `src/ipc/player.js`
- [Anime resolver](https://github.com/truelockmc/streambert/blob/main/src/ipc/allmanga.js): `src/ipc/allmanga.js`
- [Downloads](https://github.com/truelockmc/streambert/blob/main/src/pages/DownloadsPage.jsx): `src/pages/DownloadsPage.jsx`
- [Download IPC](https://github.com/truelockmc/streambert/blob/main/src/ipc/downloads.js): `src/ipc/downloads.js`
- [Subtitle tools](https://github.com/truelockmc/streambert/blob/main/src/utils/subtitles.js): `src/utils/subtitles.js`
- [Subtitle IPC](https://github.com/truelockmc/streambert/blob/main/src/ipc/subtitles.js): `src/ipc/subtitles.js`

### Library and preferences

- [Watch library](https://github.com/truelockmc/streambert/blob/main/src/pages/LibraryPage.jsx): `src/pages/LibraryPage.jsx`
- [Preferences](https://github.com/truelockmc/streambert/blob/main/src/pages/SettingsPage.jsx): `src/pages/SettingsPage.jsx`
- [Local storage](https://github.com/truelockmc/streambert/blob/main/src/utils/storage.js): `src/utils/storage.js`

### Electron services

- [Electron main](https://github.com/truelockmc/streambert/blob/main/index.js): `index.js`
- [Preload bridge](https://github.com/truelockmc/streambert/blob/main/preload.js): `preload.js`
- [Secure storage IPC](https://github.com/truelockmc/streambert/blob/main/src/ipc/storage.js): `src/ipc/storage.js`
- [Block statistics](https://github.com/truelockmc/streambert/blob/main/src/ipc/blockStats.js): `src/ipc/blockStats.js`
- [Discord presence](https://github.com/truelockmc/streambert/blob/main/src/ipc/discordRpc.js): `src/ipc/discordRpc.js`

### Other components

- **Viewer**
- **AniList**
- **TMDB**
- **AllManga**
- **vid-dl-cli**
- **Discord**

## Connections

- Viewer → App shell: opens
- App shell → API setup: prompts setup
- App shell → Trending home: shows home
- App shell → Search: opens search
- App shell → Movie details: navigates to
- App shell → Series details: navigates to
- Search → Metadata API: searches
- Trending home → Metadata API: loads listings
- Movie details → Metadata API: loads details
- Series details → Metadata API: loads details
- Metadata API → TMDB: fetches metadata
- Metadata API → AniList: fetches anime metadata
- Movie details → Player IPC: requests playback
- Series details → Player IPC: requests playback
- Series details → Anime resolver: resolves anime episodes
- Anime resolver → AllManga: resolves media
- Movie details → Downloads: offers download
- Series details → Downloads: offers download
- Downloads → Download IPC: manages downloads
- Download IPC → vid-dl-cli: dispatches download
- Movie details → Subtitle tools: supports subtitles
- Series details → Subtitle tools: supports subtitles
- Subtitle tools → Subtitle IPC: requests subtitle operations
- App shell → Watch library: navigates to
- App shell → Preferences: navigates to
- Preferences → Local storage: reads and writes
- Watch library → Local storage: persists library data
- Electron main → Preload bridge: exposes bridge
- Preload bridge → App shell: provides IPC access
- Electron main → Anime resolver: registers handlers
- Electron main → Player IPC: registers handlers
- Electron main → Download IPC: registers handlers
- Electron main → Subtitle IPC: registers handlers
- Electron main → Secure storage IPC: registers handlers
- Electron main → Block statistics: initializes
- Electron main → Discord presence: registers handlers
- Discord presence → Discord: updates presence
