# liupan1890/aliyunpan architecture

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

- Interactive diagram: https://gitdiagram.com/liupan1890/aliyunpan
- Repository: https://github.com/liupan1890/aliyunpan

## Overview

小白羊是面向桌面的阿里云盘客户端。用户在主界面浏览和管理网盘文件，也可登录账号、分享文件、上传下载及预览媒体；后台工作页承接传输任务。README还记录了远程 Aria2、回收站、收藏、批量改名、解压和RSS类工具等能力。图中已采样的调用以源码索引或摘录为依据；未采样功能只保留其明确的产品模块，不推断内部调用关系。

Main entry points: [`src/renderer/pan/pandal.ts`](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/pan/pandal.ts) (网盘交互协调), [`src/renderer/main.ts`](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/main.ts) (渲染入口), [`src/renderer/workerpage/workercmd.ts`](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/workerpage/workercmd.ts) (后台任务分发), [`src/renderer/aliapi/dirfilelist.ts`](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/dirfilelist.ts) (目录与列表API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["桌面与界面"]
  node_electron["Electron主进程<br/>[mainfile.ts]"]
  node_renderer["渲染入口<br/>[main.ts]"]
  node_pages["应用页面路由<br/>[App.vue]"]
  node_stores["应用状态<br/>[index.ts]"]
end

subgraph group_drive["网盘管理"]
  node_panui["网盘浏览界面<br/>[PanRight.vue]"]
  node_pandl["网盘交互协调<br/>[pandal.ts]"]
  node_tree["文件树与排序<br/>[treestore.ts]"]
  node_fileapi["文件操作API<br/>[file.ts]"]
  node_dirapi["目录与列表API<br/>[dirfilelist.ts]"]
  node_aliapi["阿里云盘服务<br/>[alihttp.ts]"]
  node_db[("本地缓存数据库<br/>[db.ts]")]
end

subgraph group_transfer["传输与任务"]
  node_worker["后台任务分发<br/>[workercmd.ts]"]
  node_upload["上传任务协调<br/>[uploadingdata.ts]"]
  node_downui["传输任务界面<br/>[index.vue]"]
end

subgraph group_account["账号与分享"]
  node_userauth["账号登录管理<br/>[userdal.ts]"]
  node_share["分享与关注<br/>[index.vue]"]
end

subgraph group_tools["预览与工具"]
  node_rss["网盘维护工具<br/>[index.vue]"]
  node_preview["文件预览与播放<br/>[PageVideo.vue]"]
end

node_user(("用户"))
node_aria(("远程 Aria2"))

node_user -->|"启动使用"| node_renderer
node_renderer -->|"挂载应用"| node_pages
node_renderer -->|"派发工作页"| node_worker
node_pages -->|"读取状态"| node_stores
node_user -->|"浏览管理"| node_panui
node_panui -->|"调用交互"| node_pandl
node_pandl -->|"调用文件操作"| node_fileapi
node_pandl -->|"获取目录列表"| node_dirapi
node_pandl -->|"更新文件树"| node_tree
node_pandl -->|"读写缓存"| node_db
node_tree -->|"读取目录缓存"| node_db
node_dirapi -->|"请求云端"| node_aliapi
node_worker -->|"加载目录"| node_dirapi
node_worker -->|"处理上传命令"| node_upload
node_user -->|"管理传输"| node_downui
node_user -->|"登录账号"| node_userauth
node_user -->|"管理分享"| node_share
node_user -.->|"执行维护工具"| node_rss
node_user -->|"预览播放"| node_preview
node_user -.->|"远程下载"| node_aria
node_electron -.->|"提供桌面容器"| node_renderer

click node_electron "https://github.com/liupan1890/aliyunpan/blob/v3/src/main/mainfile.ts"
click node_renderer "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/main.ts"
click node_pages "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/App.vue"
click node_stores "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/store/index.ts"
click node_panui "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/pan/PanRight.vue"
click node_pandl "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/pan/pandal.ts"
click node_tree "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/store/treestore.ts"
click node_fileapi "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/file.ts"
click node_dirapi "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/dirfilelist.ts"
click node_aliapi "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/alihttp.ts"
click node_db "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/utils/db.ts"
click node_worker "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/workerpage/workercmd.ts"
click node_upload "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/transfer/uploadingdata.ts"
click node_downui "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/down/index.vue"
click node_userauth "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/user/userdal.ts"
click node_share "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/share/index.vue"
click node_rss "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/rss/index.vue"
click node_preview "https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/layout/PageVideo.vue"

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_electron,node_renderer,node_pages,node_stores toneBlue
class node_panui,node_pandl,node_tree,node_fileapi,node_dirapi,node_aliapi,node_db toneAmber
class node_worker,node_upload,node_downui toneMint
class node_userauth,node_share toneRose
class node_rss,node_preview,node_user,node_aria toneIndigo
```

## Components

### 桌面与界面

- [Electron主进程](https://github.com/liupan1890/aliyunpan/blob/v3/src/main/mainfile.ts): `src/main/mainfile.ts`
- [渲染入口](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/main.ts): `src/renderer/main.ts`
- [应用页面路由](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/App.vue): `src/renderer/App.vue`
- [应用状态](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/store/index.ts): `src/renderer/store/index.ts`

### 网盘管理

- [网盘浏览界面](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/pan/PanRight.vue): `src/renderer/pan/PanRight.vue`
- [网盘交互协调](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/pan/pandal.ts): `src/renderer/pan/pandal.ts`
- [文件树与排序](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/store/treestore.ts): `src/renderer/store/treestore.ts`
- [文件操作API](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/file.ts): `src/renderer/aliapi/file.ts`
- [目录与列表API](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/dirfilelist.ts): `src/renderer/aliapi/dirfilelist.ts`
- [阿里云盘服务](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/aliapi/alihttp.ts): `src/renderer/aliapi/alihttp.ts`
- [本地缓存数据库](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/utils/db.ts): `src/renderer/utils/db.ts`

### 传输与任务

- [后台任务分发](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/workerpage/workercmd.ts): `src/renderer/workerpage/workercmd.ts`
- [上传任务协调](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/transfer/uploadingdata.ts): `src/renderer/transfer/uploadingdata.ts`
- [传输任务界面](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/down/index.vue): `src/renderer/down/index.vue`

### 账号与分享

- [账号登录管理](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/user/userdal.ts): `src/renderer/user/userdal.ts`
- [分享与关注](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/share/index.vue): `src/renderer/share/index.vue`

### 预览与工具

- [网盘维护工具](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/rss/index.vue): `src/renderer/rss/index.vue`
- [文件预览与播放](https://github.com/liupan1890/aliyunpan/blob/v3/src/renderer/layout/PageVideo.vue): `src/renderer/layout/PageVideo.vue`

### Other components

- **用户**
- **远程 Aria2**

## Connections

- 用户 → 渲染入口: 启动使用
- 渲染入口 → 应用页面路由: 挂载应用 (evidence: `src/renderer/main.ts`)
- 渲染入口 → 后台任务分发: 派发工作页 (evidence: `src/renderer/main.ts`)
- 应用页面路由 → 应用状态: 读取状态 (evidence: `src/renderer/App.vue`)
- 用户 → 网盘浏览界面: 浏览管理
- 网盘浏览界面 → 网盘交互协调: 调用交互 (evidence: `src/renderer/pan/PanRight.vue`)
- 网盘交互协调 → 文件操作API: 调用文件操作 (evidence: `src/renderer/pan/pandal.ts`)
- 网盘交互协调 → 目录与列表API: 获取目录列表 (evidence: `src/renderer/pan/pandal.ts`)
- 网盘交互协调 → 文件树与排序: 更新文件树 (evidence: `src/renderer/pan/pandal.ts`)
- 网盘交互协调 → 本地缓存数据库: 读写缓存 (evidence: `src/renderer/pan/pandal.ts`)
- 文件树与排序 → 本地缓存数据库: 读取目录缓存 (evidence: `src/renderer/store/treestore.ts`)
- 目录与列表API → 阿里云盘服务: 请求云端 (evidence: `src/renderer/aliapi/dirlist.ts`)
- 后台任务分发 → 目录与列表API: 加载目录 (evidence: `src/renderer/workerpage/workercmd.ts`)
- 后台任务分发 → 上传任务协调: 处理上传命令 (evidence: `src/renderer/workerpage/workercmd.ts`)
- 用户 → 传输任务界面: 管理传输
- 用户 → 账号登录管理: 登录账号
- 用户 → 分享与关注: 管理分享
- 用户 → 网盘维护工具: 执行维护工具
- 用户 → 文件预览与播放: 预览播放
- 用户 → 远程 Aria2: 远程下载
- Electron主进程 → 渲染入口: 提供桌面容器
