# sofikuw/animestream architecture

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

- Interactive diagram: https://gitdiagram.com/sofikuw/animestream
- Repository: https://github.com/sofikuw/animestream

## Overview

This repository contains a Flutter anime and manga streaming app, with shared functionality across iOS and Android and a bundled BetterPlayer backend. A typical user discovers or searches for content, opens a title, then watches episodes or reads chapters; the app also supports downloads, tracking, and JavaScript provider catalogs. The README documents these capabilities, but Dart implementation excerpts were not provided, so internal call paths are not asserted. The native player and Android activity are represented as implementation layers, not as a complete call graph.

Main entry points: [`lib/main.dart`](https://github.com/sofikuw/animestream/blob/divergent/lib/main.dart) (Flutter app), [`lib/ui/pages`](https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages) (Title details), [`lib/core/anime/providers/providerRepository.dart`](https://github.com/sofikuw/animestream/blob/divergent/lib/core/anime/providers/providerRepository.dart) (Provider catalogs), [`lib/ui/pages/watch.dart`](https://github.com/sofikuw/animestream/blob/divergent/lib/ui/pages/watch.dart) (Video player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_flutter_app["Flutter app<br/>[main.dart]"]
  node_discover_search["Discovery and search"]
  node_title_details["Title details"]
  node_home_lists["Home and lists"]
  node_settings["Settings"]
end

subgraph group_content["Content services"]
  node_anime_providers["Anime providers"]
  node_provider_catalog["Provider catalogs"]
  node_manga_providers["Manga providers"]
  node_media_tracking["Media tracking"]
  node_local_state[("Local preferences")]
end

subgraph group_playback["Playback and reading"]
  node_anime_downloads["Anime downloads"]
  node_video_player["Video player<br/>[watch.dart]"]
  node_player_backend["BetterPlayer backend"]
  node_manga_reader["Manga reader<br/>[mangaReader.dart]"]
end

subgraph group_platform["Platform runtime"]
  node_android_host["Android host<br/>[MainActivity.kt]"]
  node_ios_host["iOS host<br/>[AppDelegate.swift]"]
end

node_user(("App user"))

node_user -->|"uses"| node_flutter_app
node_flutter_app -->|"offers"| node_discover_search
node_flutter_app -->|"offers"| node_home_lists
node_flutter_app -->|"offers"| node_title_details
node_discover_search -.->|"finds anime"| node_anime_providers
node_title_details -.->|"starts playback"| node_video_player
node_title_details -.->|"opens chapters"| node_manga_reader
node_flutter_app -->|"supports downloads"| node_anime_downloads
node_flutter_app -->|"supports tracking"| node_media_tracking
node_flutter_app -->|"supports manga"| node_manga_providers
node_provider_catalog -->|"catalogs sources"| node_anime_providers
node_provider_catalog -->|"catalogs sources"| node_manga_providers
node_video_player -->|"uses on mobile"| node_player_backend
node_home_lists -->|"continues reading"| node_local_state
node_settings -.->|"configures"| node_local_state
node_flutter_app -->|"runs on Android"| node_android_host
node_flutter_app -->|"runs on iOS"| node_ios_host

click node_flutter_app "https://github.com/sofikuw/animestream/blob/divergent/lib/main.dart"
click node_discover_search "https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages"
click node_title_details "https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages"
click node_home_lists "https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages"
click node_settings "https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages/settingPages"
click node_anime_providers "https://github.com/sofikuw/animestream/tree/divergent/lib/core/anime/providers"
click node_provider_catalog "https://github.com/sofikuw/animestream/blob/divergent/lib/core/anime/providers/providerRepository.dart"
click node_manga_providers "https://github.com/sofikuw/animestream/tree/divergent/lib/core/manga"
click node_anime_downloads "https://github.com/sofikuw/animestream/tree/divergent/lib/core/anime/downloader"
click node_video_player "https://github.com/sofikuw/animestream/blob/divergent/lib/ui/pages/watch.dart"
click node_player_backend "https://github.com/sofikuw/animestream/tree/divergent/packages/better_player"
click node_manga_reader "https://github.com/sofikuw/animestream/blob/divergent/lib/ui/pages/mangaReader.dart"
click node_media_tracking "https://github.com/sofikuw/animestream/tree/divergent/lib/core/database"
click node_local_state "https://github.com/sofikuw/animestream/tree/divergent/lib/core/data"
click node_android_host "https://github.com/sofikuw/animestream/blob/divergent/android/app/src/main/kotlin/app/animestream/MainActivity.kt"
click node_ios_host "https://github.com/sofikuw/animestream/blob/divergent/ios/Runner/AppDelegate.swift"

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_flutter_app,node_discover_search,node_title_details,node_home_lists,node_settings,node_user toneBlue
class node_anime_providers,node_provider_catalog,node_manga_providers,node_media_tracking,node_local_state toneAmber
class node_anime_downloads,node_video_player,node_player_backend,node_manga_reader toneMint
class node_android_host,node_ios_host toneRose
```

## Components

### App experience

- [Flutter app](https://github.com/sofikuw/animestream/blob/divergent/lib/main.dart): `lib/main.dart`
- [Discovery and search](https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages): `lib/ui/pages`
- [Title details](https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages): `lib/ui/pages`
- [Home and lists](https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages): `lib/ui/pages`
- [Settings](https://github.com/sofikuw/animestream/tree/divergent/lib/ui/pages/settingPages): `lib/ui/pages/settingPages`

### Content services

- [Anime providers](https://github.com/sofikuw/animestream/tree/divergent/lib/core/anime/providers): `lib/core/anime/providers`
- [Provider catalogs](https://github.com/sofikuw/animestream/blob/divergent/lib/core/anime/providers/providerRepository.dart): `lib/core/anime/providers/providerRepository.dart`
- [Manga providers](https://github.com/sofikuw/animestream/tree/divergent/lib/core/manga): `lib/core/manga`
- [Media tracking](https://github.com/sofikuw/animestream/tree/divergent/lib/core/database): `lib/core/database`
- [Local preferences](https://github.com/sofikuw/animestream/tree/divergent/lib/core/data): `lib/core/data`

### Playback and reading

- [Anime downloads](https://github.com/sofikuw/animestream/tree/divergent/lib/core/anime/downloader): `lib/core/anime/downloader`
- [Video player](https://github.com/sofikuw/animestream/blob/divergent/lib/ui/pages/watch.dart): `lib/ui/pages/watch.dart`
- [BetterPlayer backend](https://github.com/sofikuw/animestream/tree/divergent/packages/better_player): `packages/better_player`
- [Manga reader](https://github.com/sofikuw/animestream/blob/divergent/lib/ui/pages/mangaReader.dart): `lib/ui/pages/mangaReader.dart`

### Platform runtime

- [Android host](https://github.com/sofikuw/animestream/blob/divergent/android/app/src/main/kotlin/app/animestream/MainActivity.kt): `android/app/src/main/kotlin/app/animestream/MainActivity.kt`
- [iOS host](https://github.com/sofikuw/animestream/blob/divergent/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **App user**

## Connections

- App user → Flutter app: uses (evidence: `README.md`)
- Flutter app → Discovery and search: offers (evidence: `README.md`)
- Flutter app → Home and lists: offers (evidence: `README.md`)
- Flutter app → Title details: offers (evidence: `README.md`)
- Discovery and search → Anime providers: finds anime
- Title details → Video player: starts playback
- Title details → Manga reader: opens chapters
- Flutter app → Anime downloads: supports downloads (evidence: `README.md`)
- Flutter app → Media tracking: supports tracking (evidence: `README.md`)
- Flutter app → Manga providers: supports manga (evidence: `README.md`)
- Provider catalogs → Anime providers: catalogs sources (evidence: `README.md`)
- Provider catalogs → Manga providers: catalogs sources (evidence: `README.md`)
- Video player → BetterPlayer backend: uses on mobile (evidence: `README.md`)
- Home and lists → Local preferences: continues reading (evidence: `README.md`)
- Settings → Local preferences: configures
- Flutter app → Android host: runs on Android (evidence: `README.md`)
- Flutter app → iOS host: runs on iOS (evidence: `README.md`)
