# yaonieyo/doubao-account-pool architecture

> Architecture diagram of the GitHub repository yaonieyo/doubao-account-pool, 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/yaonieyo/doubao-account-pool
- Repository: https://github.com/yaonieyo/doubao-account-pool

## Overview

豆包账号池是一个本地 Electron 桌面应用，也提供本机 HTTP 视频生成 API。主要流程是工作流客户端提交生成请求，应用选择可用账号并驱动隔离的豆包会话，验证视频结果后返回状态与可用 MP4。图中依据 README 和所示源码标注了已见的调用与数据交互；部分能力（如结果恢复、界面日志）由 README 支持，但其具体实现链路未完整展示。

Main entry points: [`electron/executor.ts`](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/executor.ts) (豆包任务执行), [`electron/main.ts`](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/main.ts) (本地 HTTP API), [`electron/database.ts`](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/database.ts) (应用数据存储), [`electron/watermark.ts`](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/watermark.ts) (去水印与验证)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["界面与接口"]
  node_dashboard["管理界面<br/>[App.vue]"]
  node_renderer["界面启动<br/>[main.ts]"]
  node_preload["IPC 桥接<br/>[preload.cts]"]
  node_httpapi["本地 HTTP API<br/>[main.ts]"]
  node_main["Electron 主进程<br/>[main.ts]"]
end

subgraph group_management["账号与持久化"]
  node_scheduler["账号任务调度"]
  node_database[("应用数据存储<br/>[database.ts]")]
  node_types["领域数据类型<br/>[types.ts]"]
end

subgraph group_generation["生成执行"]
  node_executor["豆包任务执行<br/>[executor.ts]"]
  node_page_state["页面状态识别"]
end

subgraph group_results["结果处理"]
  node_watermark["去水印与验证<br/>[watermark.ts]"]
  node_public_result["API 结果映射<br/>[public-api.ts]"]
end

node_client(("本地工作流"))
node_doubao["豆包平台"]
node_external_watermark["去水印服务"]

node_client -->|"提交生成请求"| node_httpapi
node_httpapi -->|"执行任务"| node_executor
node_httpapi -->|"读写请求与额度"| node_database
node_httpapi -->|"映射响应"| node_public_result
node_httpapi -->|"解析视频地址"| node_watermark
node_executor -->|"更新任务数据"| node_database
node_executor -->|"调度账号任务"| node_scheduler
node_executor -->|"识别页面状态"| node_page_state
node_executor -->|"解析并验证视频"| node_watermark
node_executor -.->|"驱动隔离会话"| node_doubao
node_watermark -->|"请求去水印"| node_external_watermark
node_main -->|"初始化与管理"| node_database
node_main -->|"创建执行器"| node_executor
node_renderer -->|"挂载界面"| node_dashboard
node_dashboard -->|"调用管理 API"| node_preload
node_preload -.->|"发送 IPC 请求"| node_main
node_database -->|"持久化领域数据"| node_types

click node_dashboard "https://github.com/yaonieyo/doubao-account-pool/blob/main/src/App.vue"
click node_renderer "https://github.com/yaonieyo/doubao-account-pool/blob/main/src/main.ts"
click node_preload "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/preload/preload.cts"
click node_httpapi "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/main.ts"
click node_main "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/main.ts"
click node_scheduler "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/account-scheduler.ts"
click node_database "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/database.ts"
click node_types "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/types.ts"
click node_executor "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/executor.ts"
click node_page_state "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/doubao-page-state.ts"
click node_watermark "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/watermark.ts"
click node_public_result "https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/public-api.ts"

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_dashboard,node_renderer,node_preload,node_httpapi,node_main toneBlue
class node_scheduler,node_database,node_types toneAmber
class node_executor,node_page_state toneMint
class node_watermark,node_public_result toneRose
class node_client,node_doubao,node_external_watermark toneIndigo
```

## Components

### 界面与接口

- [管理界面](https://github.com/yaonieyo/doubao-account-pool/blob/main/src/App.vue): `src/App.vue`
- [界面启动](https://github.com/yaonieyo/doubao-account-pool/blob/main/src/main.ts): `src/main.ts`
- [IPC 桥接](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/preload/preload.cts): `electron/preload/preload.cts`
- [本地 HTTP API](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/main.ts): `electron/main.ts`
- [Electron 主进程](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/main.ts): `electron/main.ts`

### 账号与持久化

- [账号任务调度](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/account-scheduler.ts): `electron/account-scheduler.ts`
- [应用数据存储](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/database.ts): `electron/database.ts`
- [领域数据类型](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/types.ts): `electron/types.ts`

### 生成执行

- [豆包任务执行](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/executor.ts): `electron/executor.ts`
- [页面状态识别](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/doubao-page-state.ts): `electron/doubao-page-state.ts`

### 结果处理

- [去水印与验证](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/watermark.ts): `electron/watermark.ts`
- [API 结果映射](https://github.com/yaonieyo/doubao-account-pool/blob/main/electron/public-api.ts): `electron/public-api.ts`

### Other components

- **本地工作流**
- **豆包平台**
- **去水印服务**

## Connections

- 本地工作流 → 本地 HTTP API: 提交生成请求 (evidence: `README.md`)
- 本地 HTTP API → 豆包任务执行: 执行任务 (evidence: `electron/main.ts`)
- 本地 HTTP API → 应用数据存储: 读写请求与额度 (evidence: `electron/main.ts`)
- 本地 HTTP API → API 结果映射: 映射响应 (evidence: `electron/main.ts`)
- 本地 HTTP API → 去水印与验证: 解析视频地址 (evidence: `electron/main.ts`)
- 豆包任务执行 → 应用数据存储: 更新任务数据 (evidence: `electron/executor.ts`)
- 豆包任务执行 → 账号任务调度: 调度账号任务 (evidence: `electron/executor.ts`)
- 豆包任务执行 → 页面状态识别: 识别页面状态 (evidence: `electron/executor.ts`)
- 豆包任务执行 → 去水印与验证: 解析并验证视频 (evidence: `electron/executor.ts`)
- 豆包任务执行 → 豆包平台: 驱动隔离会话
- 去水印与验证 → 去水印服务: 请求去水印 (evidence: `electron/watermark.ts`)
- Electron 主进程 → 应用数据存储: 初始化与管理 (evidence: `electron/main.ts`)
- Electron 主进程 → 豆包任务执行: 创建执行器 (evidence: `electron/main.ts`)
- 界面启动 → 管理界面: 挂载界面 (evidence: `src/main.ts`)
- 管理界面 → IPC 桥接: 调用管理 API (evidence: `src/App.vue`)
- IPC 桥接 → Electron 主进程: 发送 IPC 请求
- 应用数据存储 → 领域数据类型: 持久化领域数据 (evidence: `electron/database.ts`)
