# 2697a/bujuan architecture

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

- Interactive diagram: https://gitdiagram.com/2697a/bujuan
- Repository: https://github.com/2697a/bujuan

## Overview

Bujuan is a cross-platform Flutter client for NetEase Cloud Music. The user-facing workflow spans account login and music discovery, then playlist or track playback; the README also names daily recommendations, Private FM, radio, cloud drive, artists, albums, and search. The graph maps these capabilities to their apparent page modules and highlights playback, local history, and proxy layers. The README documents product features, but Dart implementations were not excerpted, so internal calls between those modules are not asserted. Native host nodes show Flutter entry points rather than product logic.

Main entry points: [`lib/main.dart`](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/main.dart) (Flutter application), [`lib/common/bujuan_music_handler.dart`](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/bujuan_music_handler.dart) (Music handler), [`lib/pages/play/play_page.dart`](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/play_page.dart) (Player screen), [`lib/pages/home/home_page.dart`](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/home/home_page.dart) (Home discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_music_experience["Music experience"]
  node_login["Account login<br/>[login_page.dart]"]
  node_home["Home discovery<br/>[home_page.dart]"]
  node_daily["Daily picks<br/>[today_page.dart]"]
  node_artist["Artist pages<br/>[arist_page.dart]"]
  node_playlist["Playlists<br/>[playlist_page.dart]"]
  node_mv["Music videos<br/>[mv_page.dart]"]
  node_user_page["User library<br/>[user_page.dart]"]
end

subgraph group_playback["Playback"]
  node_play_page["Player screen<br/>[play_page.dart]"]
  node_desktop_player["Desktop player"]
  node_lyrics["Lyrics display<br/>[lyric.dart]"]
  node_music_handler["Music handler"]
  node_mediakit_handler["MediaKit handler"]
end

subgraph group_app_services["App services"]
  node_dao["Local data access<br/>[dao.dart]"]
  node_played_info[("Playback history")]
  node_local_proxy["Local proxy"]
  node_router["App routing<br/>[app_router.dart]"]
end

subgraph group_native_hosts["Native hosts"]
  node_main_app["Flutter application<br/>[main.dart]"]
  node_android_host["Android host<br/>[MainActivity.kt]"]
  node_ios_host["iOS host<br/>[AppDelegate.swift]"]
  node_linux_host["Linux host<br/>[my_application.h]"]
  node_macos_plugins["macOS plugins"]
  node_windows_host["Windows Flutter window<br/>[flutter_window.h]"]
  node_windows_window["Windows windowing<br/>[win32_window.h]"]
end

node_listener(("Listener"))

node_listener -->|"signs in"| node_login
node_listener -->|"discovers music"| node_home
node_listener -->|"browses artists"| node_artist
node_listener -->|"browses playlists"| node_playlist
node_listener -.->|"watches videos"| node_mv
node_listener -.->|"opens library"| node_user_page
node_home -->|"offers recommendations"| node_daily
node_listener -->|"plays music"| node_play_page
node_play_page -.->|"uses handler"| node_music_handler
node_desktop_player -.->|"uses handler"| node_music_handler
node_play_page -.->|"shows lyrics"| node_lyrics
node_music_handler -.->|"selects implementation"| node_mediakit_handler
node_music_handler -.->|"uses proxy"| node_local_proxy
node_dao -.->|"stores history"| node_played_info
node_main_app -.->|"configures routes"| node_router
node_android_host -.->|"hosts Flutter"| node_main_app
node_ios_host -.->|"hosts Flutter"| node_main_app
node_linux_host -.->|"hosts Flutter"| node_main_app
node_macos_plugins -.->|"registers plugins"| node_main_app
node_windows_host -->|"extends window"| node_windows_window

click node_login "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/login/login_page.dart"
click node_home "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/home/home_page.dart"
click node_daily "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/home/today/today_page.dart"
click node_artist "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/arist/arist_page.dart"
click node_playlist "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/playlist/playlist_page.dart"
click node_mv "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/mv/mv_page.dart"
click node_user_page "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/user/user_page.dart"
click node_play_page "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/play_page.dart"
click node_desktop_player "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/desktop_play_page.dart"
click node_lyrics "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/lyric.dart"
click node_music_handler "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/bujuan_music_handler.dart"
click node_mediakit_handler "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/bujuan_music_handler_mediakit.dart"
click node_dao "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/dao/dao.dart"
click node_played_info "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/dao/played_info_entity.dart"
click node_local_proxy "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/local_proxy_service.dart"
click node_router "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/router/app_router.dart"
click node_main_app "https://github.com/2697a/bujuan/blob/feature/new-ui/lib/main.dart"
click node_android_host "https://github.com/2697a/bujuan/blob/feature/new-ui/android/app/src/main/kotlin/com/sixbugs/bujuan/bujuan_music/MainActivity.kt"
click node_ios_host "https://github.com/2697a/bujuan/blob/feature/new-ui/ios/Runner/AppDelegate.swift"
click node_linux_host "https://github.com/2697a/bujuan/blob/feature/new-ui/linux/runner/my_application.h"
click node_macos_plugins "https://github.com/2697a/bujuan/blob/feature/new-ui/macos/Flutter/GeneratedPluginRegistrant.swift"
click node_windows_host "https://github.com/2697a/bujuan/blob/feature/new-ui/windows/runner/flutter_window.h"
click node_windows_window "https://github.com/2697a/bujuan/blob/feature/new-ui/windows/runner/win32_window.h"

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_login,node_home,node_daily,node_artist,node_playlist,node_mv,node_user_page toneBlue
class node_play_page,node_desktop_player,node_lyrics,node_music_handler,node_mediakit_handler toneAmber
class node_dao,node_played_info,node_local_proxy,node_router toneMint
class node_main_app,node_android_host,node_ios_host,node_linux_host,node_macos_plugins,node_windows_host,node_windows_window toneRose
class node_listener toneIndigo
```

## Components

### Music experience

- [Account login](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/login/login_page.dart): `lib/pages/login/login_page.dart`
- [Home discovery](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/home/home_page.dart): `lib/pages/home/home_page.dart`
- [Daily picks](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/home/today/today_page.dart): `lib/pages/home/today/today_page.dart`
- [Artist pages](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/arist/arist_page.dart): `lib/pages/arist/arist_page.dart`
- [Playlists](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/playlist/playlist_page.dart): `lib/pages/playlist/playlist_page.dart`
- [Music videos](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/mv/mv_page.dart): `lib/pages/mv/mv_page.dart`
- [User library](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/user/user_page.dart): `lib/pages/user/user_page.dart`

### Playback

- [Player screen](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/play_page.dart): `lib/pages/play/play_page.dart`
- [Desktop player](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/desktop_play_page.dart): `lib/pages/play/desktop_play_page.dart`
- [Lyrics display](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/pages/play/lyric.dart): `lib/pages/play/lyric.dart`
- [Music handler](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/bujuan_music_handler.dart): `lib/common/bujuan_music_handler.dart`
- [MediaKit handler](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/bujuan_music_handler_mediakit.dart): `lib/common/bujuan_music_handler_mediakit.dart`

### App services

- [Local data access](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/dao/dao.dart): `lib/dao/dao.dart`
- [Playback history](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/dao/played_info_entity.dart): `lib/dao/played_info_entity.dart`
- [Local proxy](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/common/local_proxy_service.dart): `lib/common/local_proxy_service.dart`
- [App routing](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/router/app_router.dart): `lib/router/app_router.dart`

### Native hosts

- [Flutter application](https://github.com/2697a/bujuan/blob/feature/new-ui/lib/main.dart): `lib/main.dart`
- [Android host](https://github.com/2697a/bujuan/blob/feature/new-ui/android/app/src/main/kotlin/com/sixbugs/bujuan/bujuan_music/MainActivity.kt): `android/app/src/main/kotlin/com/sixbugs/bujuan/bujuan_music/MainActivity.kt`
- [iOS host](https://github.com/2697a/bujuan/blob/feature/new-ui/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`
- [Linux host](https://github.com/2697a/bujuan/blob/feature/new-ui/linux/runner/my_application.h): `linux/runner/my_application.h`
- [macOS plugins](https://github.com/2697a/bujuan/blob/feature/new-ui/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`
- [Windows Flutter window](https://github.com/2697a/bujuan/blob/feature/new-ui/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Windows windowing](https://github.com/2697a/bujuan/blob/feature/new-ui/windows/runner/win32_window.h): `windows/runner/win32_window.h`

### Other components

- **Listener**

## Connections

- Listener → Account login: signs in (evidence: `README.md`)
- Listener → Home discovery: discovers music (evidence: `README.md`)
- Listener → Artist pages: browses artists (evidence: `README.md`)
- Listener → Playlists: browses playlists (evidence: `README.md`)
- Listener → Music videos: watches videos
- Listener → User library: opens library
- Home discovery → Daily picks: offers recommendations (evidence: `README.md`)
- Listener → Player screen: plays music (evidence: `README.md`)
- Player screen → Music handler: uses handler
- Desktop player → Music handler: uses handler
- Player screen → Lyrics display: shows lyrics
- Music handler → MediaKit handler: selects implementation
- Music handler → Local proxy: uses proxy
- Local data access → Playback history: stores history
- Flutter application → App routing: configures routes
- Android host → Flutter application: hosts Flutter
- iOS host → Flutter application: hosts Flutter
- Linux host → Flutter application: hosts Flutter
- macOS plugins → Flutter application: registers plugins
- Windows Flutter window → Windows windowing: extends window (evidence: `windows/runner/flutter_window.h`)
