# danihre/animonkey-electron architecture

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

- Interactive diagram: https://gitdiagram.com/danihre/animonkey-electron
- Repository: https://github.com/danihre/animonkey-electron

## Overview

Animonkey is an Electron anime-discovery, local-library, and episode-playback desktop app. The main user flow is navigation to catalog, search, schedule, or title details; catalog queries fetch AniList data and use local caching, while title pages lead into episode lookup and playback through Anivexa and Vidstack. Separate branches cover local watch tracking and backups, optional account sync, screenshot search, and notifications. Several UI and Electron modules were not sampled, so their internal connections are omitted unless documented or indexed.

Main entry points: [`src/router.tsx`](https://github.com/danihre/animonkey-electron/blob/main/src/router.tsx) (Route handling), [`src/services/anime-queries.ts`](https://github.com/danihre/animonkey-electron/blob/main/src/services/anime-queries.ts) (Catalog queries), [`src/components/features/player/watch-page.tsx`](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/player/watch-page.tsx) (Watch page), [`src/services/cache/local-db.ts`](https://github.com/danihre/animonkey-electron/blob/main/src/services/cache/local-db.ts) (Local database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery"]
  node_router["Route handling<br/>[router.tsx]"]
  node_shell["App shell<br/>[app-shell.tsx]"]
  node_home["Home &amp; schedule<br/>[home-page.tsx]"]
  node_search["Catalog search<br/>[search-page.tsx]"]
  node_anime["Anime details<br/>[anime-page.tsx]"]
  node_queries["Catalog queries<br/>[anime-queries.ts]"]
  node_anilist["AniList catalog<br/>[anilist.service.ts]"]
  node_screenshot_ui["Screenshot search UI"]
end

subgraph group_library["Library &amp; Accounts"]
  node_cache[("Local database<br/>[local-db.ts]")]
  node_account["Library settings<br/>[settings-page.tsx]"]
  node_account_context["Account context"]
  node_account_service["Desktop account service<br/>[account-service.ts]"]
end

subgraph group_playback["Episode Playback"]
  node_watch["Watch page<br/>[watch-page.tsx]"]
  node_anivexa_service["Episode source service<br/>[anivexa.service.ts]"]
  node_player["Video player"]
end

subgraph group_desktop["Desktop Services"]
  node_anivexa_runtime["Anivexa runtime<br/>[anivexa-runtime.ts]"]
  node_main["Electron main<br/>[main.ts]"]
  node_screenshot["Screenshot search"]
  node_notification_monitor["Airing monitor"]
end

subgraph group_platform["External Services"]
  node_desktop_api["Desktop API<br/>[index.ts]"]
  node_vidstack["Vidstack"]
end

node_user(("Desktop user"))

node_user -->|"opens routes"| node_router
node_router -->|"renders layout"| node_shell
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_search
node_router -->|"routes to"| node_anime
node_router -->|"routes to"| node_watch
node_queries -->|"requests catalog"| node_anilist
node_anilist -->|"writes catalog cache"| node_cache
node_queries -->|"requests episodes"| node_anivexa_service
node_watch -->|"loads episode data"| node_queries
node_watch -->|"renders player"| node_player
node_player -->|"uses framework"| node_vidstack
node_anivexa_service -->|"requests via typed IPC"| node_anivexa_runtime
node_main -->|"registers IPC"| node_anivexa_runtime
node_main -->|"registers IPC"| node_screenshot
node_screenshot_ui -->|"searches images"| node_screenshot
node_account_context -->|"reads local data"| node_cache
node_account_context -->|"syncs account"| node_account_service
node_account -->|"exports backup"| node_cache
node_account_service -.->|"syncs remotely"| node_desktop_api
node_notification_monitor -->|"loads airing data"| node_queries

click node_router "https://github.com/danihre/animonkey-electron/blob/main/src/router.tsx"
click node_shell "https://github.com/danihre/animonkey-electron/blob/main/src/components/layout/app-shell.tsx"
click node_home "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/home/home-page.tsx"
click node_search "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/search/search-page.tsx"
click node_anime "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/anime/anime-page.tsx"
click node_queries "https://github.com/danihre/animonkey-electron/blob/main/src/services/anime-queries.ts"
click node_anilist "https://github.com/danihre/animonkey-electron/blob/main/src/services/anilist.service.ts"
click node_cache "https://github.com/danihre/animonkey-electron/blob/main/src/services/cache/local-db.ts"
click node_account "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/account/settings-page.tsx"
click node_account_context "https://github.com/danihre/animonkey-electron/blob/main/src/context/account-context.tsx"
click node_account_service "https://github.com/danihre/animonkey-electron/blob/main/src/electron/account-service.ts"
click node_desktop_api "https://github.com/danihre/animonkey-electron/blob/main/supabase/functions/desktop-api/index.ts"
click node_watch "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/player/watch-page.tsx"
click node_anivexa_service "https://github.com/danihre/animonkey-electron/blob/main/src/services/anivexa.service.ts"
click node_player "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/player/vidstack-video-player.tsx"
click node_anivexa_runtime "https://github.com/danihre/animonkey-electron/blob/main/src/electron/anivexa-runtime.ts"
click node_main "https://github.com/danihre/animonkey-electron/blob/main/src/main.ts"
click node_screenshot "https://github.com/danihre/animonkey-electron/blob/main/src/electron/screenshot-search.ts"
click node_screenshot_ui "https://github.com/danihre/animonkey-electron/blob/main/src/components/features/search/screenshot-search-panel.tsx"
click node_notification_monitor "https://github.com/danihre/animonkey-electron/blob/main/src/hooks/use-airing-notification-monitor.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_router,node_shell,node_home,node_search,node_anime,node_queries,node_anilist,node_screenshot_ui,node_user toneBlue
class node_cache,node_account,node_account_context,node_account_service toneAmber
class node_watch,node_anivexa_service,node_player toneMint
class node_anivexa_runtime,node_main,node_screenshot,node_notification_monitor toneRose
class node_desktop_api,node_vidstack toneIndigo
```

## Components

### Discovery

- [Route handling](https://github.com/danihre/animonkey-electron/blob/main/src/router.tsx): `src/router.tsx`
- [App shell](https://github.com/danihre/animonkey-electron/blob/main/src/components/layout/app-shell.tsx): `src/components/layout/app-shell.tsx`
- [Home & schedule](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/home/home-page.tsx): `src/components/features/home/home-page.tsx`
- [Catalog search](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/search/search-page.tsx): `src/components/features/search/search-page.tsx`
- [Anime details](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/anime/anime-page.tsx): `src/components/features/anime/anime-page.tsx`
- [Catalog queries](https://github.com/danihre/animonkey-electron/blob/main/src/services/anime-queries.ts): `src/services/anime-queries.ts`
- [AniList catalog](https://github.com/danihre/animonkey-electron/blob/main/src/services/anilist.service.ts): `src/services/anilist.service.ts`
- [Screenshot search UI](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/search/screenshot-search-panel.tsx): `src/components/features/search/screenshot-search-panel.tsx`

### Library & Accounts

- [Local database](https://github.com/danihre/animonkey-electron/blob/main/src/services/cache/local-db.ts): `src/services/cache/local-db.ts`
- [Library settings](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/account/settings-page.tsx): `src/components/features/account/settings-page.tsx`
- [Account context](https://github.com/danihre/animonkey-electron/blob/main/src/context/account-context.tsx): `src/context/account-context.tsx`
- [Desktop account service](https://github.com/danihre/animonkey-electron/blob/main/src/electron/account-service.ts): `src/electron/account-service.ts`

### Episode Playback

- [Watch page](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/player/watch-page.tsx): `src/components/features/player/watch-page.tsx`
- [Episode source service](https://github.com/danihre/animonkey-electron/blob/main/src/services/anivexa.service.ts): `src/services/anivexa.service.ts`
- [Video player](https://github.com/danihre/animonkey-electron/blob/main/src/components/features/player/vidstack-video-player.tsx): `src/components/features/player/vidstack-video-player.tsx`

### Desktop Services

- [Anivexa runtime](https://github.com/danihre/animonkey-electron/blob/main/src/electron/anivexa-runtime.ts): `src/electron/anivexa-runtime.ts`
- [Electron main](https://github.com/danihre/animonkey-electron/blob/main/src/main.ts): `src/main.ts`
- [Screenshot search](https://github.com/danihre/animonkey-electron/blob/main/src/electron/screenshot-search.ts): `src/electron/screenshot-search.ts`
- [Airing monitor](https://github.com/danihre/animonkey-electron/blob/main/src/hooks/use-airing-notification-monitor.ts): `src/hooks/use-airing-notification-monitor.ts`

### External Services

- [Desktop API](https://github.com/danihre/animonkey-electron/blob/main/supabase/functions/desktop-api/index.ts): `supabase/functions/desktop-api/index.ts`
- **Vidstack**

### Other components

- **Desktop user**

## Connections

- Desktop user → Route handling: opens routes (evidence: `src/router.tsx`)
- Route handling → App shell: renders layout (evidence: `src/components/layout/router-root.tsx`)
- Route handling → Home & schedule: routes to (evidence: `src/router.tsx`)
- Route handling → Catalog search: routes to (evidence: `src/router.tsx`)
- Route handling → Anime details: routes to (evidence: `src/router.tsx`)
- Route handling → Watch page: routes to (evidence: `src/router.tsx`)
- Catalog queries → AniList catalog: requests catalog (evidence: `src/services/anime-queries.ts`)
- AniList catalog → Local database: writes catalog cache (evidence: `src/services/anilist.service.ts`)
- Catalog queries → Episode source service: requests episodes (evidence: `src/services/anime-queries.ts`)
- Watch page → Catalog queries: loads episode data (evidence: `src/components/features/player/watch-page.tsx`)
- Watch page → Video player: renders player (evidence: `src/components/features/player/watch-page.tsx`)
- Video player → Vidstack: uses framework (evidence: `README.md`)
- Episode source service → Anivexa runtime: requests via typed IPC (evidence: `README.md`)
- Electron main → Anivexa runtime: registers IPC (evidence: `src/main.ts`)
- Electron main → Screenshot search: registers IPC (evidence: `src/main.ts`)
- Screenshot search UI → Screenshot search: searches images (evidence: `src/components/features/search/screenshot-search-panel.tsx`)
- Account context → Local database: reads local data (evidence: `src/context/account-context.tsx`)
- Account context → Desktop account service: syncs account (evidence: `src/context/account-context.tsx`)
- Library settings → Local database: exports backup (evidence: `src/components/features/account/settings-page.tsx`)
- Desktop account service → Desktop API: syncs remotely
- Airing monitor → Catalog queries: loads airing data (evidence: `src/hooks/use-airing-notification-monitor.ts`)
