# blackdeath-s/harbor architecture

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

- Interactive diagram: https://gitdiagram.com/blackdeath-s/harbor
- Repository: https://github.com/blackdeath-s/harbor

## Overview

Harbor is a Tauri/React desktop client for the Stremio addon ecosystem, with a native media player and discovery features. Its main workflow is browsing content, resolving addon or library streams, filtering and ranking candidates, then playing a selected stream. The sampled code supports the stream-picker-to-ranking flow and local torrent-engine bridge; other branches reflect README capabilities and tree paths, but their internal wiring was not sampled.

Main entry points: [`src/App.tsx`](https://github.com/blackdeath-s/harbor/blob/main/src/App.tsx) (Harbor app), [`src/views/play-picker/use-pipeline-result.ts`](https://github.com/blackdeath-s/harbor/blob/main/src/views/play-picker/use-pipeline-result.ts) (Stream picker), [`src/lib/streams/pipeline.ts`](https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts) (Stream pipeline), [`src-tauri/src/mpv.rs`](https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/mpv.rs) (Native player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and catalog"]
  node_app["Harbor app<br/>[App.tsx]"]
  node_catalog["Catalog browsing<br/>[catalog-browse.ts]"]
  node_feed["Discovery feed<br/>[index.ts]"]
  node_anime["Anime features<br/>[anime-detect.ts]"]
end

subgraph group_streaming["Stream resolution"]
  node_addons["Addon store<br/>[store.ts]"]
  node_picker["Stream picker"]
  node_input["Episode request"]
  node_pipeline["Stream pipeline<br/>[pipeline.ts]"]
  node_ranking["Trust and ranking<br/>[lib.rs]"]
  node_addonstreams["Addon streams<br/>[pipeline.ts]"]
  node_localstreams["Library streams<br/>[pipeline.ts]"]
end

subgraph group_playback["Playback and engines"]
  node_player["Native player<br/>[mpv.rs]"]
  node_torrent["Torrent engine<br/>[torrent_engine.rs]"]
  node_enginebridge["Engine bridge<br/>[local-engine.ts]"]
  node_cast["Casting<br/>[cast.rs]"]
end

subgraph group_live["Live and social"]
  node_iptv["Live TV and DVR<br/>[store.ts]"]
  node_party["Watch parties<br/>[together-modal.tsx]"]
end

subgraph group_personalize["Extensions and personalization"]
  node_themes["Themes and layouts<br/>[custom-themes.ts]"]
  node_integrations["Tracking integrations<br/>[sync.ts]"]
end

node_viewer(("Viewer"))
node_stremio(("Stremio ecosystem"))

node_viewer -->|"uses"| node_app
node_app -->|"browses"| node_catalog
node_app -->|"shows"| node_feed
node_app -->|"manages"| node_addons
node_viewer -->|"selects title"| node_picker
node_picker -->|"builds request"| node_input
node_picker -->|"runs"| node_pipeline
node_pipeline -->|"fetches"| node_addonstreams
node_pipeline -->|"fetches"| node_localstreams
node_pipeline -->|"filters and scores"| node_ranking
node_stremio -->|"provides addons"| node_addons
node_picker -->|"plays selection"| node_player
node_player -->|"requests torrent stream"| node_enginebridge
node_enginebridge -->|"invokes commands"| node_torrent
node_viewer -->|"watches live"| node_iptv
node_viewer -->|"starts party"| node_party
node_viewer -->|"explores anime"| node_anime
node_viewer -->|"customizes"| node_themes
node_viewer -.->|"syncs lists"| node_integrations
node_viewer -.->|"casts playback"| node_cast

click node_app "https://github.com/blackdeath-s/harbor/blob/main/src/App.tsx"
click node_catalog "https://github.com/blackdeath-s/harbor/blob/main/src/lib/catalog-browse.ts"
click node_feed "https://github.com/blackdeath-s/harbor/blob/main/src/lib/feed/index.ts"
click node_addons "https://github.com/blackdeath-s/harbor/blob/main/src/lib/addons-store/store.ts"
click node_picker "https://github.com/blackdeath-s/harbor/blob/main/src/views/play-picker/use-pipeline-result.ts"
click node_input "https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/episode-pipeline-input.ts"
click node_pipeline "https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts"
click node_ranking "https://github.com/blackdeath-s/harbor/blob/main/harbor-core/src/lib.rs"
click node_addonstreams "https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts"
click node_localstreams "https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts"
click node_player "https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/mpv.rs"
click node_torrent "https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/torrent_engine.rs"
click node_enginebridge "https://github.com/blackdeath-s/harbor/blob/main/src/lib/torrent/local-engine.ts"
click node_iptv "https://github.com/blackdeath-s/harbor/blob/main/src/lib/iptv/store.ts"
click node_party "https://github.com/blackdeath-s/harbor/blob/main/src/components/together-modal.tsx"
click node_anime "https://github.com/blackdeath-s/harbor/blob/main/src/lib/anime-detect.ts"
click node_themes "https://github.com/blackdeath-s/harbor/blob/main/src/lib/custom-themes.ts"
click node_integrations "https://github.com/blackdeath-s/harbor/blob/main/src/lib/anilist/sync.ts"
click node_cast "https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/cast.rs"

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_catalog,node_feed,node_anime,node_viewer toneBlue
class node_addons,node_picker,node_input,node_pipeline,node_ranking,node_addonstreams,node_localstreams toneAmber
class node_player,node_torrent,node_enginebridge,node_cast toneMint
class node_iptv,node_party toneRose
class node_themes,node_integrations,node_stremio toneIndigo
```

## Components

### Discovery and catalog

- [Harbor app](https://github.com/blackdeath-s/harbor/blob/main/src/App.tsx): `src/App.tsx`
- [Catalog browsing](https://github.com/blackdeath-s/harbor/blob/main/src/lib/catalog-browse.ts): `src/lib/catalog-browse.ts`
- [Discovery feed](https://github.com/blackdeath-s/harbor/blob/main/src/lib/feed/index.ts): `src/lib/feed/index.ts`
- [Anime features](https://github.com/blackdeath-s/harbor/blob/main/src/lib/anime-detect.ts): `src/lib/anime-detect.ts`

### Stream resolution

- [Addon store](https://github.com/blackdeath-s/harbor/blob/main/src/lib/addons-store/store.ts): `src/lib/addons-store/store.ts`
- [Stream picker](https://github.com/blackdeath-s/harbor/blob/main/src/views/play-picker/use-pipeline-result.ts): `src/views/play-picker/use-pipeline-result.ts`
- [Episode request](https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/episode-pipeline-input.ts): `src/lib/streams/episode-pipeline-input.ts`
- [Stream pipeline](https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts): `src/lib/streams/pipeline.ts`
- [Trust and ranking](https://github.com/blackdeath-s/harbor/blob/main/harbor-core/src/lib.rs): `harbor-core/src/lib.rs`
- [Addon streams](https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts): `src/lib/streams/pipeline.ts`
- [Library streams](https://github.com/blackdeath-s/harbor/blob/main/src/lib/streams/pipeline.ts): `src/lib/streams/pipeline.ts`

### Playback and engines

- [Native player](https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/mpv.rs): `src-tauri/src/mpv.rs`
- [Torrent engine](https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/torrent_engine.rs): `src-tauri/src/torrent_engine.rs`
- [Engine bridge](https://github.com/blackdeath-s/harbor/blob/main/src/lib/torrent/local-engine.ts): `src/lib/torrent/local-engine.ts`
- [Casting](https://github.com/blackdeath-s/harbor/blob/main/src-tauri/src/cast.rs): `src-tauri/src/cast.rs`

### Live and social

- [Live TV and DVR](https://github.com/blackdeath-s/harbor/blob/main/src/lib/iptv/store.ts): `src/lib/iptv/store.ts`
- [Watch parties](https://github.com/blackdeath-s/harbor/blob/main/src/components/together-modal.tsx): `src/components/together-modal.tsx`

### Extensions and personalization

- [Themes and layouts](https://github.com/blackdeath-s/harbor/blob/main/src/lib/custom-themes.ts): `src/lib/custom-themes.ts`
- [Tracking integrations](https://github.com/blackdeath-s/harbor/blob/main/src/lib/anilist/sync.ts): `src/lib/anilist/sync.ts`

### Other components

- **Viewer**
- **Stremio ecosystem**

## Connections

- Viewer → Harbor app: uses
- Harbor app → Catalog browsing: browses
- Harbor app → Discovery feed: shows
- Harbor app → Addon store: manages
- Viewer → Stream picker: selects title
- Stream picker → Episode request: builds request
- Stream picker → Stream pipeline: runs
- Stream pipeline → Addon streams: fetches
- Stream pipeline → Library streams: fetches
- Stream pipeline → Trust and ranking: filters and scores
- Stremio ecosystem → Addon store: provides addons
- Stream picker → Native player: plays selection
- Native player → Engine bridge: requests torrent stream
- Engine bridge → Torrent engine: invokes commands
- Viewer → Live TV and DVR: watches live
- Viewer → Watch parties: starts party
- Viewer → Anime features: explores anime
- Viewer → Themes and layouts: customizes
- Viewer → Tracking integrations: syncs lists
- Viewer → Casting: casts playback
