Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DailyClean — 游戏日常清理自动化系统

本地运行的 Windows 桌面工具,通过可视化 Web 界面管理、编排和执行游戏日常清理脚本。


功能概览

功能 说明
游戏面板 查看所有项目(游戏)的卡片,一键运行、实时查看日志
可视化工作流编辑器 拖拽式节点编辑器,将步骤组合成工作流卡片(workflow 类型)
原生脚本卡片 直接运行 py_script 类型卡片,执行 Python 脚本
参数设置 在 Web 界面修改各游戏的 config.json 参数(路径、账密、超时等)
执行记录 查看所有卡片的最后一次运行时间和状态

前置依赖(需手动安装)

以下依赖不会由 install.py 自动安装,必须先手动完成:

1. Miniconda / Anaconda(必须)

install.py 依赖 conda 来创建隔离的 Python 环境。

2. Node.js v18+(必须)

前端构建需要 Node.js。

  • 下载:https://nodejs.org(选 LTS 版本,v18 或更高)
  • 安装后在命令行运行 node --version 确认可用

3. pywin32(特殊情况)

pywin32 已加入 requirements.txt,install.py 会自动安装并执行 post-install 脚本。

但如果自动 post-install 失败,需手动执行(仅 game1_dorohelper 的"窗口前置"步骤需要):

conda activate dailyclean
python Scripts\pywin32_postinstall.py -install

安装

# 双击运行,或在命令行执行:
python install.py

脚本会自动完成:

  1. 定位 Conda
  2. 创建 dailyclean 环境(Python 3.11)
  3. 安装 Python 依赖(含 pywin32)
  4. 执行 pywin32 post-install
  5. 安装 Playwright Chromium(~150 MB,供 game2_kankan 使用)
  6. 安装前端 npm 依赖

启动与停止

# 启动(同时启动后端 + 前端)
python start.py
# 或双击 start.bat

# 停止
python stop.py
# 或双击 stop.bat

启动后访问:http://localhost:3000


项目结构

DailyClean/
├── backend/                   # FastAPI 后端
│   ├── api/v1/endpoints/      # HTTP 路由(games, cards, ws 等)
│   ├── models/                # SQLAlchemy ORM 模型
│   ├── schemas/               # Pydantic 请求/响应 Schema
│   ├── services/              # 业务逻辑(game_service, card_runner 等)
│   ├── core/                  # 数据库、配置、依赖注入
│   └── requirements.txt       # Python 依赖
├── frontend/                  # React + TypeScript 前端
│   └── src/
│       ├── pages/             # 页面:DashboardPage / SettingsPage / TasksPage / WorkflowEditorPage
│       ├── components/        # 公共组件(Sidebar 等)
│       └── services/          # Axios 封装(gameService, cardService 等)
├── scripts/
│   └── games/
│       ├── game1_dorohelper/  # NIKKE 日常清理(workflow 工作流 + DoroHelper)
│       │   ├── workflow_engine.py  # 工作流执行引擎
│       │   └── config.json         # 本地参数配置(路径、超时等)
│       └── game2_kankan/      # 看看Bot(Playwright 浏览器自动化)
│           ├── run.py              # 主执行脚本
│           └── config.json         # 账密(加密存储)+ 超时参数
├── install.py                 # 一键安装脚本
├── start.py / start.bat       # 启动脚本
└── stop.py  / stop.bat        # 停止脚本

技术栈

层 技术
前端 React 18 + TypeScript, Ant Design 5, React Router 6, Axios
后端 FastAPI + Uvicorn, SQLAlchemy 2 + SQLite (aiosqlite)
实时通信 WebSocket(日志实时推送)
自动化 PyAutoGUI + OpenCV(GUI 自动化), Playwright(浏览器自动化), pywin32(窗口管理)
加密 Fernet 对称加密(账密存储)
运行环境 Conda 虚拟环境(Python 3.11), Node.js v18+

添加新游戏项目

  1. 在 scripts/games/ 下创建新目录,放入执行脚本
  2. 在 Web 界面「游戏面板」→「新建项目」创建对应项目
  3. 为该项目创建卡片(workflow 类型或 py_script 类型)
  4. 如需参数配置,在 backend/services/game_service.py 的 _PARAM_DEFS 字典中为该 game.code 添加参数元信息

常见问题

Q: 启动后前端白屏 / 无法连接后端

检查后端是否正常启动:访问 http://localhost:8000/docs,如无法访问则查看后端日志。

Q: game1_dorohelper 运行时提示 win32gui 相关错误

pywin32 post-install 未成功执行,手动运行:

conda activate dailyclean
python <conda_env_path>\Scripts\pywin32_postinstall.py -install

Q: game2_kankan Playwright 报错找不到 Chromium

conda activate dailyclean
playwright install chromium

Q: 想重置某游戏的账密/参数

直接编辑对应 scripts/games/<game_code>/config.json,或在 Web 界面「参数设置」页修改。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages