Skip to content

重构为 Electron + FastAPI 双端架构,加入 macOS/Windows 自动打包 - #1

Merged
w2968066 merged 1 commit into
w2968066:mainfrom
ZionHeZY:dev
Jun 2, 2026
Merged

重构为 Electron + FastAPI 双端架构,加入 macOS/Windows 自动打包#1
w2968066 merged 1 commit into
w2968066:mainfrom
ZionHeZY:dev

Conversation

@ZionHeZY

Copy link
Copy Markdown
Contributor

改动概要

  • 后端:用 FastAPI + uvicorn 重写原 Tkinter 单文件脚本的核心混剪逻辑,按 app/{api,core,models,services} 分层
  • 前端:新增 Electron + React + Tailwind 桌面 UI,与后端通过 HTTP(localhost:8765)通讯
    • 单页双栏布局,1200×860 整屏无滚动
    • 素材卡片网格(图标 + 类型 + 路径 footer)
    • 自定义刻度尺滑块、取景框 input、方角按钮
    • 右栏 tab 切换日志 / 任务 / 产出
    • 左栏底部 action bar:启动渲染 / 预检产能 / 智能压测
  • 打包
    • backend/videomatrix-backend.spec —— PyInstaller 把后端 + uvicorn + ffmpeg 二进制打成单可执行文件
    • frontend/src/main/main.ts 生产环境直接 spawn 二进制,无需用户装 Python
    • electron-builder 把后端 binary 通过 extraResources 打进 Setup.exe / .dmg
  • CI
    • .github/workflows/build-windows.yml 重写为新架构云端打包流程(NSIS)
    • .github/workflows/build-mac.yml 新增 macOS dmg 自动打包

用户体验

push tag v* 触发,Mac runner 产 dmg、Windows runner 产 Setup.exe,自动上传 release。终端用户下载双击安装即可,零依赖

测试

  • npm run build 全栈通过(main / preload / renderer)
  • npm run dev 本地启动 Electron + 后端能跑通
  • 1200×860 桌面窗口无滚动,分辨率/码率/帧率显示完整
  • Toast 3 秒自动消失(修复了原 useEffect 依赖闭包导致计时器反复重启的 bug)

@w2968066

w2968066 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

I could not push directly to the source fork branch (ZionHeZY/VideoMatrix:dev) because this account does not have write access to that fork. I applied the requested taste-skill polish on top of this PR and opened a replacement PR here: #2.

@w2968066
w2968066 merged commit a35baa6 into w2968066:main Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants