# aniraku/aniraku-app architecture

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

- Interactive diagram: https://gitdiagram.com/aniraku/aniraku-app
- Repository: https://github.com/aniraku/aniraku-app

## Overview

Aniraku is an Expo/React Native anime companion. The main user journey is discovery through AniList-backed browsing and search, selecting a title and episode, then resolving a stream for playback; the app also supports offline downloads and persistent watch/library data. Separate branches cover account access, comments and ratings, airing alerts, and AniList/MAL sync. Edges rely on README claims and the supplied source index/excerpts; unsampled implementation details are represented cautiously.

Main entry points: [`lib/anilist.ts`](https://github.com/aniraku/aniraku-app/blob/main/lib/anilist.ts) (Anime metadata), [`app/anime/[id].tsx`](https://github.com/aniraku/aniraku-app/blob/main/app/anime/%5Bid%5D.tsx) (Anime details), [`app/watch/[id].tsx`](https://github.com/aniraku/aniraku-app/blob/main/app/watch/%5Bid%5D.tsx) (Playback), [`app/(tabs)/index.tsx`](https://github.com/aniraku/aniraku-app/blob/main/app/(tabs)/index.tsx) (Home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery"]
  node_home["Home<br/>[index.tsx]"]
  node_catalog["Catalog<br/>[catalog.tsx]"]
  node_search["Search<br/>[search.tsx]"]
  node_anime_detail["Anime details<br/>[&#91;id&#93;.tsx]"]
  node_metadata["Anime metadata<br/>[anilist.ts]"]
  node_schedule["Airing schedule"]
  node_alerts["Episode alerts"]
end

subgraph group_watching["Watching"]
  node_episode_list["Episode list<br/>[&#91;id&#93;.tsx]"]
  node_episode_resolution["Episode resolution"]
  node_player["Playback<br/>[&#91;id&#93;.tsx]"]
  node_watch_engine["Watch engine<br/>[watch-engine.ts]"]
  node_download_manager["Downloads<br/>[downloads.ts]"]
  node_native_downloads["Native downloads"]
end

subgraph group_personal["Personal library"]
  node_library["Library and history"]
  node_bookmarks["Bookmarks<br/>[use-bookmarks.ts]"]
end

subgraph group_community["Accounts and community"]
  node_account["Authentication<br/>[auth-provider.tsx]"]
  node_comments["Comments and ratings<br/>[anime-comments.tsx]"]
  node_sync["AniList/MAL sync<br/>[provider-sync.ts]"]
end

subgraph group_platform["App platform"]
  node_design_system["Design system<br/>[nothing-ui.tsx]"]
end

node_viewer(("Viewer"))
node_backend_api["Aniraku backend"]
node_anilist_service["AniList service"]
node_supabase[("Supabase")]

node_viewer -->|"opens"| node_home
node_viewer -->|"browses"| node_catalog
node_viewer -->|"searches"| node_search
node_home -->|"loads titles"| node_metadata
node_catalog -.->|"loads catalog"| node_metadata
node_search -->|"queries titles"| node_metadata
node_viewer -->|"selects title"| node_anime_detail
node_anime_detail -->|"loads details"| node_metadata
node_anime_detail -->|"opens episodes"| node_episode_list
node_episode_list -->|"requests episodes"| node_backend_api
node_episode_list -->|"resolves sources"| node_episode_resolution
node_viewer -->|"watches episode"| node_player
node_player -->|"requests streams"| node_backend_api
node_player -->|"selects sources"| node_watch_engine
node_watch_engine -->|"checks sources"| node_backend_api
node_player -->|"starts downloads"| node_download_manager
node_download_manager -.->|"uses native service"| node_native_downloads
node_viewer -->|"tracks viewing"| node_library
node_library -->|"syncs history"| node_supabase
node_viewer -->|"saves titles"| node_bookmarks
node_bookmarks -->|"syncs bookmarks"| node_supabase
node_viewer -->|"signs in"| node_account
node_account -->|"authenticates"| node_supabase
node_anime_detail -->|"shows discussion"| node_comments
node_comments -->|"uses account"| node_account
node_comments -.->|"stores comments"| node_supabase
node_viewer -->|"connects provider"| node_sync
node_sync -->|"syncs progress"| node_anilist_service
node_viewer -->|"checks airing"| node_schedule
node_schedule -.->|"loads schedule"| node_metadata
node_viewer -->|"sets reminders"| node_alerts
node_alerts -.->|"checks episodes"| node_backend_api
node_home -->|"renders with"| node_design_system

click node_home "https://github.com/aniraku/aniraku-app/blob/main/app/(tabs)/index.tsx"
click node_catalog "https://github.com/aniraku/aniraku-app/blob/main/app/(tabs)/catalog.tsx"
click node_search "https://github.com/aniraku/aniraku-app/blob/main/app/search.tsx"
click node_anime_detail "https://github.com/aniraku/aniraku-app/blob/main/app/anime/%5Bid%5D.tsx"
click node_metadata "https://github.com/aniraku/aniraku-app/blob/main/lib/anilist.ts"
click node_episode_list "https://github.com/aniraku/aniraku-app/blob/main/app/episode/%5Bid%5D.tsx"
click node_episode_resolution "https://github.com/aniraku/aniraku-app/blob/main/lib/episode-fallbacks.ts"
click node_player "https://github.com/aniraku/aniraku-app/blob/main/app/watch/%5Bid%5D.tsx"
click node_watch_engine "https://github.com/aniraku/aniraku-app/blob/main/lib/watch-engine.ts"
click node_download_manager "https://github.com/aniraku/aniraku-app/blob/main/lib/downloads.ts"
click node_native_downloads "https://github.com/aniraku/aniraku-app/blob/main/modules/aniraku-downloads/android/src/main/java/expo/modules/anirakudownloads/AnirakuDownloadsService.kt"
click node_library "https://github.com/aniraku/aniraku-app/blob/main/hooks/use-watch-history.ts"
click node_bookmarks "https://github.com/aniraku/aniraku-app/blob/main/hooks/use-bookmarks.ts"
click node_account "https://github.com/aniraku/aniraku-app/blob/main/providers/auth-provider.tsx"
click node_comments "https://github.com/aniraku/aniraku-app/blob/main/components/anime-comments.tsx"
click node_sync "https://github.com/aniraku/aniraku-app/blob/main/lib/provider-sync.ts"
click node_schedule "https://github.com/aniraku/aniraku-app/blob/main/components/airing-schedule.tsx"
click node_alerts "https://github.com/aniraku/aniraku-app/blob/main/hooks/use-airing-reminders.ts"
click node_design_system "https://github.com/aniraku/aniraku-app/blob/main/components/nothing-ui.tsx"

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_home,node_catalog,node_search,node_anime_detail,node_metadata,node_schedule,node_alerts,node_viewer toneBlue
class node_episode_list,node_episode_resolution,node_player,node_watch_engine,node_download_manager,node_native_downloads,node_supabase toneAmber
class node_library,node_bookmarks toneMint
class node_account,node_comments,node_sync toneRose
class node_design_system,node_backend_api,node_anilist_service toneIndigo
```

## Components

### Discovery

- [Home](https://github.com/aniraku/aniraku-app/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`
- [Catalog](https://github.com/aniraku/aniraku-app/blob/main/app/(tabs)/catalog.tsx): `app/(tabs)/catalog.tsx`
- [Search](https://github.com/aniraku/aniraku-app/blob/main/app/search.tsx): `app/search.tsx`
- [Anime details](https://github.com/aniraku/aniraku-app/blob/main/app/anime/%5Bid%5D.tsx): `app/anime/[id].tsx`
- [Anime metadata](https://github.com/aniraku/aniraku-app/blob/main/lib/anilist.ts): `lib/anilist.ts`
- [Airing schedule](https://github.com/aniraku/aniraku-app/blob/main/components/airing-schedule.tsx): `components/airing-schedule.tsx`
- [Episode alerts](https://github.com/aniraku/aniraku-app/blob/main/hooks/use-airing-reminders.ts): `hooks/use-airing-reminders.ts`

### Watching

- [Episode list](https://github.com/aniraku/aniraku-app/blob/main/app/episode/%5Bid%5D.tsx): `app/episode/[id].tsx`
- [Episode resolution](https://github.com/aniraku/aniraku-app/blob/main/lib/episode-fallbacks.ts): `lib/episode-fallbacks.ts`
- [Playback](https://github.com/aniraku/aniraku-app/blob/main/app/watch/%5Bid%5D.tsx): `app/watch/[id].tsx`
- [Watch engine](https://github.com/aniraku/aniraku-app/blob/main/lib/watch-engine.ts): `lib/watch-engine.ts`
- [Downloads](https://github.com/aniraku/aniraku-app/blob/main/lib/downloads.ts): `lib/downloads.ts`
- [Native downloads](https://github.com/aniraku/aniraku-app/blob/main/modules/aniraku-downloads/android/src/main/java/expo/modules/anirakudownloads/AnirakuDownloadsService.kt): `modules/aniraku-downloads/android/src/main/java/expo/modules/anirakudownloads/AnirakuDownloadsService.kt`

### Personal library

- [Library and history](https://github.com/aniraku/aniraku-app/blob/main/hooks/use-watch-history.ts): `hooks/use-watch-history.ts`
- [Bookmarks](https://github.com/aniraku/aniraku-app/blob/main/hooks/use-bookmarks.ts): `hooks/use-bookmarks.ts`

### Accounts and community

- [Authentication](https://github.com/aniraku/aniraku-app/blob/main/providers/auth-provider.tsx): `providers/auth-provider.tsx`
- [Comments and ratings](https://github.com/aniraku/aniraku-app/blob/main/components/anime-comments.tsx): `components/anime-comments.tsx`
- [AniList/MAL sync](https://github.com/aniraku/aniraku-app/blob/main/lib/provider-sync.ts): `lib/provider-sync.ts`

### App platform

- [Design system](https://github.com/aniraku/aniraku-app/blob/main/components/nothing-ui.tsx): `components/nothing-ui.tsx`

### Other components

- **Viewer**
- **Aniraku backend**
- **AniList service**
- **Supabase**

## Connections

- Viewer → Home: opens (evidence: `README.md`)
- Viewer → Catalog: browses (evidence: `README.md`)
- Viewer → Search: searches (evidence: `app/search.tsx`)
- Home → Anime metadata: loads titles (evidence: `app/(tabs)/index.tsx`)
- Catalog → Anime metadata: loads catalog
- Search → Anime metadata: queries titles (evidence: `app/search.tsx`)
- Viewer → Anime details: selects title (evidence: `README.md`)
- Anime details → Anime metadata: loads details (evidence: `app/anime/[id].tsx`)
- Anime details → Episode list: opens episodes (evidence: `app/anime/[id].tsx`)
- Episode list → Aniraku backend: requests episodes (evidence: `app/episode/[id].tsx`)
- Episode list → Episode resolution: resolves sources (evidence: `app/episode/[id].tsx`)
- Viewer → Playback: watches episode (evidence: `README.md`)
- Playback → Aniraku backend: requests streams (evidence: `app/watch/[id].tsx`)
- Playback → Watch engine: selects sources (evidence: `app/watch/[id].tsx`)
- Watch engine → Aniraku backend: checks sources (evidence: `lib/watch-engine.ts`)
- Playback → Downloads: starts downloads (evidence: `app/watch/[id].tsx`)
- Downloads → Native downloads: uses native service
- Viewer → Library and history: tracks viewing (evidence: `README.md`)
- Library and history → Supabase: syncs history (evidence: `hooks/use-watch-history.ts`)
- Viewer → Bookmarks: saves titles (evidence: `README.md`)
- Bookmarks → Supabase: syncs bookmarks (evidence: `hooks/use-bookmarks.ts`)
- Viewer → Authentication: signs in
- Authentication → Supabase: authenticates (evidence: `providers/auth-provider.tsx`)
- Anime details → Comments and ratings: shows discussion (evidence: `app/anime/[id].tsx`)
- Comments and ratings → Authentication: uses account (evidence: `components/anime-comments.tsx`)
- Comments and ratings → Supabase: stores comments
- Viewer → AniList/MAL sync: connects provider (evidence: `README.md`)
- AniList/MAL sync → AniList service: syncs progress (evidence: `README.md`)
- Viewer → Airing schedule: checks airing (evidence: `README.md`)
- Airing schedule → Anime metadata: loads schedule
- Viewer → Episode alerts: sets reminders (evidence: `README.md`)
- Episode alerts → Aniraku backend: checks episodes
- Home → Design system: renders with (evidence: `app/(tabs)/index.tsx`)
