# vega-org/vega-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/vega-org/vega-desktop
- Repository: https://github.com/vega-org/vega-desktop
- Video tour (about a minute): https://gitdiagram.com/vega-org/vega-desktop/video

## Overview

Vega Desktop is a Tauri/React media-streaming app where users discover content through configurable third-party providers, then stream or download it, with playback controls, lists, and cross-device sync. The graph preserves those documented product areas and the sampled player, provider, proxy, and sync behavior. Some page-to-service wiring is unsampled, so uncertain connections are omitted; the README documents the product capabilities, not their internal call paths.

Main entry points: [`src/App.tsx`](https://github.com/vega-org/vega-desktop/blob/main/src/App.tsx) (App Router), [`src/lib/services/ProviderManager.ts`](https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/ProviderManager.ts) (Provider Manager), [`src-tauri/src/lib.rs`](https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/lib.rs) (Tauri Runtime), [`src/lib/player/HtmlVideoEngine.ts`](https://github.com/vega-org/vega-desktop/blob/main/src/lib/player/HtmlVideoEngine.ts) (HTML Video Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["App and Discovery"]
  node_app["App Router<br/>[App.tsx]"]
  node_search["Search<br/>[SearchPage.tsx]"]
  node_catalog["Catalog<br/>[CatalogPage.tsx]"]
  node_content["Content Details<br/>[MetaPage.tsx]"]
end

subgraph group_providers["Provider Sources"]
  node_provider_manager["Provider Manager<br/>[ProviderManager.ts]"]
  node_extension_manager["Extension Manager"]
  node_provider_storage["Provider Registry"]
  node_waf["Provider WebView<br/>[waf.ts]"]
end

subgraph group_media["Playback and Downloads"]
  node_player_page["Player Page<br/>[PlayerPage.tsx]"]
  node_player_hook["Player Controls<br/>[usePlayerEngine.ts]"]
  node_html_engine["HTML Video Engine<br/>[HtmlVideoEngine.ts]"]
  node_player_contract["Player Engine Contract<br/>[PlayerEngine.ts]"]
  node_torrent_service["Torrent Streaming"]
  node_downloads["Download Manager"]
  node_download_pages["Download Library<br/>[DownloadsPage.tsx]"]
end

subgraph group_native["Desktop Services"]
  node_native_app["Tauri Runtime<br/>[lib.rs]"]
  node_proxy["Proxy Manager<br/>[proxy_manager.rs]"]
end

subgraph group_state_sync["State and Sync"]
  node_watchlist["Watchlist<br/>[WatchlistPage.tsx]"]
  node_watchlist_store["Watchlist State<br/>[watchListStore.ts]"]
  node_settings["Settings Storage<br/>[SettingsStorage.ts]"]
  node_sync["Shared-Folder Sync<br/>[syncService.ts]"]
  node_sync_manifest["Desktop Manifests"]
  node_local_storage[("Local Storage<br/>[storage.ts]")]
end

node_user(("User"))
node_provider_sources(("Provider Services"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_content
node_search -->|"requests provider data"| node_provider_manager
node_catalog -->|"requests catalog"| node_provider_manager
node_content -->|"requests metadata"| node_provider_manager
node_provider_manager -->|"loads modules"| node_extension_manager
node_extension_manager -->|"reads registry"| node_provider_storage
node_provider_manager -->|"fetches provider data"| node_provider_sources
node_provider_manager -->|"opens provider page"| node_waf
node_user -->|"starts playback"| node_player_page
node_player_page -->|"controls playback"| node_player_hook
node_player_hook -->|"delegates playback"| node_html_engine
node_html_engine -->|"resolves torrent"| node_torrent_service
node_html_engine -->|"implements"| node_player_contract
node_user -->|"manages downloads"| node_download_pages
node_download_pages -->|"downloads media"| node_downloads
node_app -->|"invokes commands"| node_native_app
node_settings -->|"syncs DoH setting"| node_native_app
node_proxy -->|"serves native proxy commands"| node_native_app
node_user -->|"manages list"| node_watchlist
node_watchlist -->|"updates state"| node_watchlist_store
node_settings -->|"reads and writes"| node_local_storage
node_watchlist_store -->|"persists state"| node_local_storage
node_app -->|"starts periodic sync"| node_sync
node_sync -->|"reads and writes manifests"| node_sync_manifest
node_sync_manifest -->|"resolves local media"| node_native_app

click node_app "https://github.com/vega-org/vega-desktop/blob/main/src/App.tsx"
click node_search "https://github.com/vega-org/vega-desktop/blob/main/src/pages/SearchPage.tsx"
click node_catalog "https://github.com/vega-org/vega-desktop/blob/main/src/pages/CatalogPage.tsx"
click node_content "https://github.com/vega-org/vega-desktop/blob/main/src/pages/MetaPage.tsx"
click node_provider_manager "https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/ProviderManager.ts"
click node_extension_manager "https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/ExtensionManager.ts"
click node_provider_storage "https://github.com/vega-org/vega-desktop/blob/main/src/lib/storage/extensionStorage.ts"
click node_waf "https://github.com/vega-org/vega-desktop/blob/main/src/platform/waf.ts"
click node_player_page "https://github.com/vega-org/vega-desktop/blob/main/src/pages/PlayerPage.tsx"
click node_player_hook "https://github.com/vega-org/vega-desktop/blob/main/src/lib/hooks/usePlayerEngine.ts"
click node_html_engine "https://github.com/vega-org/vega-desktop/blob/main/src/lib/player/HtmlVideoEngine.ts"
click node_player_contract "https://github.com/vega-org/vega-desktop/blob/main/src/lib/player/PlayerEngine.ts"
click node_torrent_service "https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/torrentStreamService.ts"
click node_downloads "https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/download_manager.rs"
click node_download_pages "https://github.com/vega-org/vega-desktop/blob/main/src/pages/DownloadsPage.tsx"
click node_native_app "https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/lib.rs"
click node_proxy "https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/proxy_manager.rs"
click node_watchlist "https://github.com/vega-org/vega-desktop/blob/main/src/pages/WatchlistPage.tsx"
click node_watchlist_store "https://github.com/vega-org/vega-desktop/blob/main/src/lib/zustand/watchListStore.ts"
click node_settings "https://github.com/vega-org/vega-desktop/blob/main/src/lib/storage/SettingsStorage.ts"
click node_sync "https://github.com/vega-org/vega-desktop/blob/main/src/lib/sync/syncService.ts"
click node_sync_manifest "https://github.com/vega-org/vega-desktop/blob/main/src/lib/sync/desktopManifestStorage.ts"
click node_local_storage "https://github.com/vega-org/vega-desktop/blob/main/src/platform/storage.ts"

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_search,node_catalog,node_content,node_user toneBlue
class node_provider_manager,node_extension_manager,node_provider_storage,node_waf toneAmber
class node_player_page,node_player_hook,node_html_engine,node_player_contract,node_torrent_service,node_downloads,node_download_pages toneMint
class node_native_app,node_proxy toneRose
class node_watchlist,node_watchlist_store,node_settings,node_sync,node_sync_manifest,node_local_storage,node_provider_sources toneIndigo
```

## Components

### App and Discovery

- [App Router](https://github.com/vega-org/vega-desktop/blob/main/src/App.tsx): `src/App.tsx`
- [Search](https://github.com/vega-org/vega-desktop/blob/main/src/pages/SearchPage.tsx): `src/pages/SearchPage.tsx`
- [Catalog](https://github.com/vega-org/vega-desktop/blob/main/src/pages/CatalogPage.tsx): `src/pages/CatalogPage.tsx`
- [Content Details](https://github.com/vega-org/vega-desktop/blob/main/src/pages/MetaPage.tsx): `src/pages/MetaPage.tsx`

### Provider Sources

- [Provider Manager](https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/ProviderManager.ts): `src/lib/services/ProviderManager.ts`
- [Extension Manager](https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/ExtensionManager.ts): `src/lib/services/ExtensionManager.ts`
- [Provider Registry](https://github.com/vega-org/vega-desktop/blob/main/src/lib/storage/extensionStorage.ts): `src/lib/storage/extensionStorage.ts`
- [Provider WebView](https://github.com/vega-org/vega-desktop/blob/main/src/platform/waf.ts): `src/platform/waf.ts`

### Playback and Downloads

- [Player Page](https://github.com/vega-org/vega-desktop/blob/main/src/pages/PlayerPage.tsx): `src/pages/PlayerPage.tsx`
- [Player Controls](https://github.com/vega-org/vega-desktop/blob/main/src/lib/hooks/usePlayerEngine.ts): `src/lib/hooks/usePlayerEngine.ts`
- [HTML Video Engine](https://github.com/vega-org/vega-desktop/blob/main/src/lib/player/HtmlVideoEngine.ts): `src/lib/player/HtmlVideoEngine.ts`
- [Player Engine Contract](https://github.com/vega-org/vega-desktop/blob/main/src/lib/player/PlayerEngine.ts): `src/lib/player/PlayerEngine.ts`
- [Torrent Streaming](https://github.com/vega-org/vega-desktop/blob/main/src/lib/services/torrentStreamService.ts): `src/lib/services/torrentStreamService.ts`
- [Download Manager](https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/download_manager.rs): `src-tauri/src/download_manager.rs`
- [Download Library](https://github.com/vega-org/vega-desktop/blob/main/src/pages/DownloadsPage.tsx): `src/pages/DownloadsPage.tsx`

### Desktop Services

- [Tauri Runtime](https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Proxy Manager](https://github.com/vega-org/vega-desktop/blob/main/src-tauri/src/proxy_manager.rs): `src-tauri/src/proxy_manager.rs`

### State and Sync

- [Watchlist](https://github.com/vega-org/vega-desktop/blob/main/src/pages/WatchlistPage.tsx): `src/pages/WatchlistPage.tsx`
- [Watchlist State](https://github.com/vega-org/vega-desktop/blob/main/src/lib/zustand/watchListStore.ts): `src/lib/zustand/watchListStore.ts`
- [Settings Storage](https://github.com/vega-org/vega-desktop/blob/main/src/lib/storage/SettingsStorage.ts): `src/lib/storage/SettingsStorage.ts`
- [Shared-Folder Sync](https://github.com/vega-org/vega-desktop/blob/main/src/lib/sync/syncService.ts): `src/lib/sync/syncService.ts`
- [Desktop Manifests](https://github.com/vega-org/vega-desktop/blob/main/src/lib/sync/desktopManifestStorage.ts): `src/lib/sync/desktopManifestStorage.ts`
- [Local Storage](https://github.com/vega-org/vega-desktop/blob/main/src/platform/storage.ts): `src/platform/storage.ts`

### Other components

- **User**
- **Provider Services**

## Connections

- User → App Router: opens
- App Router → Search: routes to
- App Router → Catalog: routes to
- App Router → Content Details: routes to
- Search → Provider Manager: requests provider data
- Catalog → Provider Manager: requests catalog
- Content Details → Provider Manager: requests metadata
- Provider Manager → Extension Manager: loads modules
- Extension Manager → Provider Registry: reads registry
- Provider Manager → Provider Services: fetches provider data
- Provider Manager → Provider WebView: opens provider page
- User → Player Page: starts playback
- Player Page → Player Controls: controls playback
- Player Controls → HTML Video Engine: delegates playback
- HTML Video Engine → Torrent Streaming: resolves torrent
- HTML Video Engine → Player Engine Contract: implements
- User → Download Library: manages downloads
- Download Library → Download Manager: downloads media
- App Router → Tauri Runtime: invokes commands
- Settings Storage → Tauri Runtime: syncs DoH setting
- Proxy Manager → Tauri Runtime: serves native proxy commands
- User → Watchlist: manages list
- Watchlist → Watchlist State: updates state
- Settings Storage → Local Storage: reads and writes
- Watchlist State → Local Storage: persists state
- App Router → Shared-Folder Sync: starts periodic sync
- Shared-Folder Sync → Desktop Manifests: reads and writes manifests
- Desktop Manifests → Tauri Runtime: resolves local media
