# vinitsingh665/shiru architecture

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

- Interactive diagram: https://gitdiagram.com/vinitsingh665/shiru
- Repository: https://github.com/vinitsingh665/shiru

## Overview

Shiru is a cross-platform personal anime library manager. The principal workflow is to browse or search a library, select an episode or file, resolve its anime/episode identity, and play it while tracking progress. Its surrounding capabilities include list-provider sync, release schedules and notifications, subtitles, optional extensions, torrent streaming, profiles, and watch-together. The graph uses README capabilities where source excerpts were unavailable; those branches show documented subsystem boundaries, not unverified call sequences.

Main entry points: [`common/components/MediaHandler.svelte`](https://github.com/vinitsingh665/shiru/blob/master/common/components/MediaHandler.svelte) (Media resolver), [`common/modules/anime/anime.js`](https://github.com/vinitsingh665/shiru/blob/master/common/modules/anime/anime.js) (Anime metadata), [`common/routes/Router.svelte`](https://github.com/vinitsingh665/shiru/blob/master/common/routes/Router.svelte) (Route selection), [`common/modules/notification/manager.js`](https://github.com/vinitsingh665/shiru/blob/master/common/modules/notification/manager.js) (Release alerts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_app["App shell<br/>[App.svelte]"]
  node_router["Route selection<br/>[Router.svelte]"]
end

subgraph group_anime["Anime Discovery"]
  node_home["Home library<br/>[HomePage.svelte]"]
  node_search["Anime search<br/>[SearchPage.svelte]"]
  node_schedule["Release schedule"]
  node_anime_data["Anime metadata<br/>[anime.js]"]
end

subgraph group_playback["Playback"]
  node_media_handler["Media resolver"]
  node_player["Video player<br/>[PlayerPage.svelte]"]
  node_torrent["Torrent client<br/>[webtorrent.js]"]
  node_subtitles["Subtitle handling<br/>[subtitles.js]"]
  node_file_manager["File manager"]
  node_extensions["Extension manager<br/>[manager.js]"]
  node_extension_worker["Extension workers<br/>[worker.js]"]
end

subgraph group_services["Tracking Services"]
  node_notifications["Release alerts<br/>[manager.js]"]
  node_provider_anilist["AniList sync<br/>[anilist.js]"]
  node_provider_mal["MyAnimeList sync<br/>[myanimelist.js]"]
  node_profiles["Profiles"]
  node_watch_together["Watch together"]
  node_cache[("Local cache<br/>[cache.js]")]
end

subgraph group_platform["Platform Runtime"]
  node_electron["Desktop runtime<br/>[app.js]"]
  node_android["Android runtime<br/>[app.js]"]
end

node_user(("Viewer"))
node_anilist_service(("AniList"))
node_mal_service(("MyAnimeList"))
node_media_files[("Local media")]
node_extension_sources(("Optional sources"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_search
node_router -->|"routes to"| node_schedule
node_router -->|"hosts"| node_media_handler
node_home -->|"loads metadata"| node_anime_data
node_search -->|"searches metadata"| node_anime_data
node_schedule -->|"uses schedule data"| node_anime_data
node_media_handler -->|"resolves episodes"| node_anime_data
node_media_handler -->|"starts playback"| node_player
node_media_handler -->|"streams files"| node_torrent
node_media_handler -.->|"requests sources"| node_extensions
node_extensions -.->|"dispatches work"| node_extension_worker
node_extension_worker -.->|"fetches from"| node_extension_sources
node_media_handler -->|"plays local files"| node_media_files
node_player -->|"loads tracks"| node_subtitles
node_media_handler -->|"opens file tools"| node_file_manager
node_anime_data -->|"uses provider"| node_provider_anilist
node_provider_anilist -->|"syncs lists"| node_anilist_service
node_provider_mal -->|"syncs lists"| node_mal_service
node_app -->|"supports list sync"| node_provider_mal
node_anime_data -->|"supports provider"| node_provider_mal
node_notifications -->|"persists alerts"| node_cache
node_notifications -->|"updates badge"| node_electron
node_notifications -->|"dispatches alerts"| node_android
node_profiles -->|"uses local state"| node_cache
node_watch_together -->|"coordinates playback"| node_media_handler
node_electron -->|"hosts client"| node_torrent
node_android -->|"bridges client"| node_torrent

click node_app "https://github.com/vinitsingh665/shiru/blob/master/common/App.svelte"
click node_router "https://github.com/vinitsingh665/shiru/blob/master/common/routes/Router.svelte"
click node_home "https://github.com/vinitsingh665/shiru/blob/master/common/routes/home/HomePage.svelte"
click node_search "https://github.com/vinitsingh665/shiru/blob/master/common/routes/search/SearchPage.svelte"
click node_schedule "https://github.com/vinitsingh665/shiru/blob/master/common/routes/SchedulePage.svelte"
click node_anime_data "https://github.com/vinitsingh665/shiru/blob/master/common/modules/anime/anime.js"
click node_media_handler "https://github.com/vinitsingh665/shiru/blob/master/common/components/MediaHandler.svelte"
click node_player "https://github.com/vinitsingh665/shiru/blob/master/common/routes/player/PlayerPage.svelte"
click node_torrent "https://github.com/vinitsingh665/shiru/blob/master/client/core/webtorrent.js"
click node_subtitles "https://github.com/vinitsingh665/shiru/blob/master/common/modules/subtitles.js"
click node_file_manager "https://github.com/vinitsingh665/shiru/blob/master/common/modals/manager/ManagerModal.svelte"
click node_extensions "https://github.com/vinitsingh665/shiru/blob/master/common/modules/extensions/manager.js"
click node_extension_worker "https://github.com/vinitsingh665/shiru/blob/master/common/modules/extensions/worker.js"
click node_notifications "https://github.com/vinitsingh665/shiru/blob/master/common/modules/notification/manager.js"
click node_provider_anilist "https://github.com/vinitsingh665/shiru/blob/master/common/modules/providers/anilist/anilist.js"
click node_provider_mal "https://github.com/vinitsingh665/shiru/blob/master/common/modules/providers/myanimelist/myanimelist.js"
click node_profiles "https://github.com/vinitsingh665/shiru/blob/master/common/modals/ProfilesModal.svelte"
click node_watch_together "https://github.com/vinitsingh665/shiru/blob/master/common/routes/w2g/WatchTogetherPage.svelte"
click node_cache "https://github.com/vinitsingh665/shiru/blob/master/common/modules/cache.js"
click node_electron "https://github.com/vinitsingh665/shiru/blob/master/electron/src/main/app.js"
click node_android "https://github.com/vinitsingh665/shiru/blob/master/capacitor/src/main/app.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_router,node_user toneBlue
class node_home,node_search,node_schedule,node_anime_data,node_media_files toneAmber
class node_media_handler,node_player,node_torrent,node_subtitles,node_file_manager,node_extensions,node_extension_worker toneMint
class node_notifications,node_provider_anilist,node_provider_mal,node_profiles,node_watch_together,node_cache toneRose
class node_electron,node_android,node_anilist_service,node_mal_service,node_extension_sources toneIndigo
```

## Components

### Application UI

- [App shell](https://github.com/vinitsingh665/shiru/blob/master/common/App.svelte): `common/App.svelte`
- [Route selection](https://github.com/vinitsingh665/shiru/blob/master/common/routes/Router.svelte): `common/routes/Router.svelte`

### Anime Discovery

- [Home library](https://github.com/vinitsingh665/shiru/blob/master/common/routes/home/HomePage.svelte): `common/routes/home/HomePage.svelte`
- [Anime search](https://github.com/vinitsingh665/shiru/blob/master/common/routes/search/SearchPage.svelte): `common/routes/search/SearchPage.svelte`
- [Release schedule](https://github.com/vinitsingh665/shiru/blob/master/common/routes/SchedulePage.svelte): `common/routes/SchedulePage.svelte`
- [Anime metadata](https://github.com/vinitsingh665/shiru/blob/master/common/modules/anime/anime.js): `common/modules/anime/anime.js`

### Playback

- [Media resolver](https://github.com/vinitsingh665/shiru/blob/master/common/components/MediaHandler.svelte): `common/components/MediaHandler.svelte`
- [Video player](https://github.com/vinitsingh665/shiru/blob/master/common/routes/player/PlayerPage.svelte): `common/routes/player/PlayerPage.svelte`
- [Torrent client](https://github.com/vinitsingh665/shiru/blob/master/client/core/webtorrent.js): `client/core/webtorrent.js`
- [Subtitle handling](https://github.com/vinitsingh665/shiru/blob/master/common/modules/subtitles.js): `common/modules/subtitles.js`
- [File manager](https://github.com/vinitsingh665/shiru/blob/master/common/modals/manager/ManagerModal.svelte): `common/modals/manager/ManagerModal.svelte`
- [Extension manager](https://github.com/vinitsingh665/shiru/blob/master/common/modules/extensions/manager.js): `common/modules/extensions/manager.js`
- [Extension workers](https://github.com/vinitsingh665/shiru/blob/master/common/modules/extensions/worker.js): `common/modules/extensions/worker.js`

### Tracking Services

- [Release alerts](https://github.com/vinitsingh665/shiru/blob/master/common/modules/notification/manager.js): `common/modules/notification/manager.js`
- [AniList sync](https://github.com/vinitsingh665/shiru/blob/master/common/modules/providers/anilist/anilist.js): `common/modules/providers/anilist/anilist.js`
- [MyAnimeList sync](https://github.com/vinitsingh665/shiru/blob/master/common/modules/providers/myanimelist/myanimelist.js): `common/modules/providers/myanimelist/myanimelist.js`
- [Profiles](https://github.com/vinitsingh665/shiru/blob/master/common/modals/ProfilesModal.svelte): `common/modals/ProfilesModal.svelte`
- [Watch together](https://github.com/vinitsingh665/shiru/blob/master/common/routes/w2g/WatchTogetherPage.svelte): `common/routes/w2g/WatchTogetherPage.svelte`
- [Local cache](https://github.com/vinitsingh665/shiru/blob/master/common/modules/cache.js): `common/modules/cache.js`

### Platform Runtime

- [Desktop runtime](https://github.com/vinitsingh665/shiru/blob/master/electron/src/main/app.js): `electron/src/main/app.js`
- [Android runtime](https://github.com/vinitsingh665/shiru/blob/master/capacitor/src/main/app.js): `capacitor/src/main/app.js`

### Other components

- **Viewer**
- **AniList**
- **MyAnimeList**
- **Local media**
- **Optional sources**

## Connections

- Viewer → App shell: uses
- App shell → Route selection: renders
- Route selection → Home library: routes to
- Route selection → Anime search: routes to
- Route selection → Release schedule: routes to
- Route selection → Media resolver: hosts
- Home library → Anime metadata: loads metadata
- Anime search → Anime metadata: searches metadata
- Release schedule → Anime metadata: uses schedule data
- Media resolver → Anime metadata: resolves episodes
- Media resolver → Video player: starts playback
- Media resolver → Torrent client: streams files
- Media resolver → Extension manager: requests sources
- Extension manager → Extension workers: dispatches work
- Extension workers → Optional sources: fetches from
- Media resolver → Local media: plays local files
- Video player → Subtitle handling: loads tracks
- Media resolver → File manager: opens file tools
- Anime metadata → AniList sync: uses provider
- AniList sync → AniList: syncs lists
- MyAnimeList sync → MyAnimeList: syncs lists
- App shell → MyAnimeList sync: supports list sync
- Anime metadata → MyAnimeList sync: supports provider
- Release alerts → Local cache: persists alerts
- Release alerts → Desktop runtime: updates badge
- Release alerts → Android runtime: dispatches alerts
- Profiles → Local cache: uses local state
- Watch together → Media resolver: coordinates playback
- Desktop runtime → Torrent client: hosts client
- Android runtime → Torrent client: bridges client
