# xongge/stardewmodmanager architecture

> Architecture diagram of the GitHub repository xongge/stardewmodmanager, 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/xongge/stardewmodmanager
- Repository: https://github.com/xongge/stardewmodmanager

## Overview

这是一个面向 Windows 的星露谷物语 Mod 管理器。用户从主窗口进入设置并配置游戏路径与凭据，再扫描、管理或翻译 Mods，维护 SMAPI，最后通过集成控制台启动游戏并查看日志；另提供 Mod 与软件更新检查。图中调用关系依据 README 和 SOURCE INDEX 中可见的引用；部分实现未采样，因此未推断更深层调用。

Main entry points: [`app/ui/main_window.py`](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/main_window.py) (主窗口导航), [`app/context.py`](https://github.com/xongge/stardewmodmanager/blob/main/app/context.py) (应用上下文), [`app/ui/pages/mods_page.py`](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/mods_page.py) (模组管理页), [`app/ai.py`](https://github.com/xongge/stardewmodmanager/blob/main/app/ai.py) (AI 名称翻译)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["桌面界面"]
  node_main["应用入口<br/>[main.py]"]
  node_window["主窗口导航<br/>[main_window.py]"]
  node_animations["界面动画<br/>[anim.py]"]
  node_theme["主题配色<br/>[theme.py]"]
  node_mods_page["模组管理页<br/>[mods_page.py]"]
  node_config_editor["配置编辑器<br/>[config_editor.py]"]
  node_settings_page["设置页<br/>[settings_page.py]"]
  node_console_page["运行控制台页<br/>[console_page.py]"]
  node_updater_page["SMAPI 更新页<br/>[updater_page.py]"]
  node_update_dialog["软件更新对话框<br/>[dialog_update.py]"]
end

subgraph group_mods["Mod 管理"]
  node_mod_scan["Mod 扫描与清单<br/>[mods.py]"]
  node_mod_config["Mod 配置与本地化<br/>[modconfig.py]"]
  node_translation["AI 名称翻译<br/>[ai.py]"]
  node_mod_updates["Mod 更新检测<br/>[updates.py]"]
end

subgraph group_game["游戏与 SMAPI"]
  node_game_runner["游戏运行与日志<br/>[game.py]"]
  node_smapi["SMAPI 安装维护<br/>[smapi.py]"]
end

subgraph group_services["配置与服务"]
  node_context["应用上下文<br/>[context.py]"]
  node_config["配置与数据目录<br/>[config.py]"]
  node_self_update["软件更新检查<br/>[selfupdate.py]"]
end

node_user(("玩家"))
node_ai_service{{"OpenAI 兼容接口"}}
node_nexus{{"Nexus Mods"}}
node_github{{"GitHub Releases"}}
node_stardew["星露谷游戏"]

node_user -->|"启动"| node_main
node_main -->|"创建窗口"| node_window
node_window -->|"创建上下文"| node_context
node_window -->|"显示页面"| node_mods_page
node_window -->|"显示页面"| node_settings_page
node_window -->|"显示页面"| node_console_page
node_window -->|"显示页面"| node_updater_page
node_window -->|"调用动画"| node_animations
node_window -->|"使用主题"| node_theme
node_context -->|"读取配置"| node_config
node_context -->|"持有运行器"| node_game_runner
node_context -->|"扫描 Mods"| node_mod_scan
node_context -->|"管理名称缓存"| node_translation
node_context -->|"加载配置支持"| node_mod_config
node_context -->|"维护 SMAPI 状态"| node_smapi
node_mods_page -->|"读取管理状态"| node_context
node_mods_page -->|"管理模组"| node_mod_scan
node_mods_page -->|"检查更新"| node_mod_updates
node_mods_page -->|"翻译名称"| node_translation
node_mods_page -->|"打开编辑器"| node_config_editor
node_config_editor -->|"读取 Mod 配置"| node_mod_config
node_config_editor -->|"使用 AI 能力"| node_translation
node_settings_page -->|"读写设置"| node_config
node_settings_page -->|"配置更新凭据"| node_mod_updates
node_settings_page -->|"配置翻译服务"| node_translation
node_console_page -->|"启动或停止"| node_game_runner
node_console_page -->|"读取 SMAPI 信息"| node_smapi
node_game_runner -->|"运行游戏进程"| node_stardew
node_updater_page -->|"检查与安装"| node_smapi
node_updater_page -->|"翻译更新日志"| node_translation
node_translation -->|"请求翻译"| node_ai_service
node_mod_updates -->|"查询版本"| node_nexus
node_mod_updates -->|"查询发布"| node_github
node_smapi -->|"获取发布包"| node_github
node_window -->|"检查软件更新"| node_self_update
node_window -->|"打开更新对话框"| node_update_dialog
node_update_dialog -->|"读取更新信息"| node_self_update
node_self_update -->|"检查软件发布"| node_github

click node_main "https://github.com/xongge/stardewmodmanager/blob/main/main.py"
click node_window "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/main_window.py"
click node_animations "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/anim.py"
click node_theme "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/theme.py"
click node_mods_page "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/mods_page.py"
click node_config_editor "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/config_editor.py"
click node_settings_page "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/settings_page.py"
click node_console_page "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/console_page.py"
click node_updater_page "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/updater_page.py"
click node_context "https://github.com/xongge/stardewmodmanager/blob/main/app/context.py"
click node_config "https://github.com/xongge/stardewmodmanager/blob/main/app/config.py"
click node_mod_scan "https://github.com/xongge/stardewmodmanager/blob/main/app/mods.py"
click node_mod_config "https://github.com/xongge/stardewmodmanager/blob/main/app/modconfig.py"
click node_translation "https://github.com/xongge/stardewmodmanager/blob/main/app/ai.py"
click node_mod_updates "https://github.com/xongge/stardewmodmanager/blob/main/app/updates.py"
click node_game_runner "https://github.com/xongge/stardewmodmanager/blob/main/app/game.py"
click node_smapi "https://github.com/xongge/stardewmodmanager/blob/main/app/smapi.py"
click node_self_update "https://github.com/xongge/stardewmodmanager/blob/main/app/selfupdate.py"
click node_update_dialog "https://github.com/xongge/stardewmodmanager/blob/main/app/ui/dialog_update.py"

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_main,node_window,node_animations,node_theme,node_mods_page,node_config_editor,node_settings_page,node_console_page,node_updater_page,node_update_dialog toneBlue
class node_mod_scan,node_mod_config,node_translation,node_mod_updates toneAmber
class node_game_runner,node_smapi toneMint
class node_context,node_config,node_self_update toneRose
class node_user,node_ai_service,node_nexus,node_github,node_stardew toneIndigo
```

## Components

### 桌面界面

- [应用入口](https://github.com/xongge/stardewmodmanager/blob/main/main.py): `main.py`
- [主窗口导航](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [界面动画](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/anim.py): `app/ui/anim.py`
- [主题配色](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/theme.py): `app/ui/theme.py`
- [模组管理页](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/mods_page.py): `app/ui/pages/mods_page.py`
- [配置编辑器](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/config_editor.py): `app/ui/pages/config_editor.py`
- [设置页](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/settings_page.py): `app/ui/pages/settings_page.py`
- [运行控制台页](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/console_page.py): `app/ui/pages/console_page.py`
- [SMAPI 更新页](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/pages/updater_page.py): `app/ui/pages/updater_page.py`
- [软件更新对话框](https://github.com/xongge/stardewmodmanager/blob/main/app/ui/dialog_update.py): `app/ui/dialog_update.py`

### Mod 管理

- [Mod 扫描与清单](https://github.com/xongge/stardewmodmanager/blob/main/app/mods.py): `app/mods.py`
- [Mod 配置与本地化](https://github.com/xongge/stardewmodmanager/blob/main/app/modconfig.py): `app/modconfig.py`
- [AI 名称翻译](https://github.com/xongge/stardewmodmanager/blob/main/app/ai.py): `app/ai.py`
- [Mod 更新检测](https://github.com/xongge/stardewmodmanager/blob/main/app/updates.py): `app/updates.py`

### 游戏与 SMAPI

- [游戏运行与日志](https://github.com/xongge/stardewmodmanager/blob/main/app/game.py): `app/game.py`
- [SMAPI 安装维护](https://github.com/xongge/stardewmodmanager/blob/main/app/smapi.py): `app/smapi.py`

### 配置与服务

- [应用上下文](https://github.com/xongge/stardewmodmanager/blob/main/app/context.py): `app/context.py`
- [配置与数据目录](https://github.com/xongge/stardewmodmanager/blob/main/app/config.py): `app/config.py`
- [软件更新检查](https://github.com/xongge/stardewmodmanager/blob/main/app/selfupdate.py): `app/selfupdate.py`

### Other components

- **玩家**
- **OpenAI 兼容接口**
- **Nexus Mods**
- **GitHub Releases**
- **星露谷游戏**

## Connections

- 玩家 → 应用入口: 启动 (evidence: `main.py`)
- 应用入口 → 主窗口导航: 创建窗口 (evidence: `main.py`)
- 主窗口导航 → 应用上下文: 创建上下文 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → 模组管理页: 显示页面 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → 设置页: 显示页面 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → 运行控制台页: 显示页面 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → SMAPI 更新页: 显示页面 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → 界面动画: 调用动画 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → 主题配色: 使用主题 (evidence: `app/ui/main_window.py`)
- 应用上下文 → 配置与数据目录: 读取配置 (evidence: `app/context.py`)
- 应用上下文 → 游戏运行与日志: 持有运行器 (evidence: `app/context.py`)
- 应用上下文 → Mod 扫描与清单: 扫描 Mods (evidence: `app/context.py`)
- 应用上下文 → AI 名称翻译: 管理名称缓存 (evidence: `app/context.py`)
- 应用上下文 → Mod 配置与本地化: 加载配置支持 (evidence: `app/context.py`)
- 应用上下文 → SMAPI 安装维护: 维护 SMAPI 状态 (evidence: `app/context.py`)
- 模组管理页 → 应用上下文: 读取管理状态 (evidence: `app/ui/pages/mods_page.py`)
- 模组管理页 → Mod 扫描与清单: 管理模组 (evidence: `app/ui/pages/mods_page.py`)
- 模组管理页 → Mod 更新检测: 检查更新 (evidence: `app/ui/pages/mods_page.py`)
- 模组管理页 → AI 名称翻译: 翻译名称 (evidence: `app/ui/pages/mods_page.py`)
- 模组管理页 → 配置编辑器: 打开编辑器 (evidence: `app/ui/pages/mods_page.py`)
- 配置编辑器 → Mod 配置与本地化: 读取 Mod 配置 (evidence: `app/ui/pages/config_editor.py`)
- 配置编辑器 → AI 名称翻译: 使用 AI 能力 (evidence: `app/ui/pages/config_editor.py`)
- 设置页 → 配置与数据目录: 读写设置 (evidence: `app/ui/pages/settings_page.py`)
- 设置页 → Mod 更新检测: 配置更新凭据 (evidence: `app/ui/pages/settings_page.py`)
- 设置页 → AI 名称翻译: 配置翻译服务 (evidence: `app/ui/pages/settings_page.py`)
- 运行控制台页 → 游戏运行与日志: 启动或停止 (evidence: `app/ui/pages/console_page.py`)
- 运行控制台页 → SMAPI 安装维护: 读取 SMAPI 信息 (evidence: `app/ui/pages/console_page.py`)
- 游戏运行与日志 → 星露谷游戏: 运行游戏进程 (evidence: `app/game.py`)
- SMAPI 更新页 → SMAPI 安装维护: 检查与安装 (evidence: `app/ui/pages/updater_page.py`)
- SMAPI 更新页 → AI 名称翻译: 翻译更新日志 (evidence: `app/ui/pages/updater_page.py`)
- AI 名称翻译 → OpenAI 兼容接口: 请求翻译 (evidence: `app/ai.py`)
- Mod 更新检测 → Nexus Mods: 查询版本 (evidence: `app/updates.py`)
- Mod 更新检测 → GitHub Releases: 查询发布 (evidence: `app/updates.py`)
- SMAPI 安装维护 → GitHub Releases: 获取发布包 (evidence: `app/smapi.py`)
- 主窗口导航 → 软件更新检查: 检查软件更新 (evidence: `app/ui/main_window.py`)
- 主窗口导航 → 软件更新对话框: 打开更新对话框 (evidence: `app/ui/main_window.py`)
- 软件更新对话框 → 软件更新检查: 读取更新信息 (evidence: `app/ui/dialog_update.py`)
- 软件更新检查 → GitHub Releases: 检查软件发布 (evidence: `app/selfupdate.py`)
