A modern desktop application template built with:
- Tauri v2 - Build smaller, faster, and more secure desktop applications
- SvelteKit - The fastest way to build Svelte apps with routing and SSG
- Svelte 5 - Cybernetically enhanced web apps with runes
- Vite - Next generation frontend tooling
- TypeScript - Type-safe development
- Tailwind CSS 4 - Utility-first CSS framework
- Biome - Fast formatter and linter
- pnpm - Fast, disk space efficient package manager
- Husky + lint-staged - Git hooks for quality control
✨ Modern Stack
- Tauri v2 for native desktop capabilities
- SvelteKit with static adapter for SPA mode
- Svelte 5 with the latest runes API
- Tailwind CSS 4 with Vite plugin integration
- Full TypeScript support
🛠️ Developer Experience
- Fast builds with Vite
- File-based routing with SvelteKit
- Code formatting and linting with Biome
- Pre-commit hooks with Husky
- Staged file linting with lint-staged
🚀 CI/CD Ready
- GitHub Actions workflows included
- Multi-platform builds (Windows, macOS, Linux)
- Automated releases
Linux:
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-devmacOS:
- Xcode Command Line Tools
Windows:
- Microsoft Visual Studio C++ Build Tools
-
Clone the repository:
git clone https://github.com/HONGJICAI/tauri-svelte-template.git cd tauri-svelte-template -
Install dependencies:
pnpm install
-
Run the development server:
pnpm tauri:dev
pnpm dev- Start Vite dev serverpnpm build- Build the frontendpnpm preview- Preview the built frontendpnpm tauri:dev- Run Tauri in development modepnpm tauri:build- Build the Tauri applicationpnpm check- Run Svelte type checkingpnpm lint- Run Biome linterpnpm lint:fix- Run Biome linter and fix issuespnpm format- Format code with Biome
tauri-svelte-template/
├── .github/
│ └── workflows/ # GitHub Actions workflows
├── .husky/ # Husky git hooks
├── src/ # SvelteKit source files
│ ├── routes/ # SvelteKit file-based routes
│ │ ├── +layout.svelte # Root layout
│ │ ├── +layout.ts # Layout config (prerender, ssr)
│ │ └── +page.svelte # Home page
│ ├── lib/ # Reusable components and utilities
│ ├── app.html # HTML template
│ └── app.css # Global styles with Tailwind
├── src-tauri/ # Tauri (Rust) source files
│ ├── src/
│ │ ├── main.rs # Tauri entry point
│ │ └── lib.rs # Library code
│ ├── icons/ # Application icons
│ ├── Cargo.toml # Rust dependencies
│ └── tauri.conf.json # Tauri configuration
├── static/ # Static assets
├── package.json # Node dependencies and scripts
├── pnpm-workspace.yaml # pnpm workspace configuration
├── biome.json # Biome configuration
├── svelte.config.js # SvelteKit configuration
├── tsconfig.json # TypeScript configuration
└── vite.config.ts # Vite configuration
Build the application for your current platform:
pnpm tauri:buildThe built application will be in src-tauri/target/release/bundle/.
Tailwind CSS 4 is integrated via the Vite plugin. Customize styles in src/app.css using the @import "tailwindcss" syntax.
Modify linting and formatting rules in biome.json.
Configure the application in src-tauri/tauri.conf.json:
- Window properties
- Application identifier
- Bundle settings
- Security policies
Two GitHub Actions workflows are included:
-
CI (
.github/workflows/ci.yml):- Runs on push and pull requests
- Lints and formats code
- Type checks
- Builds the application on all platforms
-
Release (
.github/workflows/release.yml):- Triggers on version tags (e.g.,
v1.0.0) - Builds and publishes releases for all platforms
- Triggers on version tags (e.g.,
This template is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.