# realcgcristi/nextfin architecture

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

- Interactive diagram: https://gitdiagram.com/realcgcristi/nextfin
- Repository: https://github.com/realcgcristi/nextfin

## Overview

nextfin is a Flutter Jellyfin client, with Android as its main target. Its documented user journey runs from account login through recommendations and library/search discovery to media details and playback; the app also covers history, downloads, live TV, themes, and account switching. The Dart implementation was not sampled, so feature paths and documented capabilities are represented without asserting internal call chains. Android native playback controls and PiP are visible in MainActivity; relationships to Flutter playback are unverified.

Main entry points: [`lib/features/player/presentation/player_screen.dart`](https://github.com/realcgcristi/nextfin/blob/main/lib/features/player/presentation/player_screen.dart) (Media player), [`lib/features/home/presentation/home_screen.dart`](https://github.com/realcgcristi/nextfin/blob/main/lib/features/home/presentation/home_screen.dart) (Home recommendations), [`lib/features/libraries/presentation/library_screen.dart`](https://github.com/realcgcristi/nextfin/blob/main/lib/features/libraries/presentation/library_screen.dart) (Library browsing), [`lib/features/search/presentation/search_screen.dart`](https://github.com/realcgcristi/nextfin/blob/main/lib/features/search/presentation/search_screen.dart) (Media search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and navigation"]
  node_startup["Startup"]
end

subgraph group_discovery["Media discovery"]
  node_home["Home recommendations<br/>[home_screen.dart]"]
  node_libraries["Library browsing"]
  node_search["Media search<br/>[search_screen.dart]"]
  node_details["Media details"]
end

subgraph group_playback["Playback and offline"]
  node_player["Media player<br/>[player_screen.dart]"]
  node_downloads["Downloads"]
  node_history["Watch history"]
end

subgraph group_account["Accounts and settings"]
  node_login["Login flow"]
  node_settings["Settings and themes"]
  node_session["Session controller"]
end

subgraph group_platform["Platform and shared services"]
  node_api["Jellyfin API<br/>[jellyfin_api.dart]"]
  node_compatibility["Server compatibility<br/>[compatibility.dart]"]
  node_storage[("App storage<br/>[app_storage.dart]")]
  node_models["Media and account models<br/>[media_item.dart]"]
  node_native["Android media controls and PiP<br/>[MainActivity.kt]"]
end

node_user(("Viewer"))
node_jellyfin{{"Jellyfin server"}}

node_user -->|"opens"| node_startup
node_user -->|"signs in"| node_login
node_user -->|"browses"| node_home
node_user -->|"browses"| node_libraries
node_user -->|"searches"| node_search
node_user -->|"views"| node_details
node_user -->|"watches"| node_player
node_user -->|"downloads"| node_downloads
node_user -->|"reviews"| node_history
node_user -->|"configures"| node_settings
node_player -.->|"uses controls"| node_native
node_native -->|"shows controls"| node_user
node_home -.->|"loads media"| node_jellyfin
node_libraries -.->|"browses catalog"| node_jellyfin
node_search -.->|"searches catalog"| node_jellyfin
node_player -.->|"plays media"| node_jellyfin

click node_startup "https://github.com/realcgcristi/nextfin/blob/main/lib/features/startup/presentation/startup_screen.dart"
click node_login "https://github.com/realcgcristi/nextfin/blob/main/lib/features/auth/presentation/login_flow_screen.dart"
click node_home "https://github.com/realcgcristi/nextfin/blob/main/lib/features/home/presentation/home_screen.dart"
click node_libraries "https://github.com/realcgcristi/nextfin/blob/main/lib/features/libraries/presentation/library_screen.dart"
click node_search "https://github.com/realcgcristi/nextfin/blob/main/lib/features/search/presentation/search_screen.dart"
click node_details "https://github.com/realcgcristi/nextfin/blob/main/lib/features/details/presentation/details_screen.dart"
click node_player "https://github.com/realcgcristi/nextfin/blob/main/lib/features/player/presentation/player_screen.dart"
click node_downloads "https://github.com/realcgcristi/nextfin/blob/main/lib/features/downloads/application/download_controller.dart"
click node_history "https://github.com/realcgcristi/nextfin/blob/main/lib/features/history/presentation/history_screen.dart"
click node_settings "https://github.com/realcgcristi/nextfin/blob/main/lib/features/settings/presentation/settings_hub_screen.dart"
click node_session "https://github.com/realcgcristi/nextfin/blob/main/lib/features/auth/application/session_controller.dart"
click node_api "https://github.com/realcgcristi/nextfin/blob/main/lib/core/networking/jellyfin_api.dart"
click node_compatibility "https://github.com/realcgcristi/nextfin/blob/main/lib/core/compatibility/compatibility.dart"
click node_storage "https://github.com/realcgcristi/nextfin/blob/main/lib/core/storage/app_storage.dart"
click node_models "https://github.com/realcgcristi/nextfin/blob/main/lib/shared/models/media_item.dart"
click node_native "https://github.com/realcgcristi/nextfin/blob/main/android/app/src/main/kotlin/com/nextfin/MainActivity.kt"

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_startup,node_user toneBlue
class node_home,node_libraries,node_search,node_details toneAmber
class node_player,node_downloads,node_history,node_jellyfin toneMint
class node_login,node_settings,node_session toneRose
class node_api,node_compatibility,node_storage,node_models,node_native toneIndigo
```

## Components

### App entry and navigation

- [Startup](https://github.com/realcgcristi/nextfin/blob/main/lib/features/startup/presentation/startup_screen.dart): `lib/features/startup/presentation/startup_screen.dart`

### Media discovery

- [Home recommendations](https://github.com/realcgcristi/nextfin/blob/main/lib/features/home/presentation/home_screen.dart): `lib/features/home/presentation/home_screen.dart`
- [Library browsing](https://github.com/realcgcristi/nextfin/blob/main/lib/features/libraries/presentation/library_screen.dart): `lib/features/libraries/presentation/library_screen.dart`
- [Media search](https://github.com/realcgcristi/nextfin/blob/main/lib/features/search/presentation/search_screen.dart): `lib/features/search/presentation/search_screen.dart`
- [Media details](https://github.com/realcgcristi/nextfin/blob/main/lib/features/details/presentation/details_screen.dart): `lib/features/details/presentation/details_screen.dart`

### Playback and offline

- [Media player](https://github.com/realcgcristi/nextfin/blob/main/lib/features/player/presentation/player_screen.dart): `lib/features/player/presentation/player_screen.dart`
- [Downloads](https://github.com/realcgcristi/nextfin/blob/main/lib/features/downloads/application/download_controller.dart): `lib/features/downloads/application/download_controller.dart`
- [Watch history](https://github.com/realcgcristi/nextfin/blob/main/lib/features/history/presentation/history_screen.dart): `lib/features/history/presentation/history_screen.dart`

### Accounts and settings

- [Login flow](https://github.com/realcgcristi/nextfin/blob/main/lib/features/auth/presentation/login_flow_screen.dart): `lib/features/auth/presentation/login_flow_screen.dart`
- [Settings and themes](https://github.com/realcgcristi/nextfin/blob/main/lib/features/settings/presentation/settings_hub_screen.dart): `lib/features/settings/presentation/settings_hub_screen.dart`
- [Session controller](https://github.com/realcgcristi/nextfin/blob/main/lib/features/auth/application/session_controller.dart): `lib/features/auth/application/session_controller.dart`

### Platform and shared services

- [Jellyfin API](https://github.com/realcgcristi/nextfin/blob/main/lib/core/networking/jellyfin_api.dart): `lib/core/networking/jellyfin_api.dart`
- [Server compatibility](https://github.com/realcgcristi/nextfin/blob/main/lib/core/compatibility/compatibility.dart): `lib/core/compatibility/compatibility.dart`
- [App storage](https://github.com/realcgcristi/nextfin/blob/main/lib/core/storage/app_storage.dart): `lib/core/storage/app_storage.dart`
- [Media and account models](https://github.com/realcgcristi/nextfin/blob/main/lib/shared/models/media_item.dart): `lib/shared/models/media_item.dart`
- [Android media controls and PiP](https://github.com/realcgcristi/nextfin/blob/main/android/app/src/main/kotlin/com/nextfin/MainActivity.kt): `android/app/src/main/kotlin/com/nextfin/MainActivity.kt`

### Other components

- **Viewer**
- **Jellyfin server**

## Connections

- Viewer → Startup: opens (evidence: `README.md`)
- Viewer → Login flow: signs in (evidence: `README.md`)
- Viewer → Home recommendations: browses (evidence: `README.md`)
- Viewer → Library browsing: browses (evidence: `README.md`)
- Viewer → Media search: searches (evidence: `README.md`)
- Viewer → Media details: views (evidence: `README.md`)
- Viewer → Media player: watches (evidence: `README.md`)
- Viewer → Downloads: downloads (evidence: `README.md`)
- Viewer → Watch history: reviews (evidence: `README.md`)
- Viewer → Settings and themes: configures (evidence: `README.md`)
- Media player → Android media controls and PiP: uses controls
- Android media controls and PiP → Viewer: shows controls (evidence: `android/app/src/main/kotlin/com/nextfin/MainActivity.kt`)
- Home recommendations → Jellyfin server: loads media
- Library browsing → Jellyfin server: browses catalog
- Media search → Jellyfin server: searches catalog
- Media player → Jellyfin server: plays media
