# zhoufuweigg/guoapp architecture

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

- Interactive diagram: https://gitdiagram.com/zhoufuweigg/guoapp
- Repository: https://github.com/zhoufuweigg/guoapp

## Overview

红果鉴 / 真果鉴是 Flutter 多端短剧与影视应用；站源请求、解析、下载和播放主要在设备本地完成。用户从浏览、搜索或推荐发现剧目，查看详情并播放或下载；追剧状态与播放进度也可保存，并可在局域网设备间同步。README 描述了 Flutter UI、Go 原生核心与 C ABI 桥接的职责，且明确记录了主要功能和站源能力。Flutter 源文件未提供，故以 README 支持的 lib 目录表示；未展示源码的实现关系不作确定推断。

Main entry points: [`lib`](https://github.com/zhoufuweigg/guoapp/tree/main/lib) (应用界面), [`native/core/app_runtime.go`](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_runtime.go) (核心分派), [`native/core/app_playback.go`](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_playback.go) (播放与流), [`native/bridge/main.go`](https://github.com/zhoufuweigg/guoapp/blob/main/native/bridge/main.go) (C ABI 桥接)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["内容发现"]
  node_flutter["应用界面"]
  node_browse["目录浏览<br/>[app_categories.go]"]
  node_search["搜索与联想"]
  node_recommend["红果推荐"]
  node_details["剧目详情"]
end

subgraph group_native["原生站源核心"]
  node_runtime["核心分派<br/>[app_runtime.go]"]
  node_providers["站源实现"]
  node_bridge["C ABI 桥接<br/>[main.go]"]
end

subgraph group_media["播放与下载"]
  node_playback["播放与流<br/>[app_playback.go]"]
  node_routes["播放路由"]
  node_stream["流媒体处理<br/>[app_stream.go]"]
  node_downloads["下载任务<br/>[app_downloads.go]"]
end

subgraph group_personal["个人数据与互联"]
  node_library[("追剧与历史<br/>[library.go]")]
  node_persistence[("本地持久化<br/>[app_persistence.go]")]
  node_lan["局域网互联<br/>[app_lan.go]"]
  node_settings["网络与设置<br/>[app_settings.go]"]
end

subgraph group_platform["平台接入"]
  node_windows["Windows 宿主<br/>[flutter_window.cpp]"]
  node_android["Android 宿主<br/>[MainActivity.kt]"]
  node_ios["iOS 宿主<br/>[AppDelegate.swift]"]
end

node_viewer(("观众"))

node_viewer -->|"使用"| node_flutter
node_flutter -->|"调用核心"| node_bridge
node_bridge -.->|"进入核心"| node_runtime
node_runtime -->|"分派目录"| node_browse
node_runtime -->|"分派搜索"| node_search
node_runtime -->|"分派详情"| node_details
node_runtime -->|"分派站源"| node_providers
node_runtime -.->|"提供推荐"| node_recommend
node_flutter -->|"请求播放"| node_playback
node_playback -.->|"选择路由"| node_routes
node_playback -.->|"获取媒体流"| node_stream
node_flutter -->|"管理下载"| node_downloads
node_flutter -->|"管理记录"| node_library
node_library -.->|"保存本地"| node_persistence
node_flutter -->|"同步设备"| node_lan
node_flutter -->|"配置网络"| node_settings
node_windows -->|"承载界面"| node_flutter
node_android -.->|"启动应用"| node_flutter
node_ios -.->|"启动应用"| node_flutter

click node_flutter "https://github.com/zhoufuweigg/guoapp/tree/main/lib"
click node_browse "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_categories.go"
click node_search "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/provider_hongguo_search.go"
click node_recommend "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_recommendations.go"
click node_details "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/provider_detail_metadata.go"
click node_runtime "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_runtime.go"
click node_providers "https://github.com/zhoufuweigg/guoapp/tree/main/native/core"
click node_bridge "https://github.com/zhoufuweigg/guoapp/blob/main/native/bridge/main.go"
click node_playback "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_playback.go"
click node_routes "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_playback_routes.go"
click node_stream "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_stream.go"
click node_downloads "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_downloads.go"
click node_library "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/library.go"
click node_persistence "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_persistence.go"
click node_lan "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_lan.go"
click node_settings "https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_settings.go"
click node_windows "https://github.com/zhoufuweigg/guoapp/blob/main/windows/runner/flutter_window.cpp"
click node_android "https://github.com/zhoufuweigg/guoapp/blob/main/android/app/src/main/kotlin/com/duanju/duanju_app/MainActivity.kt"
click node_ios "https://github.com/zhoufuweigg/guoapp/blob/main/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,node_browse,node_search,node_recommend,node_details toneBlue
class node_runtime,node_providers,node_bridge toneAmber
class node_playback,node_routes,node_stream,node_downloads toneMint
class node_library,node_persistence,node_lan,node_settings toneRose
class node_windows,node_android,node_ios,node_viewer toneIndigo
```

## Components

### 内容发现

- [应用界面](https://github.com/zhoufuweigg/guoapp/tree/main/lib): `lib`
- [目录浏览](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_categories.go): `native/core/app_categories.go`
- [搜索与联想](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/provider_hongguo_search.go): `native/core/provider_hongguo_search.go`
- [红果推荐](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_recommendations.go): `native/core/app_recommendations.go`
- [剧目详情](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/provider_detail_metadata.go): `native/core/provider_detail_metadata.go`

### 原生站源核心

- [核心分派](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_runtime.go): `native/core/app_runtime.go`
- [站源实现](https://github.com/zhoufuweigg/guoapp/tree/main/native/core): `native/core`
- [C ABI 桥接](https://github.com/zhoufuweigg/guoapp/blob/main/native/bridge/main.go): `native/bridge/main.go`

### 播放与下载

- [播放与流](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_playback.go): `native/core/app_playback.go`
- [播放路由](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_playback_routes.go): `native/core/app_playback_routes.go`
- [流媒体处理](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_stream.go): `native/core/app_stream.go`
- [下载任务](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_downloads.go): `native/core/app_downloads.go`

### 个人数据与互联

- [追剧与历史](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/library.go): `native/core/library.go`
- [本地持久化](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_persistence.go): `native/core/app_persistence.go`
- [局域网互联](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_lan.go): `native/core/app_lan.go`
- [网络与设置](https://github.com/zhoufuweigg/guoapp/blob/main/native/core/app_settings.go): `native/core/app_settings.go`

### 平台接入

- [Windows 宿主](https://github.com/zhoufuweigg/guoapp/blob/main/windows/runner/flutter_window.cpp): `windows/runner/flutter_window.cpp`
- [Android 宿主](https://github.com/zhoufuweigg/guoapp/blob/main/android/app/src/main/kotlin/com/duanju/duanju_app/MainActivity.kt): `android/app/src/main/kotlin/com/duanju/duanju_app/MainActivity.kt`
- [iOS 宿主](https://github.com/zhoufuweigg/guoapp/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **观众**

## Connections

- 观众 → 应用界面: 使用 (evidence: `README.md`)
- 应用界面 → C ABI 桥接: 调用核心 (evidence: `README.md`)
- C ABI 桥接 → 核心分派: 进入核心
- 核心分派 → 目录浏览: 分派目录 (evidence: `README.md`)
- 核心分派 → 搜索与联想: 分派搜索 (evidence: `README.md`)
- 核心分派 → 剧目详情: 分派详情 (evidence: `README.md`)
- 核心分派 → 站源实现: 分派站源 (evidence: `README.md`)
- 核心分派 → 红果推荐: 提供推荐
- 应用界面 → 播放与流: 请求播放 (evidence: `README.md`)
- 播放与流 → 播放路由: 选择路由
- 播放与流 → 流媒体处理: 获取媒体流
- 应用界面 → 下载任务: 管理下载 (evidence: `README.md`)
- 应用界面 → 追剧与历史: 管理记录 (evidence: `README.md`)
- 追剧与历史 → 本地持久化: 保存本地
- 应用界面 → 局域网互联: 同步设备 (evidence: `README.md`)
- 应用界面 → 网络与设置: 配置网络 (evidence: `README.md`)
- Windows 宿主 → 应用界面: 承载界面 (evidence: `windows/runner/flutter_window.cpp`)
- Android 宿主 → 应用界面: 启动应用
- iOS 宿主 → 应用界面: 启动应用
