# ming-qwq520/jmcomic-flutter architecture

> Architecture diagram of the GitHub repository ming-qwq520/jmcomic-flutter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ming-qwq520/jmcomic-flutter
- Repository: https://github.com/ming-qwq520/jmcomic-flutter

## Overview

JMComic-Flutter is a cross-platform Flutter manga client. Users discover or search works, open album details, then read online or download chapters for the offline bookshelf; the app also supports accounts, comments, favorites, sign-in, and personalization. The UI is organized around a navigation shell and shared state, with the JM protocol layer handling API transport and image/domain concerns. README-described capabilities are included where their source was not sampled; those links are intentionally limited to documented ownership rather than assumed call chains.

Main entry points: [`lib/core/protocol/jm_api.dart`](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_api.dart) (API facade), [`lib/shell/root_page.dart`](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/shell/root_page.dart) (Navigation shell), [`lib/core/protocol/jm_client.dart`](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_client.dart) (Transport client), [`lib/pages/settings/settings_page.dart`](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/pages/settings/settings_page.dart) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_reader["Reader<br/>[reader_page.dart]"]
  node_home["Home and week"]
  node_browse["Explore and search"]
  node_album["Album and comments"]
  node_offline["Downloads and local reader"]
  node_accounts["Account features"]
  node_signblogs["Sign-in and blogs"]
  node_settings["Settings<br/>[settings_page.dart]"]
  node_root["Navigation shell<br/>[root_page.dart]"]
  node_state["App state<br/>[app_state.dart]"]
end

subgraph group_protocol["JM protocol"]
  node_api["API facade<br/>[jm_api.dart]"]
  node_client["Transport client<br/>[jm_client.dart]"]
  node_domain["Domain config<br/>[jm_domain.dart]"]
  node_crypto["Signing and crypto<br/>[jm_crypto.dart]"]
  node_models["API models<br/>[models.dart]"]
  node_scramble["Image unscrambling<br/>[scramble.dart]"]
end

subgraph group_services["App services"]
  node_downloads["Download manager"]
  node_image_store["Image storage<br/>[image_store.dart]"]
  node_local_store["Local preferences<br/>[local_store.dart]"]
  node_github["Update service"]
  node_lock["App lock"]
  node_storage["Storage and sharing"]
  node_widget["Shortcut bridge<br/>[widget_bridge.dart]"]
end

subgraph group_native["Platform integration"]
  node_activity["Android activity bridge<br/>[MainActivity.kt]"]
end

node_user(("Reader user"))
node_jm_service["JM content service"]
node_github_service["GitHub"]
node_platform_auth["Platform biometrics"]

node_user -->|"opens app"| node_root
node_root -->|"navigates"| node_home
node_root -->|"navigates"| node_browse
node_root -->|"navigates"| node_offline
node_root -->|"navigates"| node_accounts
node_root -->|"navigates"| node_settings
node_home -->|"requests recommendations"| node_api
node_browse -->|"searches catalog"| node_api
node_album -->|"requests details and comments"| node_api
node_reader -->|"requests chapters and images"| node_api
node_accounts -->|"requests account data"| node_api
node_signblogs -->|"requests sign-in and blogs"| node_api
node_api -->|"sends API requests"| node_client
node_client -->|"exchanges data"| node_jm_service
node_client -->|"signs and decrypts"| node_crypto
node_client -->|"resolves service domains"| node_domain
node_api -->|"uses models"| node_models
node_offline -->|"manages downloads"| node_downloads
node_downloads -->|"downloads chapter images"| node_client
node_downloads -->|"saves images"| node_image_store
node_downloads -->|"restores image order"| node_scramble
node_offline -->|"reads offline images"| node_image_store
node_settings -->|"updates preferences"| node_state
node_state -->|"persists settings"| node_local_store
node_settings -->|"configures app lock"| node_lock
node_lock -->|"requests authentication"| node_platform_auth
node_settings -->|"checks for updates"| node_github
node_github -->|"fetches release data"| node_github_service
node_github -->|"hands off APK install"| node_storage
node_storage -.->|"calls storage methods"| node_activity
node_reader -.->|"controls reader platform features"| node_activity
node_root -.->|"receives shortcut actions"| node_widget
node_widget -.->|"exchanges shortcut events"| node_activity

click node_reader "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/pages/reader/reader_page.dart"
click node_home "https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/home"
click node_browse "https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/explore"
click node_album "https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/album"
click node_offline "https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/download"
click node_accounts "https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/user"
click node_signblogs "https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/sign"
click node_settings "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/pages/settings/settings_page.dart"
click node_root "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/shell/root_page.dart"
click node_state "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/state/app_state.dart"
click node_api "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_api.dart"
click node_client "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_client.dart"
click node_domain "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_domain.dart"
click node_crypto "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_crypto.dart"
click node_models "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/models.dart"
click node_scramble "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/utils/scramble.dart"
click node_downloads "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/download_manager.dart"
click node_image_store "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/image_store.dart"
click node_local_store "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/local_store.dart"
click node_github "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/github_service.dart"
click node_lock "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/app_lock_service.dart"
click node_storage "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/storage_service.dart"
click node_widget "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/widget_bridge.dart"
click node_activity "https://github.com/ming-qwq520/jmcomic-flutter/blob/main/android/app/src/main/kotlin/com/ming/jmcomic/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_reader,node_home,node_browse,node_album,node_offline,node_accounts,node_signblogs,node_settings,node_root,node_state,node_user toneBlue
class node_api,node_client,node_domain,node_crypto,node_models,node_scramble toneAmber
class node_downloads,node_image_store,node_local_store,node_github,node_lock,node_storage,node_widget toneMint
class node_activity toneRose
class node_jm_service,node_github_service,node_platform_auth toneIndigo
```

## Components

### App experience

- [Reader](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/pages/reader/reader_page.dart): `lib/pages/reader/reader_page.dart`
- [Home and week](https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/home): `lib/pages/home`
- [Explore and search](https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/explore): `lib/pages/explore`
- [Album and comments](https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/album): `lib/pages/album`
- [Downloads and local reader](https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/download): `lib/pages/download`
- [Account features](https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/user): `lib/pages/user`
- [Sign-in and blogs](https://github.com/ming-qwq520/jmcomic-flutter/tree/main/lib/pages/sign): `lib/pages/sign`
- [Settings](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/pages/settings/settings_page.dart): `lib/pages/settings/settings_page.dart`
- [Navigation shell](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/shell/root_page.dart): `lib/shell/root_page.dart`
- [App state](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/state/app_state.dart): `lib/state/app_state.dart`

### JM protocol

- [API facade](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_api.dart): `lib/core/protocol/jm_api.dart`
- [Transport client](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_client.dart): `lib/core/protocol/jm_client.dart`
- [Domain config](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_domain.dart): `lib/core/protocol/jm_domain.dart`
- [Signing and crypto](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/jm_crypto.dart): `lib/core/protocol/jm_crypto.dart`
- [API models](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/protocol/models.dart): `lib/core/protocol/models.dart`
- [Image unscrambling](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/core/utils/scramble.dart): `lib/core/utils/scramble.dart`

### App services

- [Download manager](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/download_manager.dart): `lib/services/download_manager.dart`
- [Image storage](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/image_store.dart): `lib/services/image_store.dart`
- [Local preferences](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/local_store.dart): `lib/services/local_store.dart`
- [Update service](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/github_service.dart): `lib/services/github_service.dart`
- [App lock](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/app_lock_service.dart): `lib/services/app_lock_service.dart`
- [Storage and sharing](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/storage_service.dart): `lib/services/storage_service.dart`
- [Shortcut bridge](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/lib/services/widget_bridge.dart): `lib/services/widget_bridge.dart`

### Platform integration

- [Android activity bridge](https://github.com/ming-qwq520/jmcomic-flutter/blob/main/android/app/src/main/kotlin/com/ming/jmcomic/MainActivity.kt): `android/app/src/main/kotlin/com/ming/jmcomic/MainActivity.kt`

### Other components

- **Reader user**
- **JM content service**
- **GitHub**
- **Platform biometrics**

## Connections

- Reader user → Navigation shell: opens app
- Navigation shell → Home and week: navigates
- Navigation shell → Explore and search: navigates
- Navigation shell → Downloads and local reader: navigates
- Navigation shell → Account features: navigates
- Navigation shell → Settings: navigates
- Home and week → API facade: requests recommendations
- Explore and search → API facade: searches catalog
- Album and comments → API facade: requests details and comments
- Reader → API facade: requests chapters and images
- Account features → API facade: requests account data
- Sign-in and blogs → API facade: requests sign-in and blogs
- API facade → Transport client: sends API requests
- Transport client → JM content service: exchanges data
- Transport client → Signing and crypto: signs and decrypts
- Transport client → Domain config: resolves service domains
- API facade → API models: uses models
- Downloads and local reader → Download manager: manages downloads
- Download manager → Transport client: downloads chapter images
- Download manager → Image storage: saves images
- Download manager → Image unscrambling: restores image order
- Downloads and local reader → Image storage: reads offline images
- Settings → App state: updates preferences
- App state → Local preferences: persists settings
- Settings → App lock: configures app lock
- App lock → Platform biometrics: requests authentication
- Settings → Update service: checks for updates
- Update service → GitHub: fetches release data
- Update service → Storage and sharing: hands off APK install
- Storage and sharing → Android activity bridge: calls storage methods
- Reader → Android activity bridge: controls reader platform features
- Navigation shell → Shortcut bridge: receives shortcut actions
- Shortcut bridge → Android activity bridge: exchanges shortcut events
