# l1xu4n/focubili architecture

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

- Interactive diagram: https://gitdiagram.com/l1xu4n/focubili
- Repository: https://github.com/l1xu4n/focubili

## Overview

FocuBili is a Flutter Android/Windows Bilibili client centered on deliberate video discovery and focused viewing. The main user journey is to search for or open a video link, inspect details, and play it; related branches support learning lists, timestamped notes, focus sessions, and account/profile data. The graph includes the Flutter feature areas and sampled native bridges. Flutter implementation details beyond the supplied excerpts are represented only where documented in the README; edges cite that documentation or the sampled source that shows the relationship.

Main entry points: [`lib/features/player/player_page.dart`](https://github.com/l1xu4n/focubili/blob/master/lib/features/player/player_page.dart) (Player page), [`android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/MainActivity.kt) (Android bridge), [`lib/services/bilibili_service.dart`](https://github.com/l1xu4n/focubili/blob/master/lib/services/bilibili_service.dart) (Bilibili services), [`lib/features/search/search_page.dart`](https://github.com/l1xu4n/focubili/blob/master/lib/features/search/search_page.dart) (Video search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Flutter app entry<br/>[main.dart]"]
  node_shell["Navigation shell<br/>[main_shell.dart]"]
end

subgraph group_discovery["Discovery and accounts"]
  node_home["Home<br/>[home_page.dart]"]
  node_search["Video search<br/>[search_page.dart]"]
  node_deep_link["Link handling"]
  node_account["Account and login<br/>[login_page.dart]"]
  node_bili["Bilibili services"]
  node_profile["Profile data<br/>[profile_page.dart]"]
end

subgraph group_watch["Playback experience"]
  node_player["Player page<br/>[player_page.dart]"]
  node_player_session["Playback session"]
  node_enhance["Player enhancements"]
end

subgraph group_focus["Focus and learning"]
  node_learning["Learning list"]
  node_notes["Video notes"]
  node_focus_timer["Focus timer"]
  node_focus_service["Focus sessions"]
end

subgraph group_platform["Platform services"]
  node_native_playback["Android playback"]
  node_focus_notification["Focus reminders"]
  node_reminder_scheduler["Reminder scheduler"]
  node_android_activity["Android bridge<br/>[MainActivity.kt]"]
  node_deep_link_bridge["Android deep links"]
  node_cookie_bridge["Android cookies"]
  node_device_status["Device status"]
  node_windows_runner["Windows runner<br/>[main.cpp]"]
  node_windows_window["Flutter window<br/>[flutter_window.cpp]"]
end

node_user(("Viewer"))
node_bilibili_service{{"Bilibili platform"}}

node_user -->|"opens"| node_app
node_app -.->|"starts"| node_shell
node_shell -->|"shows"| node_home
node_home -->|"opens search"| node_search
node_user -->|"searches"| node_search
node_user -->|"opens link"| node_deep_link
node_search -->|"requests results"| node_bili
node_deep_link -->|"opens video"| node_player
node_search -.->|"opens result"| node_player
node_player -->|"loads details"| node_bili
node_player -.->|"controls playback"| node_player_session
node_player_session -.->|"bridges playback"| node_native_playback
node_player -.->|"renders features"| node_enhance
node_player -->|"adds episode"| node_learning
node_player -->|"creates notes"| node_notes
node_home -->|"continues learning"| node_learning
node_user -->|"signs in"| node_account
node_account -->|"authenticates"| node_bili
node_profile -->|"loads account data"| node_bili
node_user -->|"starts session"| node_focus_timer
node_focus_timer -.->|"records session"| node_focus_service
node_focus_timer -.->|"schedules reminder"| node_focus_notification
node_android_activity -->|"registers"| node_native_playback
node_android_activity -->|"registers"| node_cookie_bridge
node_android_activity -->|"registers"| node_device_status
node_android_activity -->|"registers"| node_focus_notification
node_android_activity -->|"registers"| node_deep_link_bridge
node_focus_notification -->|"schedules alarms"| node_reminder_scheduler
node_deep_link_bridge -->|"forwards links"| node_app
node_bili -->|"calls API"| node_bilibili_service
node_windows_runner -->|"creates window"| node_windows_window

click node_app "https://github.com/l1xu4n/focubili/blob/master/lib/main.dart"
click node_shell "https://github.com/l1xu4n/focubili/blob/master/lib/features/shell/main_shell.dart"
click node_home "https://github.com/l1xu4n/focubili/blob/master/lib/features/home/home_page.dart"
click node_search "https://github.com/l1xu4n/focubili/blob/master/lib/features/search/search_page.dart"
click node_deep_link "https://github.com/l1xu4n/focubili/blob/master/lib/services/bilibili_deep_link_service.dart"
click node_account "https://github.com/l1xu4n/focubili/blob/master/lib/features/profile/login_page.dart"
click node_bili "https://github.com/l1xu4n/focubili/blob/master/lib/services/bilibili_service.dart"
click node_profile "https://github.com/l1xu4n/focubili/blob/master/lib/features/profile/profile_page.dart"
click node_player "https://github.com/l1xu4n/focubili/blob/master/lib/features/player/player_page.dart"
click node_player_session "https://github.com/l1xu4n/focubili/blob/master/lib/features/player/player_playback_session.dart"
click node_enhance "https://github.com/l1xu4n/focubili/blob/master/lib/features/player/enhancements/player_enhancement_controller.dart"
click node_native_playback "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/NativePlaybackController.kt"
click node_learning "https://github.com/l1xu4n/focubili/blob/master/lib/features/learning/learning_list_page.dart"
click node_notes "https://github.com/l1xu4n/focubili/blob/master/lib/features/notes/video_note_composer.dart"
click node_focus_timer "https://github.com/l1xu4n/focubili/blob/master/lib/features/focus/focus_timer_controller.dart"
click node_focus_service "https://github.com/l1xu4n/focubili/blob/master/lib/services/focus_session_service.dart"
click node_focus_notification "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/FocusNotificationController.kt"
click node_reminder_scheduler "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/FocusReminderScheduler.kt"
click node_android_activity "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/MainActivity.kt"
click node_deep_link_bridge "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/DeepLinkController.kt"
click node_cookie_bridge "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/BilibiliCookieController.kt"
click node_device_status "https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/DeviceStatusController.kt"
click node_windows_runner "https://github.com/l1xu4n/focubili/blob/master/windows/runner/main.cpp"
click node_windows_window "https://github.com/l1xu4n/focubili/blob/master/windows/runner/flutter_window.cpp"

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_shell,node_user toneBlue
class node_home,node_search,node_deep_link,node_account,node_bili,node_profile toneAmber
class node_player,node_player_session,node_enhance toneMint
class node_learning,node_notes,node_focus_timer,node_focus_service toneRose
class node_native_playback,node_focus_notification,node_reminder_scheduler,node_android_activity,node_deep_link_bridge,node_cookie_bridge,node_device_status,node_windows_runner,node_windows_window,node_bilibili_service toneIndigo
```

## Components

### Application shell

- [Flutter app entry](https://github.com/l1xu4n/focubili/blob/master/lib/main.dart): `lib/main.dart`
- [Navigation shell](https://github.com/l1xu4n/focubili/blob/master/lib/features/shell/main_shell.dart): `lib/features/shell/main_shell.dart`

### Discovery and accounts

- [Home](https://github.com/l1xu4n/focubili/blob/master/lib/features/home/home_page.dart): `lib/features/home/home_page.dart`
- [Video search](https://github.com/l1xu4n/focubili/blob/master/lib/features/search/search_page.dart): `lib/features/search/search_page.dart`
- [Link handling](https://github.com/l1xu4n/focubili/blob/master/lib/services/bilibili_deep_link_service.dart): `lib/services/bilibili_deep_link_service.dart`
- [Account and login](https://github.com/l1xu4n/focubili/blob/master/lib/features/profile/login_page.dart): `lib/features/profile/login_page.dart`
- [Bilibili services](https://github.com/l1xu4n/focubili/blob/master/lib/services/bilibili_service.dart): `lib/services/bilibili_service.dart`
- [Profile data](https://github.com/l1xu4n/focubili/blob/master/lib/features/profile/profile_page.dart): `lib/features/profile/profile_page.dart`

### Playback experience

- [Player page](https://github.com/l1xu4n/focubili/blob/master/lib/features/player/player_page.dart): `lib/features/player/player_page.dart`
- [Playback session](https://github.com/l1xu4n/focubili/blob/master/lib/features/player/player_playback_session.dart): `lib/features/player/player_playback_session.dart`
- [Player enhancements](https://github.com/l1xu4n/focubili/blob/master/lib/features/player/enhancements/player_enhancement_controller.dart): `lib/features/player/enhancements/player_enhancement_controller.dart`

### Focus and learning

- [Learning list](https://github.com/l1xu4n/focubili/blob/master/lib/features/learning/learning_list_page.dart): `lib/features/learning/learning_list_page.dart`
- [Video notes](https://github.com/l1xu4n/focubili/blob/master/lib/features/notes/video_note_composer.dart): `lib/features/notes/video_note_composer.dart`
- [Focus timer](https://github.com/l1xu4n/focubili/blob/master/lib/features/focus/focus_timer_controller.dart): `lib/features/focus/focus_timer_controller.dart`
- [Focus sessions](https://github.com/l1xu4n/focubili/blob/master/lib/services/focus_session_service.dart): `lib/services/focus_session_service.dart`

### Platform services

- [Android playback](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/NativePlaybackController.kt): `android/app/src/main/kotlin/com/focubili/app/NativePlaybackController.kt`
- [Focus reminders](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/FocusNotificationController.kt): `android/app/src/main/kotlin/com/focubili/app/FocusNotificationController.kt`
- [Reminder scheduler](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/FocusReminderScheduler.kt): `android/app/src/main/kotlin/com/focubili/app/FocusReminderScheduler.kt`
- [Android bridge](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/MainActivity.kt): `android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`
- [Android deep links](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/DeepLinkController.kt): `android/app/src/main/kotlin/com/focubili/app/DeepLinkController.kt`
- [Android cookies](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/BilibiliCookieController.kt): `android/app/src/main/kotlin/com/focubili/app/BilibiliCookieController.kt`
- [Device status](https://github.com/l1xu4n/focubili/blob/master/android/app/src/main/kotlin/com/focubili/app/DeviceStatusController.kt): `android/app/src/main/kotlin/com/focubili/app/DeviceStatusController.kt`
- [Windows runner](https://github.com/l1xu4n/focubili/blob/master/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/l1xu4n/focubili/blob/master/windows/runner/flutter_window.cpp): `windows/runner/flutter_window.cpp`

### Other components

- **Viewer**
- **Bilibili platform**

## Connections

- Viewer → Flutter app entry: opens (evidence: `README.md`)
- Flutter app entry → Navigation shell: starts
- Navigation shell → Home: shows (evidence: `README.md`)
- Home → Video search: opens search (evidence: `README.md`)
- Viewer → Video search: searches (evidence: `README.md`)
- Viewer → Link handling: opens link (evidence: `README.md`)
- Video search → Bilibili services: requests results (evidence: `README.md`)
- Link handling → Player page: opens video (evidence: `README.md`)
- Video search → Player page: opens result
- Player page → Bilibili services: loads details (evidence: `README.md`)
- Player page → Playback session: controls playback
- Playback session → Android playback: bridges playback
- Player page → Player enhancements: renders features
- Player page → Learning list: adds episode (evidence: `README.md`)
- Player page → Video notes: creates notes (evidence: `README.md`)
- Home → Learning list: continues learning (evidence: `README.md`)
- Viewer → Account and login: signs in (evidence: `README.md`)
- Account and login → Bilibili services: authenticates (evidence: `README.md`)
- Profile data → Bilibili services: loads account data (evidence: `README.md`)
- Viewer → Focus timer: starts session (evidence: `README.md`)
- Focus timer → Focus sessions: records session
- Focus timer → Focus reminders: schedules reminder
- Android bridge → Android playback: registers (evidence: `android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`)
- Android bridge → Android cookies: registers (evidence: `android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`)
- Android bridge → Device status: registers (evidence: `android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`)
- Android bridge → Focus reminders: registers (evidence: `android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`)
- Android bridge → Android deep links: registers (evidence: `android/app/src/main/kotlin/com/focubili/app/MainActivity.kt`)
- Focus reminders → Reminder scheduler: schedules alarms (evidence: `android/app/src/main/kotlin/com/focubili/app/FocusNotificationController.kt`)
- Android deep links → Flutter app entry: forwards links (evidence: `android/app/src/main/kotlin/com/focubili/app/DeepLinkController.kt`)
- Bilibili services → Bilibili platform: calls API (evidence: `README.md`)
- Windows runner → Flutter window: creates window (evidence: `windows/runner/main.cpp`)
