A production-ready template for building secure, commercial-grade cross-platform desktop applications with Tauri 2.0, React, TypeScript, and Tailwind CSS.
We've officially released v1.0.0 with full cross-platform support for Windows, macOS, and Ubuntu! Check out our release notes for details.
Visit our documentation site for comprehensive guides and security information.
- β Fixed Theme Toggle: Properly implemented dark/light mode switching with Tailwind CSS
- β Added Greet Command: Implemented missing greet command functionality
- β Enhanced Security: Cleaned up memory-safe code to remove unused functions
- β Improved Dialog Plugin: Fixed configuration for proper file selection
- β Content Security Policy: Updated CSP to support Tauri IPC communication
- π Tauri 2.0: Latest version with improved performance and security
- βοΈ React 18: Modern React with hooks and concurrent rendering
- π¦ Rust Backend: Powerful and safe native capabilities
- π Enterprise-Grade Security: Robust security practices throughout the codebase
- π Cross-Platform: Works on Windows, macOS, and Linux
- π¦ State Management: Zustand for simple yet powerful state management
- ποΈ UI Components: Ready-to-use Tailwind CSS components
- β TypeScript: Type safety throughout the application
- π Error Handling: Robust error handling system in both frontend and backend
- π§ͺ Testing Infrastructure: Jest for frontend testing with examples
- π‘οΈ CI/CD Pipeline: GitHub Actions workflow with security audits
- π§© Type Conversion: Seamless conversion between Rust and TypeScript types
- β Strict Content Security Policy: Protection against XSS and injection attacks
- β Principle of Least Privilege: Granular capability-based permission system
- β Supply Chain Security: Dependency auditing and pinned versions
- β Type Safety: Strong typing between frontend and backend
- β Error Boundaries: Graceful handling of runtime errors
- β Input Validation: Utilities for secure input handling
- β Pre-commit Hooks: Automated security and quality checks
- β Security Documentation: Comprehensive security guidance
- β Binary Optimization: Secure build configuration for production
- Clone this template
- Install dependencies:
npm install
- Initialize pre-commit hooks:
npm run prepare
- Start the development server:
npm run tauri dev
/
βββ .github/ # GitHub configuration
β βββ workflows/ # GitHub Actions workflows
βββ scripts/ # Utility scripts
βββ src/ # React frontend code
β βββ components/ # React components
β β βββ common/ # Shared/reusable components
β β βββ layout/ # Layout components
β β βββ feature/ # Feature-specific components
β βββ context/ # React context providers
β βββ hooks/ # Custom React hooks
β βββ stores/ # Zustand state management
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β β βββ api/ # Tauri API integration
β β βββ helpers/ # Helper utilities including error handling
β βββ App.tsx # Main App component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ src-tauri/ # Rust backend code
β βββ src/ # Rust source files
β β βββ lib.rs # Core functions and Tauri commands
β βββ capabilities/ # Tauri 2.0 capability definitions
β βββ permissions/ # Tauri 2.0 permission definitions
β βββ Cargo.toml # Rust dependencies
β βββ tauri.conf.json # Tauri configuration
βββ public/ # Static assets
βββ DOCUMENTATION.md # Detailed documentation
βββ SECURITY.md # Security policy
βββ CONTRIBUTING.md # Contribution guidelines
βββ SECURITY-MODEL.md # Security model explanation
βββ RELEASE-CHECKLIST.md # Release process
βββ package.json # NPM configuration and dependencies
βββ ... (config files) # Various configuration files
- Components: Reusable UI components built with Tailwind CSS
- State Management: Zustand for simple, powerful state management
- Error Handling: Global error boundary for graceful error handling
- API Integration: Clean abstraction over Tauri commands
- Type Conversion: Utilities for seamless Rust-TypeScript interoperability
- Commands: Well-organized Tauri commands with proper error handling
- Permissions: Secure permission handling with Tauri 2.0 capabilities
- File System: Safe file system operations with principle of least privilege
- Dialog Management: Native dialogs for file/folder selection
- Error Types: Structured error types with proper propagation
The template uses Tailwind CSS. You can customize the theme in tailwind.config.js
.
- Define your command in
src-tauri/src/lib.rs
:
#[tauri::command]
fn my_command(arg: String) -> Result<String, String> {
// Your implementation
Ok(format!("Processed: {}", arg))
}
- Register it in the command list:
.invoke_handler(tauri::generate_handler![
existing_command,
my_command
])
- Add it to your frontend API layer (
src/utils/api/tauriApi.ts
):
export async function myCommand(arg: string): Promise<string> {
return invokeCommand<string>('my_command', { arg });
}
- Call it from your components:
import { myCommand } from '../utils/api/tauriApi';
// Later in component
const result = await myCommand('test');
This template follows best practices for secure application development:
- Follow the principle of least privilege: Only grant the permissions your app actually needs
- Validate all user inputs: Never trust user input from the frontend
- Use proper error handling: Don't expose sensitive information in error messages
- Keep dependencies updated: Regularly run security audits
- Sign your application: Use the provided build pipeline for signed releases
- Audit your capabilities: Review security with the included tools
For more details, see SECURITY-MODEL.md.
npm run tauri build
This will create platform-specific installers in the src-tauri/target/release/bundle
directory.
To run security checks locally:
# Check frontend dependencies
npm run security:audit
# Check Rust dependencies
cd src-tauri && cargo audit
# Check Tauri capabilities
python ./scripts/check_capabilities.py
- DOCUMENTATION.md - Detailed documentation
- SECURITY.md - Security policy
- CONTRIBUTING.md - Contribution guidelines
- SECURITY-MODEL.md - Security model explanation
- RELEASE-CHECKLIST.md - Release process
- INSTALLATION.md - Comprehensive installation and setup guide
- SHOWCASE.md - Security features showcase with code examples
- MARKETING.md - Overview of commercial benefits and features
- SECURITY-CHECKLIST.md - Pre-deployment security verification checklist
MIT