Skip to content
Public template

About

Modern Desktop App Template: Tauri v2 + React 19 + TypeScript + shadcn/ui A high-performance, lightweight, and type-safe starter kit for cross-platform desktop development.

Topics

Resources

Stars

102 stars

Watchers

1 watching

Forks

Repository files navigation

Tauri App Template

English | 简体中文

Tauri React TypeScript License

A modern desktop application template built with Tauri v2 + React 19 + TypeScript + shadcn/ui.

Preview

App Screenshot

Features

  • ✨ Modern Tech Stack - Tauri v2 + React 19 + TypeScript + Vite
  • 🎨 Beautiful UI Components - Integrated shadcn/ui component library and Tailwind CSS v4
  • 🌓 Dark Mode Support - Built-in light/dark theme toggle
  • 🌍 Internationalization - i18next integration with English and Chinese support
  • 🖼️ Custom Titlebar - Frameless transparent window with drag, minimize, maximize, and close support
  • 🗂️ Multi-Window Management - Support for child windows, window lifecycle management, and delayed destruction
  • 🔔 System Tray Integration - Tray icon, menu, and window show/hide support
  • ⌨️ Global Shortcuts - Register global shortcuts that work even when app is not focused
  • 🔄 Automated Release & Updates - GitHub Actions build, GitHub Release publishing, and auto-update delivery based on vX.Y.Z tags
  • 📦 Ready to Use - Pre-configured with Prettier, ESLint, and TypeScript strict mode
  • 🚀 Fast Development - Vite HMR + Tauri hot reload

Tech Stack

Getting Started

Prerequisites

  • Node.js >= 18
  • pnpm >= 9
  • Rust >= 1.70

Install Dependencies

pnpm install

Development Mode

pnpm tauri dev

Build for Production

pnpm tauri build

Version Management

pnpm release:version is the release entrypoint.

pnpm release:version
pnpm release:version --lang zh
pnpm release:version --lang en

It interactively handles the release preflight and version bump flow:

  • Ensures the working tree is clean
  • Requires the current branch to be main
  • Verifies package.json, src-tauri/tauri.conf.json, and src-tauri/Cargo.toml are in sync
  • Checks that the target tag does not already exist locally or on origin
  • Updates all three version files together
  • Creates the release commit and vX.Y.Z tag
  • Optionally pushes the branch and tag

Adding shadcn/ui Components

pnpm dlx shadcn@latest add <component-name>

Examples:

pnpm dlx shadcn@latest add button
pnpm dlx shadcn@latest add input
pnpm dlx shadcn@latest add dialog

Code Formatting

pnpm format        # Format code
pnpm format:check  # Check code formatting

Project Structure

.
├── src/                    # Frontend source code
│   ├── components/         # React components
│   │   └── ui/            # shadcn/ui components
│   ├── i18n/              # Internationalization
│   │   ├── index.ts       # i18n configuration
│   │   └── locales/       # Translation files
│   ├── lib/               # Utility functions
│   ├── pages/             # Page components
│   │   ├── home.tsx       # Main window page
│   │   ├── about.tsx      # About window page
│   │   └── settings.tsx   # Settings window page
│   └── main.tsx           # Frontend entry and pathname-based page selector
├── src-tauri/             # Tauri/Rust backend
│   ├── src/               # Rust source code
│   └── tauri.conf.json    # Tauri configuration
├── docs/                  # Documentation
│   ├── AUTO_UPDATE.md     # Auto update guide
│   ├── I18N.md            # Internationalization guide
│   └── GLOBAL_SHORTCUT.md # Global shortcut guide
├── components.json        # shadcn/ui configuration
└── package.json

CI/CD

This project uses GitHub Actions for automated builds and releases.

Automated Release

The workflow is triggered by pushing tags matching v* (for example v0.1.0). The recommended release path is to run pnpm release:version, which creates the matching vX.Y.Z tag for you.

Manual tag push example:

git tag v0.1.0
git push origin v0.1.0

Build Outputs

The workflow generates:

  • NSIS Installer - Windows installation package
  • Updater Files - latest.json for auto-update support

Auto Update Setup

To enable automatic updates, you need to:

  1. Generate signing keys: pnpm tauri signer generate -w ~/.tauri/myapp.key
  2. Add GitHub secrets: TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD

Note: The public key and update endpoint placeholders in src-tauri/tauri.conf.json are replaced by GitHub Actions during the release build. Auto update depends on the published GitHub Release exposing latest.json from the latest release assets.

See Auto Update Configuration for detailed instructions.

Code Signing (Optional)

To enable code signing, add these secrets in your GitHub repository settings:

  • TAURI_SIGNING_PRIVATE_KEY - Private key content
  • TAURI_SIGNING_PRIVATE_KEY_PASSWORD - Private key password

The build will work without these secrets, but the installer won't be signed.

Multi-Platform Support

To enable macOS and Linux builds, uncomment the corresponding platform configurations in .github/workflows/release.yml.

Recommended IDE Setup

Star History

Star History Chart

License

MIT

About

Modern Desktop App Template: Tauri v2 + React 19 + TypeScript + shadcn/ui A high-performance, lightweight, and type-safe starter kit for cross-platform desktop development.

Topics

Resources

Stars

102 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages