一个面向桌面优先应用的开源模板,核心是 Rust monorepo,前端使用 SvelteKit。 An open source starter for desktop-first apps with a Rust monorepo core and a SvelteKit UI shell.
它刻意保持业务无关,目标是快速起步,而不是预置产品逻辑。 It is intentionally business-agnostic and optimized for fast bootstrap, not preloaded product logic.
这个模板提供跨平台桌面产品的干净基线: This template gives you a clean baseline for cross-platform desktop products:
仓库定位、设计原则、可直接复制的仓库简介文案见 ABOUT.md。
For positioning, design principles, and copy-ready repository description, see ABOUT.md.
开箱即用的 monorepo 结构(apps/* + crates/*)与 Cargo + moon 约定。
apps/desktop-ui 下可运行的桌面 UI 脚手架和 Tauri 构建链路。
Rust 分层骨架:domain、application、shared_contracts、runtime_server、runtime_tauri。
.github/workflows/ci.yml 中已配置 Rust 与前端质量门禁。
社区协作基础文件(CONTRIBUTING.md、CODE_OF_CONDUCT.md、SECURITY.md、CHANGELOG.md)。
Ready-to-run monorepo layout (apps/* + crates/*) with Cargo + moon conventions.
Desktop UI app scaffold in apps/desktop-ui with Tauri build wiring.
Rust crate skeletons for domain, application, shared_contracts, runtime_server, and runtime_tauri.
CI quality gates for Rust and frontend checks in .github/workflows/ci.yml.
Community health files (CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, CHANGELOG.md).
当前已包含 | Included now:
默认不包含 | Not included by default:
Rust stable(含 rustfmt、clippy)
Node.js 24.0.0
Bun 1.3.11
平台对应的 Tauri 系统依赖
Rust stable (with rustfmt, clippy)
Node.js 24.0.0
Bun 1.3.11
System dependencies required by Tauri (platform-specific)
在 GitHub 点击 Use this template 创建新仓库。
克隆你的新仓库。
安装前端依赖:
Click Use this template on GitHub and create your repository.
Clone your new repository.
Install frontend dependencies:
bun install --cwd apps/desktop-ui
cargo check --workspace --exclude desktop-ui-tauri
bun run --cwd apps/desktop-ui check
bun run --cwd apps/desktop-ui dev
首次发布前请至少更新: Before first release, update:
apps/desktop-ui/src-tauri/tauri.conf.jsonproductNameidentifiertitleapps/desktop-ui/src/app.html titleapps/desktop-ui/src/routes/+page.svelte placeholder contentapps/desktop-ui/src-tauri/icons/LICENSE, project metadata, and repository About panel详细检查项见 docs/BOOTSTRAP_CHECKLIST.md。
Detailed checklist: docs/BOOTSTRAP_CHECKLIST.md.
在仓库根目录执行: From repository root:
# Rust quality gates
cargo check --workspace --exclude desktop-ui-tauri
cargo test --workspace --exclude desktop-ui-tauri
cargo clippy --workspace --exclude desktop-ui-tauri -- -D warnings
cargo fmt --all -- --check
# Frontend quality gates
bun run --cwd apps/desktop-ui check
bun run --cwd apps/desktop-ui lint
bun run --cwd apps/desktop-ui build
# Frontend dev server
bun run --cwd apps/desktop-ui dev
如果你使用 moon: If you use moon:
moon run :check
moon run :lint
moon run :test
moon run desktop-ui:dev
.
|- apps/
| |- desktop-ui/
| |- src/ # SvelteKit UI
| |- src-tauri/ # Tauri app shell
|- crates/
| |- domain/ # Domain model and rules boundary
| |- application/ # Use case orchestration boundary
| |- shared_contracts/ # Shared DTO/schema boundary
| |- runtime_server/ # Server runtime boundary (Axum-oriented scaffold)
| |- runtime_tauri/ # Tauri runtime integration boundary
|- .moon/ # moon workspace/toolchain config
|- .github/workflows/ # CI pipelines
|- docs/ # Project-level docs
架构说明见 docs/ARCHITECTURE.md。
Architecture notes: docs/ARCHITECTURE.md.
ABOUT.md - project positioning and copy-ready About textdocs/ARCHITECTURE.md - boundary-driven structure and extension strategydocs/BOOTSTRAP_CHECKLIST.md - first-day customization checklistCONTRIBUTING.md - contribution workflowSECURITY.md - vulnerability reporting processCHANGELOG.md - release historyGitHub Actions 工作流(.github/workflows/ci.yml)执行:
GitHub Actions workflow (.github/workflows/ci.yml) runs:
apps/desktop-ui/src-tauri/tauri.conf.json 当前使用 "csp": null 以降低模板上手门槛。
apps/desktop-ui/src-tauri/tauri.conf.json currently uses "csp": null for easier bootstrap.
正式发布前请配置并验证严格的 CSP。 Before production release, define and validate a strict CSP.
本仓库使用 WTF-0 Public License,详见 LICENSE。
This repository uses the WTF-0 Public License. See LICENSE.