chore: migrate and structure cmbone project

This commit is contained in:
QiuSW
2026-07-08 15:13:26 +08:00
parent 519a532038
commit e5d10577c0
123 changed files with 9076 additions and 25 deletions
+62 -1
View File
@@ -1,3 +1,64 @@
# cmbone
桌面端骨架
基于 SuiDemo 迁移而来的 Wails v3 桌面项目,已从模板仓库整理为可直接维护和构建的普通工程。
## 技术栈
- 后端:Go 1.23.0、Wails v3.0.0-alpha.9、SQLite
- 前端:Vue 3、TypeScript、Vite、Tailwind CSS、Ant Design Vue
- 功能:多语言、主题切换、本地配置、快捷键、OCR 示例
## 环境准备
当前项目按本机 Go 1.23.0 锁定依赖,不要直接安装 `wails3@latest`。
```powershell
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.9
```
如果安装后 PowerShell 找不到 `wails3`,把 Go bin 目录加入当前终端 PATH:
```powershell
$env:Path += ";$(go env GOPATH)\bin"
wails3 doctor
```
## 目录结构
```text
.
├── main.go # Wails 应用入口
├── internal/
│ ├── models/ # 后端数据模型
│ └── services/ # 后端服务和数据库逻辑
├── platform/ # Windows/macOS 平台差异代码
├── frontend/
│ ├── src/ # Vue 前端源码
│ ├── bindings/ # Wails 前端绑定
│ └── dist/ # 前端构建产物,供 Go embed 使用
└── build/ # Wails 构建配置
```
## 常用命令
```bash
go test ./...
cd frontend
npm install
npm run build
```
安装 `wails3` 后可以使用:
```bash
wails3 dev
wails3 package
```
## 维护约定
- Go 模块名统一为 `cmbone`。
- 当前依赖按系统 Go 1.23.0 锁定,升级 Go 前不要随意升级 Wails、SQLite 或热键库。
- 修改后端服务后,优先使用 `wails3 generate bindings` 重新生成 `frontend/bindings`;如果本机没有 CLI,只做小范围手动绑定。
- 提交前至少运行 `go test ./...` 和 `npm run build`。