当前仓库已验证通过:
cargo test -p sms-core
cargo check --workspace
npm run build运行态冒烟已覆盖:GET /health、GET /api/provider-manifests、GET /api/providers/mock/manifest、PUT /api/providers/mock/manifest、POST /api/provider-manifests/reload。
cargo check --workspace
cargo test -p sms-core
cargo run -p madao-sms-daemonDaemon 默认使用用户配置目录(macOS: ~/Library/Application Support/com.madao.sms,Linux: ~/.config/com.madao.sms)。显式传入路径可覆盖:cargo run -p madao-sms-daemon -- /path/to/config.toml。
npm run build
npm run check:openapi-sync浏览器模式本地联调:
VITE_RUNTIME_MODE=web npm run devVite 代理会把 /api 和 /health 转发到 http://0.0.0.0:7822。
当前前端样式栈:Tailwind CSS + PostCSS + Autoprefixer + design token + CSS variables。
关键配置文件:
tailwind.config.cjs/postcss.config.cjsui/src/tailwind.cssui/src/design-system/theme.cssui/src/design-system/tailwind-theme.cjs
设置页支持 每次打开时检查更新 和 检查更新。更新信息来源于 GitHub Release API:
https://api.github.com/repos/netcookies/MaDao/releases/latest
curl http://127.0.0.1:7822/api/provider-manifests # 查看所有
curl http://127.0.0.1:7822/api/providers/mock/manifest # 读取单个
curl -X PUT http://127.0.0.1:7822/api/providers/mock/manifest \
-H 'Content-Type: application/json' -d @manifest.json # 保存
curl -X POST http://127.0.0.1:7822/api/provider-manifests/reload # 热重载cp .env.docker.example .env
docker compose up -d --build默认网页入口:http://127.0.0.1:8080
验收命令:
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/api/provider-manifests规范文件:docs/openapi/daemon.openapi.yaml
npm run check:openapi-sync # 校验路由同步该检查核对 OpenAPI 是否包含当前所有 daemon HTTP 路由,防止”加了路由却忘了更新 OpenAPI”的漂移。
仓库内置 GitHub Pages 自动部署(.github/workflows/openapi-pages.yml),也可部署到 Cloudflare Pages(Output directory: docs/openapi)。
- macOS / Linux:UI 通过本地 socket 与后端通信
- Windows:UI 通过内嵌本地 HTTP API 与后端通信
- 内嵌 HTTP 服务监听所有网卡地址,供外部直接访问
npm run build
cargo check -p madao-tauri前端使用 i18next + react-i18next,配置入口:ui/src/app/i18n.ts。
当前支持语言:en(英文)、zh(中文)。翻译 key 内联在 i18n.ts 的 resources 对象中。
添加新 key:
- 在
resources.en.translation中添加英文 key - 在
resources.zh.translation中添加对应中文 key - 组件中使用
useTranslation()hook 的t('key_name')调用
添加新语言:
- 在
resources中添加新的 locale 对象(如ja: { translation: { ... } }) - 在
ui/src/app/language.tsx中注册语言选项
运行时语言切换通过 Settings 页面完成,无需重启应用。