A modern, production-ready template for building cross-platform desktop applications with Tauri, React, and a carefully curated set of tools and libraries.
- 🚀 Tauri 2.0 - Build smaller, faster, and more secure desktop applications
- ⚛️ React 18 - Modern React with hooks and concurrent features
- ⚡ Vite - Lightning fast build tool and development server
- 🎨 Shadcn/ui - Beautiful and accessible UI components
- 🐻 Zustand - Simple and scalable state management
- 💾 Tauri Store - Persistent storage with Zustand integration
- 🎯 TailwindCSS 4 - Utility-first CSS framework with latest features
- 📏 ESLint + Prettier - Code formatting and linting
- 🔧 Import Sorting - Automatic import organization
- 🎨 Tailwind Linting - TailwindCSS class sorting and validation
- 📱 TypeScript - Full type safety
- Frontend: React 18 + TypeScript + Vite
- Desktop: Tauri 2.0
- UI Components: Shadcn/ui + Radix UI
- Styling: TailwindCSS 4 + Lucide Icons
- State Management: Zustand + Immer
- Persistence: Tauri Plugin Store
- Code Quality: ESLint + Prettier + TypeScript
- Build Tool: Vite 6
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- pnpm (recommended) or npm/yarn
- Rust (latest stable)
- Tauri Prerequisites
-
Clone the repository
git clone https://github.com/ZingerLittleBee/tauri-react-template.git cd tauri-react-template
-
Install dependencies
pnpm i
-
Start development server
pnpm tauri dev
-
Build for production
pnpm tauri build
pnpm dev
- Start Vite development serverpnpm build
- Build for productionpnpm preview
- Preview production buildpnpm tauri dev
- Start Tauri development modepnpm tauri build
- Build Tauri applicationpnpm lint
- Run ESLint with auto-fixpnpm format
- Format code with Prettier
tauri-react-template/
├── src/ # React source code
│ ├── components/ # React components
│ ├── lib/ # Utility functions and configurations
│ ├── stores/ # Zustand stores
│ └── main.tsx # Application entry point
├── src-tauri/ # Tauri backend code
│ ├── src/ # Rust source code
│ ├── Cargo.toml # Rust dependencies
│ └── tauri.conf.json # Tauri configuration
├── public/ # Static assets
└── package.json # Node.js dependencies and scripts
This template includes a pre-configured Shadcn/ui setup with:
- Beautiful and accessible components
- Dark/light theme support
- Customizable design system
- TailwindCSS integration
To add new components:
pnpm dlx shadcn@latest add button
Zustand is configured with:
- Immer integration for immutable updates
- Tauri Store persistence for data that survives app restarts
- TypeScript support for type-safe stores
Example store with Immer:
src/store/immer/immer-store.ts
Example store with persistence:
import { create } from 'zustand'
import { persist } from 'zustand/middleware'
import { tauriStorage } from './tauri-storage'
interface AppState {
count: number
increment: () => void
}
export const useAppStore = create<AppState>()(
persist(
(set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 })),
}),
{
name: 'app-storage',
storage: tauriStorage,
}
)
)
The project includes a comprehensive ESLint and Prettier setup with:
- React-specific rules
- TypeScript support
- Import sorting with
@ianvs/prettier-plugin-sort-imports
- TailwindCSS class sorting with
prettier-plugin-tailwindcss
Configured with:
- Latest TailwindCSS 4 features
- Custom design tokens
- Responsive design utilities
- Dark mode support
To create a production build:
pnpm tauri build
This will create platform-specific installers in the src-tauri/target/release/bundle/
directory.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Tauri Documentation
- React Documentation
- Vite Documentation
- Shadcn/ui Documentation
- Zustand Documentation
- TailwindCSS Documentation
Made with ❤️ by ZingerLittleBee