# ajgpw/siatube architecture

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

- Interactive diagram: https://gitdiagram.com/ajgpw/siatube
- Repository: https://github.com/ajgpw/siatube

## Overview

しあTube is a Vue client for browsing channels and videos, searching, watching streams, and managing playlists, subscriptions, history, and settings. The principal flow is user navigation into a routed view, retrieval through the SiaTube API and response adapters, then presentation; playback adds stream selection and player controls. The graph includes storage and guarded/proxied networking as internal layers. Edges are limited to relationships shown in excerpts, the SOURCE INDEX, or README; unsampled implementations are represented only where the index documents their role.

Main entry points: [`src/router/index.js`](https://github.com/ajgpw/siatube/blob/main/src/router/index.js) (Route table), [`src/services/api/siatubeApi.js`](https://github.com/ajgpw/siatube/blob/main/src/services/api/siatubeApi.js) (SiaTube API), [`src/views/ChannelView.vue`](https://github.com/ajgpw/siatube/blob/main/src/views/ChannelView.vue) (Channel page), [`src/views/VideoPlayer.vue`](https://github.com/ajgpw/siatube/blob/main/src/views/VideoPlayer.vue) (Video page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app_shell["App shell<br/>[App.vue]"]
  node_router["Route table<br/>[index.js]"]
end

subgraph group_browse["Discovery and channels"]
  node_home["Home feed<br/>[HomeView.vue]"]
  node_search["Search results<br/>[SearchView.vue]"]
  node_search_helper["Search suggestions<br/>[searchManager.js]"]
  node_channel["Channel page<br/>[ChannelView.vue]"]
  node_channel_cards["Channel content cards"]
end

subgraph group_watch["Video playback"]
  node_video_page["Video page<br/>[VideoPlayer.vue]"]
  node_stream_player["Stream player<br/>[StreamPlayer.vue]"]
  node_stream_modes["Stream modes<br/>[StreamType2.vue]"]
  node_stream_parser["Stream parsing"]
  node_comments["Video comments<br/>[Comment.vue]"]
end

subgraph group_library["Personal library"]
  node_playlist_view["Playlist view<br/>[Playlist.vue]"]
  node_playlist_manager[("Saved playlists<br/>[playlistManager.js]")]
  node_playlists_page["Playlist library<br/>[PlaylistsView.vue]"]
  node_subscriptions["Subscriptions"]
  node_subscription_store[("Subscription store")]
  node_history["Watch history<br/>[HistoryView.vue]"]
  node_history_store[("History store<br/>[historyManager.js]")]
  node_settings_page["Settings page<br/>[SettingsView.vue]"]
  node_settings_store[("Settings store<br/>[settingsManager.js]")]
end

subgraph group_services["API and persistence"]
  node_api["SiaTube API<br/>[siatubeApi.js]"]
  node_adapters["Response adapters<br/>[siatubeAdapters.js]"]
  node_guard["Guard requests<br/>[guarded-request.js]"]
  node_proxy["Request proxy<br/>[requestProxy.js]"]
end

node_viewer(("Viewer"))
node_remote_api{{"SiaTube service"}}

node_viewer -->|"uses"| node_app_shell
node_app_shell -->|"mounts routes"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_search
node_router -->|"routes to"| node_channel
node_router -->|"routes to"| node_video_page
node_router -->|"routes to"| node_playlist_view
node_router -->|"routes to"| node_playlists_page
node_router -->|"routes to"| node_subscriptions
node_router -->|"routes to"| node_history
node_router -->|"routes to"| node_settings_page
node_search -->|"fetches results"| node_api
node_search -->|"normalizes results"| node_adapters
node_search -->|"loads suggestions"| node_search_helper
node_search_helper -->|"requests suggestions"| node_api
node_channel -->|"fetches channel data"| node_api
node_channel -->|"normalizes channel data"| node_adapters
node_channel -->|"renders cards"| node_channel_cards
node_channel -->|"manages subscription"| node_subscription_store
node_video_page -->|"fetches video"| node_api
node_video_page -->|"renders player"| node_stream_player
node_video_page -->|"renders comments"| node_comments
node_video_page -.->|"records history"| node_history_store
node_stream_player -.->|"selects mode"| node_stream_modes
node_stream_modes -->|"requests stream data"| node_api
node_stream_modes -->|"parses streams"| node_stream_parser
node_playlist_view -->|"fetches remote playlist"| node_api
node_playlist_view -->|"loads local playlist"| node_playlist_manager
node_playlists_page -.->|"manages playlists"| node_playlist_manager
node_subscriptions -.->|"reads subscriptions"| node_subscription_store
node_history -.->|"reads history"| node_history_store
node_settings_page -->|"reads and saves"| node_settings_store
node_api -->|"guards requests"| node_guard
node_api -->|"proxies requests"| node_proxy
node_api -.->|"sends requests"| node_remote_api

click node_app_shell "https://github.com/ajgpw/siatube/blob/main/src/App.vue"
click node_router "https://github.com/ajgpw/siatube/blob/main/src/router/index.js"
click node_home "https://github.com/ajgpw/siatube/blob/main/src/views/HomeView.vue"
click node_search "https://github.com/ajgpw/siatube/blob/main/src/views/SearchView.vue"
click node_search_helper "https://github.com/ajgpw/siatube/blob/main/src/utils/searchManager.js"
click node_channel "https://github.com/ajgpw/siatube/blob/main/src/views/ChannelView.vue"
click node_channel_cards "https://github.com/ajgpw/siatube/blob/main/src/components/channel/ChannelContentCard.vue"
click node_video_page "https://github.com/ajgpw/siatube/blob/main/src/views/VideoPlayer.vue"
click node_stream_player "https://github.com/ajgpw/siatube/blob/main/src/components/player/StreamPlayer.vue"
click node_stream_modes "https://github.com/ajgpw/siatube/blob/main/src/components/player/StreamType2.vue"
click node_stream_parser "https://github.com/ajgpw/siatube/blob/main/src/utils/player/type2StreamParser.js"
click node_comments "https://github.com/ajgpw/siatube/blob/main/src/components/video/Comment.vue"
click node_playlist_view "https://github.com/ajgpw/siatube/blob/main/src/components/playlist/Playlist.vue"
click node_playlist_manager "https://github.com/ajgpw/siatube/blob/main/src/services/storage/playlistManager.js"
click node_playlists_page "https://github.com/ajgpw/siatube/blob/main/src/views/PlaylistsView.vue"
click node_subscriptions "https://github.com/ajgpw/siatube/blob/main/src/views/SubscriptionsView.vue"
click node_subscription_store "https://github.com/ajgpw/siatube/blob/main/src/services/storage/subscriptionManager.js"
click node_history "https://github.com/ajgpw/siatube/blob/main/src/views/HistoryView.vue"
click node_history_store "https://github.com/ajgpw/siatube/blob/main/src/services/storage/historyManager.js"
click node_settings_page "https://github.com/ajgpw/siatube/blob/main/src/views/SettingsView.vue"
click node_settings_store "https://github.com/ajgpw/siatube/blob/main/src/services/storage/settingsManager.js"
click node_api "https://github.com/ajgpw/siatube/blob/main/src/services/api/siatubeApi.js"
click node_adapters "https://github.com/ajgpw/siatube/blob/main/src/services/api/siatubeAdapters.js"
click node_guard "https://github.com/ajgpw/siatube/blob/main/src/services/guard/guarded-request.js"
click node_proxy "https://github.com/ajgpw/siatube/blob/main/src/services/network/requestProxy.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_shell,node_router,node_viewer toneBlue
class node_home,node_search,node_search_helper,node_channel,node_channel_cards toneAmber
class node_video_page,node_stream_player,node_stream_modes,node_stream_parser,node_comments toneMint
class node_playlist_view,node_playlist_manager,node_playlists_page,node_subscriptions,node_subscription_store,node_history,node_history_store,node_settings_page,node_settings_store toneRose
class node_api,node_adapters,node_guard,node_proxy,node_remote_api toneIndigo
```

## Components

### Application shell

- [App shell](https://github.com/ajgpw/siatube/blob/main/src/App.vue): `src/App.vue`
- [Route table](https://github.com/ajgpw/siatube/blob/main/src/router/index.js): `src/router/index.js`

### Discovery and channels

- [Home feed](https://github.com/ajgpw/siatube/blob/main/src/views/HomeView.vue): `src/views/HomeView.vue`
- [Search results](https://github.com/ajgpw/siatube/blob/main/src/views/SearchView.vue): `src/views/SearchView.vue`
- [Search suggestions](https://github.com/ajgpw/siatube/blob/main/src/utils/searchManager.js): `src/utils/searchManager.js`
- [Channel page](https://github.com/ajgpw/siatube/blob/main/src/views/ChannelView.vue): `src/views/ChannelView.vue`
- [Channel content cards](https://github.com/ajgpw/siatube/blob/main/src/components/channel/ChannelContentCard.vue): `src/components/channel/ChannelContentCard.vue`

### Video playback

- [Video page](https://github.com/ajgpw/siatube/blob/main/src/views/VideoPlayer.vue): `src/views/VideoPlayer.vue`
- [Stream player](https://github.com/ajgpw/siatube/blob/main/src/components/player/StreamPlayer.vue): `src/components/player/StreamPlayer.vue`
- [Stream modes](https://github.com/ajgpw/siatube/blob/main/src/components/player/StreamType2.vue): `src/components/player/StreamType2.vue`
- [Stream parsing](https://github.com/ajgpw/siatube/blob/main/src/utils/player/type2StreamParser.js): `src/utils/player/type2StreamParser.js`
- [Video comments](https://github.com/ajgpw/siatube/blob/main/src/components/video/Comment.vue): `src/components/video/Comment.vue`

### Personal library

- [Playlist view](https://github.com/ajgpw/siatube/blob/main/src/components/playlist/Playlist.vue): `src/components/playlist/Playlist.vue`
- [Saved playlists](https://github.com/ajgpw/siatube/blob/main/src/services/storage/playlistManager.js): `src/services/storage/playlistManager.js`
- [Playlist library](https://github.com/ajgpw/siatube/blob/main/src/views/PlaylistsView.vue): `src/views/PlaylistsView.vue`
- [Subscriptions](https://github.com/ajgpw/siatube/blob/main/src/views/SubscriptionsView.vue): `src/views/SubscriptionsView.vue`
- [Subscription store](https://github.com/ajgpw/siatube/blob/main/src/services/storage/subscriptionManager.js): `src/services/storage/subscriptionManager.js`
- [Watch history](https://github.com/ajgpw/siatube/blob/main/src/views/HistoryView.vue): `src/views/HistoryView.vue`
- [History store](https://github.com/ajgpw/siatube/blob/main/src/services/storage/historyManager.js): `src/services/storage/historyManager.js`
- [Settings page](https://github.com/ajgpw/siatube/blob/main/src/views/SettingsView.vue): `src/views/SettingsView.vue`
- [Settings store](https://github.com/ajgpw/siatube/blob/main/src/services/storage/settingsManager.js): `src/services/storage/settingsManager.js`

### API and persistence

- [SiaTube API](https://github.com/ajgpw/siatube/blob/main/src/services/api/siatubeApi.js): `src/services/api/siatubeApi.js`
- [Response adapters](https://github.com/ajgpw/siatube/blob/main/src/services/api/siatubeAdapters.js): `src/services/api/siatubeAdapters.js`
- [Guard requests](https://github.com/ajgpw/siatube/blob/main/src/services/guard/guarded-request.js): `src/services/guard/guarded-request.js`
- [Request proxy](https://github.com/ajgpw/siatube/blob/main/src/services/network/requestProxy.js): `src/services/network/requestProxy.js`

### Other components

- **Viewer**
- **SiaTube service**

## Connections

- Viewer → App shell: uses
- App shell → Route table: mounts routes (evidence: `src/main.js`)
- Route table → Home feed: routes to (evidence: `src/router/index.js`)
- Route table → Search results: routes to (evidence: `src/router/index.js`)
- Route table → Channel page: routes to (evidence: `src/router/index.js`)
- Route table → Video page: routes to (evidence: `src/router/index.js`)
- Route table → Playlist view: routes to (evidence: `src/router/index.js`)
- Route table → Playlist library: routes to (evidence: `src/router/index.js`)
- Route table → Subscriptions: routes to (evidence: `src/router/index.js`)
- Route table → Watch history: routes to (evidence: `src/router/index.js`)
- Route table → Settings page: routes to (evidence: `src/router/index.js`)
- Search results → SiaTube API: fetches results (evidence: `src/views/SearchView.vue`)
- Search results → Response adapters: normalizes results (evidence: `src/views/SearchView.vue`)
- Search results → Search suggestions: loads suggestions
- Search suggestions → SiaTube API: requests suggestions (evidence: `src/utils/searchManager.js`)
- Channel page → SiaTube API: fetches channel data (evidence: `src/views/ChannelView.vue`)
- Channel page → Response adapters: normalizes channel data (evidence: `src/views/ChannelView.vue`)
- Channel page → Channel content cards: renders cards (evidence: `src/views/ChannelView.vue`)
- Channel page → Subscription store: manages subscription (evidence: `src/views/ChannelView.vue`)
- Video page → SiaTube API: fetches video (evidence: `src/views/VideoPlayer.vue`)
- Video page → Stream player: renders player (evidence: `src/views/VideoPlayer.vue`)
- Video page → Video comments: renders comments (evidence: `src/views/VideoPlayer.vue`)
- Video page → History store: records history (evidence: `src/views/VideoPlayer.vue`)
- Stream player → Stream modes: selects mode
- Stream modes → SiaTube API: requests stream data (evidence: `src/components/player/StreamType2.vue`)
- Stream modes → Stream parsing: parses streams (evidence: `src/components/player/StreamType2.vue`)
- Playlist view → SiaTube API: fetches remote playlist (evidence: `src/components/playlist/Playlist.vue`)
- Playlist view → Saved playlists: loads local playlist (evidence: `src/components/playlist/Playlist.vue`)
- Playlist library → Saved playlists: manages playlists
- Subscriptions → Subscription store: reads subscriptions
- Watch history → History store: reads history
- Settings page → Settings store: reads and saves (evidence: `src/views/SettingsView.vue`)
- SiaTube API → Guard requests: guards requests (evidence: `src/services/api/siatubeApi.js`)
- SiaTube API → Request proxy: proxies requests (evidence: `src/services/api/siatubeApi.js`)
- SiaTube API → SiaTube service: sends requests
