Skip to content
/ tauri-template Public template

A production-ready template for building modern desktop applications with Tauri v2, React 19, and TypeScript. This template provides a solid foundation with best practices, comprehensive documentation, and quality tooling built-in.

License

Notifications You must be signed in to change notification settings

dannysmith/tauri-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tauri React Template

A production-ready template for building modern desktop applications with Tauri v2, React 19, and TypeScript. This template provides a solid foundation with best practices, comprehensive documentation, and quality tooling built-in.

πŸš€ Features

  • Modern Stack: Tauri v2 + React 19 + TypeScript + Vite
  • UI Components: shadcn/ui v4 + Tailwind CSS v4 + Lucide React
  • State Management: Zustand v5 + TanStack Query v5
  • Testing: Vitest v3 + Testing Library
  • Quality Tools: ESLint + Prettier + Rust clippy + comprehensive CI
  • Native Integration: Menu system + keyboard shortcuts + notifications + auto-updater
  • Documentation: Comprehensive developer and user guides
  • AI-Ready: Claude Code agents and documentation structure

πŸ›  Architecture

Command System

Centralized command palette with keyboard shortcuts and menu integration:

// Execute commands via palette (Cmd+K), shortcuts, or menus
const commands = [
  { id: 'preferences', label: 'Open Preferences', shortcut: 'Cmd+,' },
  { id: 'toggle-sidebar', label: 'Toggle Sidebar', shortcut: 'Cmd+1' },
]

State Management Onion

Layered state management approach:

  • useState: Component-local state
  • Zustand: App-wide UI state (sidebar visibility, themes)
  • TanStack Query: Server state and caching (preferences, data)

Performance Patterns

// βœ… Use getState() to avoid render cascades
const handleAction = useCallback(() => {
  const { data, setData } = useStore.getState()
  setData(newData)
}, []) // Stable callback

πŸ“š Documentation

πŸ— Quick Start

Prerequisites

Development

# Clone and install
git clone <your-repo>
cd tauri-template
npm install

# Start development server
npm run dev

# Run tests and quality checks
npm run check:all

# Build for production
npm run build

Project Structure

β”œβ”€β”€ src/                    # React frontend
β”‚   β”œβ”€β”€ components/         # UI components
β”‚   β”œβ”€β”€ hooks/             # Custom hooks
β”‚   β”œβ”€β”€ store/             # Zustand stores
β”‚   └── services/          # API and external services
β”œβ”€β”€ src-tauri/             # Rust backend
β”œβ”€β”€ docs/                  # Documentation
β”‚   β”œβ”€β”€ developer/         # Developer guides
β”‚   └── userguide/         # User documentation
└── .claude/agents/        # AI development assistants

πŸ§ͺ Quality Assurance

This template includes comprehensive quality gates:

npm run check:all  # Runs all checks below:
  • βœ… TypeScript type checking
  • βœ… ESLint code linting
  • βœ… Prettier code formatting
  • βœ… Rust formatting (cargo fmt)
  • βœ… Rust linting (cargo clippy)
  • βœ… React component tests
  • βœ… Rust unit tests

🎯 What You Get

Native Desktop Experience

  • Native menus with keyboard shortcuts
  • System notifications and tray integration
  • Auto-updater with GitHub releases
  • File system access with security validation
  • Cross-platform builds (macOS, Windows, Linux)

Developer Experience

  • Hot reload in development
  • Comprehensive testing setup
  • Type-safe Rust ↔ React communication
  • CLI tools for common tasks
  • AI assistants for code generation and review

Production Ready

  • Security best practices built-in
  • Error handling and logging
  • Performance optimization patterns
  • CI/CD workflows included
  • Documentation for maintenance

πŸ”§ Customization

Adding New Features

  1. Commands: Add to src/lib/commands/
  2. UI State: Extend Zustand stores in src/store/
  3. Rust APIs: Add Tauri commands in src-tauri/src/lib.rs
  4. Documentation: Update relevant docs in docs/

Configuration

  • App metadata: src-tauri/tauri.conf.json
  • Build settings: src-tauri/Cargo.toml
  • Dependencies: package.json

πŸš€ Production Checklist

Before deploying your application to production, ensure you complete these critical steps:

Security Requirements (CRITICAL)

  • Generate proper Ed25519 updater keys - Replace placeholder keys in src-tauri/tauri.conf.json
  • Store private keys securely - Never commit signing keys to version control
  • Review plugin permissions - Remove unused permissions in src-tauri/capabilities/desktop.json

App Configuration

  • Update app metadata - Change productName, version, identifier, publisher in tauri.conf.json
  • Update package.json - Set correct name, author, license, and copyright
  • Configure proper logging - Set production log levels (Info, not Debug)
  • Set up error tracking - Add Sentry, Rollbar, or similar service

Quality Assurance

  • Run full test suite - npm run check:all must pass
  • Test on all target platforms - macOS, Windows, Linux as needed
  • Verify auto-updater flow - Test with signed releases
  • Performance testing - Ensure app performs well with real data

Distribution

  • Code signing certificates - Set up proper certificates for each platform
  • Release automation - Configure CI/CD for automated builds and releases
  • Update server setup - Configure server for hosting app updates
  • Analytics setup - Add usage analytics if desired

πŸ“– For detailed security instructions, see SECURITY_PRODUCTION.md

πŸ“‹ License

This project is licensed under the AGPL-3.0-or-later license.

🀝 Contributing

Please read CONTRIBUTING.md for contribution guidelines.

πŸ”’ Security

For security concerns, please see SECURITY.md.


Recommended IDE Setup

About

A production-ready template for building modern desktop applications with Tauri v2, React 19, and TypeScript. This template provides a solid foundation with best practices, comprehensive documentation, and quality tooling built-in.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published