A production-ready template for building cross-platform desktop applications using Tauri 2.0, React 18.3, TypeScript 5.6, and Blueprint.js 6.0. This template provides everything you need to start building modern desktop apps with comprehensive tooling, CI/CD pipelines, and a professional development workflow.
- Node.js 20+ and npm
- Rust (latest stable)
- Platform-specific dependencies:
- Windows: Microsoft C++ Build Tools
- macOS: Xcode Command Line Tools
- Linux:
webkit2gtk-4.1
,libappindicator3-dev
,librsvg2-dev
-
Clone the template:
git clone https://github.com/yourusername/tauri-workflow-template.git my-app cd my-app
-
Install dependencies:
npm install
-
Configure your app:
- Update
package.json
with your app details - Modify
src-tauri/tauri.conf.json
:- Change
productName
andidentifier
- Update bundle metadata
- Change
- Replace icons in
src-tauri/icons/
- Update
-
Start development:
npm run tauri dev
- Features
- Project Structure
- Development Workflow
- Blueprint.js Integration
- SCSS Style System
- Branch Setup & Git Workflow
- GitHub Actions Workflows
- Docker Build System
- Tauri Plugins & Permissions
- Cross-Platform Building
- Linting & Code Quality
- API Documentation
- Deployment
- Troubleshooting
- 🖥️ Cross-Platform: Build for Windows, macOS, and Linux from a single codebase
- ⚛️ Modern Stack: React 18.3 + TypeScript 5.6 + Vite 6.0
- 🎨 Blueprint.js UI: Professional UI components with dark/light theme support
- 🎯 SCSS Design System: Comprehensive styling with design tokens
- 🐳 Docker Builds: Cross-compile for all platforms with Docker
- 🚀 GitHub Actions: Automated CI/CD pipelines
- 📦 Multiple Formats: DMG, MSI, NSIS, DEB, RPM packages
- 🔒 Security First: Tauri's capability-based permissions
- 🛠️ Developer Experience: Hot reload, TypeScript strict mode, Git hooks
tauri-workflow-template/
├── src/ # Frontend React application
│ ├── components/ # React components
│ │ ├── chat/ # Example chat application
│ │ └── common/ # Shared components
│ ├── hooks/ # Custom React hooks
│ ├── styles/ # SCSS design system
│ │ ├── abstracts/ # Variables, mixins, functions
│ │ ├── base/ # Reset, typography
│ │ ├── components/ # Component styles
│ │ ├── layout/ # Layout styles
│ │ ├── themes/ # Theme definitions
│ │ ├── utilities/ # Utility classes
│ │ └── vendors/ # Third-party overrides
│ ├── assets/ # Static assets
│ ├── App.tsx # Main application
│ └── main.tsx # Entry point
├── src-tauri/ # Backend Rust application
│ ├── src/ # Rust source code
│ │ ├── lib.rs # Library entry
│ │ └── main.rs # Application entry
│ ├── capabilities/ # Permission configs
│ ├── icons/ # Application icons
│ └── tauri.conf.json # Tauri configuration
├── docs/ # Documentation
│ ├── TODO-INDEX.md # Task tracking
│ ├── DEVELOPMENT_PLAN.md # Roadmap
│ └── third-party-api-docs/ # Offline API docs
├── .github/workflows/ # GitHub Actions
├── docker/ # Docker build system
└── scripts/ # Utility scripts
Command | Description |
---|---|
npm run tauri dev |
Start development mode (React + Tauri) |
npm run dev |
Start Vite dev server only |
npm run build |
Build frontend for production |
npm run tauri build |
Build complete desktop application |
npm run lint:css |
Lint and fix SCSS files |
npm run lint:css:production |
Production SCSS linting |
npm run docker:menu |
Open Docker build menu |
npm test |
Run tests (configure your framework) |
- Start a session: Review
/docs/TODO-INDEX.md
- Run development:
npm run tauri dev
- Make changes: Follow the established patterns
- Test locally: Verify functionality
- Lint code:
npm run lint:css
- Commit changes: Follow conventional commits
- Update docs: Keep documentation current
This template deeply integrates Blueprint.js for a professional UI experience.
- Core Components: Buttons, inputs, menus, dialogs, and more
- Icons Library: Complete icon set from Blueprint
- Select Components: Advanced dropdown functionality
- Dark Theme: Full dark mode support
- Custom Overrides: Tailored styling while maintaining Blueprint's design language
import { Button, InputGroup, Icon, Classes } from "@blueprintjs/core";
import { IconNames } from "@blueprintjs/icons";
function MyComponent() {
return (
<div className={Classes.DARK}>
<InputGroup
leftIcon={IconNames.SEARCH}
placeholder="Search..."
rightElement={
<Button icon={IconNames.ARROW_RIGHT} minimal />
}
/>
</div>
);
}
The template includes comprehensive Blueprint.js overrides in /src/styles/vendors/_blueprint-overrides.scss
:
- Custom color schemes for dark/light themes
- Consistent spacing and shadows
- Enhanced focus states
- Smooth transitions
- Perfect scrollbar integration
The template includes a professional SCSS architecture following the 7-1 pattern.
src/styles/
├── abstracts/ # Design tokens & tools
│ ├── _variables.scss # Colors, spacing, typography
│ ├── _functions.scss # Utility functions
│ ├── _mixins.scss # Reusable patterns
│ └── _breakpoints.scss # Responsive breakpoints
├── base/ # Foundation styles
├── components/ # Component-specific styles
├── layout/ # Major layout components
├── themes/ # Theme definitions
├── utilities/ # Utility classes
└── vendors/ # Third-party overrides
The system provides comprehensive design tokens:
// Colors
$color-primary: #2563eb;
$color-success: #10b981;
$color-warning: #f59e0b;
$color-danger: #ef4444;
// Spacing (0.25rem to 5rem)
$spacing-1: 0.25rem;
$spacing-4: 1rem;
$spacing-8: 2rem;
// Typography
$font-size-sm: 0.875rem;
$font-size-base: 1rem;
$font-size-lg: 1.125rem;
// Shadows
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
// Component example
.my-component {
// Use design tokens
background: $color-gray-100;
padding: $spacing-4 $spacing-6;
border-radius: $border-radius-lg;
box-shadow: $shadow-md;
// Use mixins
@include button-variant($color-primary);
// Responsive design
@include media(lg) {
padding: $spacing-6 $spacing-8;
}
// Theme-aware
@include dark-theme {
background: $color-gray-800;
}
}
- Modify tokens: Edit files in
/src/styles/abstracts/
- Add components: Create new files in
/src/styles/components/
- Extend utilities: Add to
/src/styles/utilities/
- Override vendors: Update
/src/styles/vendors/
# Create main branch (production)
git checkout -b main
git push -u origin main
# Create dev branch (development)
git checkout -b dev
git push -u origin dev
# Set dev as default branch on GitHub
# Go to Settings → Branches → Change default branch
main
: Production-ready code, triggers releasesdev
: Development branch, integration pointfeature/*
: New featuresfix/*
: Bug fixesdocs/*
: Documentation updates
# Start new feature
git checkout dev
git pull origin dev
git checkout -b feature/my-feature
# Work on feature
# ... make changes ...
git add .
git commit -m "feat: add my feature"
git push origin feature/my-feature
# Create PR to dev branch
# After review, merge to dev
# When ready for release, PR from dev to main
The template includes two powerful GitHub Actions workflows for automation.
Triggers: Push or PR to main
or dev
branches
Jobs:
-
Lint and Test (Ubuntu, Node 20)
- Installs dependencies
- Runs Stylelint (
npm run lint:css:ci
) - Builds frontend (
npm run build
)
-
Tauri Validation (PRs to main only)
- Validates Rust code
- Ensures Tauri builds successfully
- Checks all platform requirements
Purpose: Ensures code quality and prevents broken builds from reaching main branches.
Triggers:
- Push to
main
branch - Manual workflow dispatch
Strategy: Matrix build for all platforms
- macOS (x86_64 and ARM64)
- Ubuntu 22.04
- Windows
Process:
- Sets up Node.js 20 and Rust toolchain
- Installs platform-specific dependencies
- Builds application for each platform
- Creates draft GitHub release
- Uploads all artifacts
Configuration:
tagName: 'v__VERSION__' # Auto-versioned
releaseName: 'Tauri Workflow Template v__VERSION__'
releaseDraft: true # Manual publish required
- Add secrets: Go to Settings → Secrets → Actions
- Modify triggers: Edit
on:
section in workflow files - Add steps: Insert new steps in the
steps:
array - Change platforms: Modify the
matrix:
configuration
The template includes a sophisticated Docker build system for cross-platform Linux compilation from any host OS.
- 🎯 Unified Interface: Single menu for all Docker operations across platforms
- 🏗️ Multi-Architecture: Build for x86_64 and ARM64 Linux targets
- 🔄 Cross-Platform: Works on macOS, Linux, and Windows
- ⚡ Fast Iteration: Cached dependencies and build artifacts
- 🎮 Interactive Development: Shell access to build environment
- 🤖 AI-Friendly: Complete CLI interface for automation
Interactive Menu:
# Linux/macOS
npm run docker:menu
# Windows PowerShell
npm run docker:menu
Direct Commands:
npm run docker:build-image # Build Docker image for native arch
npm run docker:build-tauri # Build Tauri app in Docker
npm run docker:build-all # Build on host + all Docker architectures
npm run docker:run # Interactive Docker shell
npm run docker:clean # Clean build artifacts
npm run docker:check # Check Docker image status
- x86_64: Ubuntu 22.04 +
libwebkit2gtk-4.1-dev
- ARM64: Ubuntu 20.04 +
libwebkit2gtk-4.0-dev
(optimized for Windows Docker Desktop emulation) - Cross-compilation: Build any architecture from any host (with performance differences)
The interactive menu provides 18 organized options:
Docker Image Operations (1-4):
- Build native architecture image
- Build both architectures
- Build with cache clear
- Check image status
Tauri Build Operations (5-9):
- Build for x86_64 in Docker
- Build for ARM64 in Docker
- Build both architectures
- Build on native host
- Build ALL (comprehensive pipeline)
Development Operations (10-12):
- Interactive shell (native arch)
- Interactive shell (select arch)
- Custom Docker image shell
Maintenance & Utilities (13-18):
- Clean build artifacts
- Deep clean (artifacts + images)
- Disk usage report
- Install Docker
- Start Docker
- Show recent log files
Build Commands:
# Build specific architecture
./docker/docker-menu.sh build-image x86_64
./docker/docker-menu.sh build-tauri arm64
# Build everything
./docker/docker-menu.sh build-all
# Automated cleanup
./docker/docker-menu.sh -y clean
PowerShell (Windows):
# Build Docker image
.\docker\docker-menu.ps1 build-image
# Build Tauri app
.\docker\docker-menu.ps1 build-tauri x86_64
# Quiet mode for automation
.\docker\docker-menu.ps1 -Quiet build-all
Options:
-h, --help
: Show help-q, --quiet
: Suppress output (logs only)-y, --yes
: Auto-confirm prompts--no-cache
: Build without Docker cache--arch ARCH
: Override architecture--image IMAGE
: Use custom Docker image
All builds are placed in src-tauri/target/release/bundle/
:
- Windows:
.msi
,.exe
(NSIS) - macOS:
.dmg
- Linux:
.deb
,.rpm
Tauri uses a capability-based permission system. All permissions are explicitly declared in /src-tauri/capabilities/
.
The template includes these capabilities in default.json
:
{
"permissions": [
"core:default", // Core Tauri APIs
"core:app:default", // App lifecycle
"core:event:default", // Event system
"core:window:default", // Window management
"core:webview:default", // Webview control
"core:menu:default", // Native menus
"core:path:default", // Path resolution
"core:resources:default", // Resource access
"core:tray:default", // System tray
"opener:default", // Open external links
"shell:allow-execute" // Execute commands
]
}
The template provides pre-configured capability files:
clipboard.json
: Clipboard read/write accessdialog.json
: Native file/folder dialogsfilesystem.json
: File system operationsnetwork.json
: Network requestssystem.json
: System information
-
Add to Cargo.toml:
[dependencies] tauri-plugin-clipboard = "2.0.0"
-
Register in lib.rs:
tauri::Builder::default() .plugin(tauri_plugin_clipboard::init()) .run(tauri::generate_context!())
-
Add capability to window:
{ "windows": ["main"], "permissions": ["clipboard:default"] }
This template supports building for all major platforms in a single workflow.
Platform | Architectures | Package Formats |
---|---|---|
Windows | x64 | MSI, NSIS (.exe) |
macOS | x64, ARM64 | DMG |
Linux | x64 | DEB, RPM |
# Build for current platform
npm run tauri build
# Build with specific target
npm run tauri build -- --target x86_64-pc-windows-msvc
The Docker system enables cross-compilation:
# Build for all platforms
npm run docker:build-all
# This creates:
# - Windows installers (MSI, NSIS)
# - macOS packages (Intel + Apple Silicon)
# - Linux packages (DEB, RPM)
Windows:
- Requires Microsoft C++ Build Tools
- Produces signed installers (configure in
tauri.conf.json
)
macOS:
- Supports both Intel and Apple Silicon
- Code signing requires Apple Developer account
- Notarization for distribution outside App Store
Linux:
- Builds universal packages
- AppImage support can be added
- Snap/Flatpak possible with additional config
The template uses Stylelint for SCSS code quality:
# Development mode (shows all warnings)
npm run lint:css
# Production mode (clean output)
npm run lint:css:production
# CI mode (compact formatter)
npm run lint:css:ci
Stylelint is configured in .stylelintrc.json
:
- Extends recommended SCSS rules
- Custom rules for the design system
- Ignores vendor files
- Blueprint.js compatibility
Pre-commit hooks via Husky + lint-staged:
- Automatically fixes SCSS on commit
- Ensures code quality
- Prevents committing errors
-
ESLint for TypeScript:
npm install -D eslint @typescript-eslint/parser # Add .eslintrc.json # Update package.json scripts
-
Rust formatting:
# In src-tauri/ cargo fmt cargo clippy
Full Tauri API documentation is available:
-
Frontend API: JavaScript/TypeScript APIs
- Window management
- File system
- Process
- HTTP client
- Notifications
- And more...
-
Backend API: Rust APIs
- Command system
- State management
- Window creation
- Menu building
- Plugin development
Complete Blueprint.js docs are included offline in /docs/third-party-api-docs/
:
- Component library
- Design guidelines
- Accessibility features
- Migration guides
- Code examples
Access locally: Open /docs/third-party-api-docs/blueprint/index.html
Example Tauri command:
// Backend (lib.rs)
#[tauri::command]
async fn greet(name: &str) -> Result<String, String> {
Ok(format!("Hello, {}!", name))
}
// Frontend usage
import { invoke } from '@tauri-apps/api/core';
const message = await invoke<string>('greet', { name: 'World' });
-
Update version in
package.json
andtauri.conf.json
-
Configure signing (optional but recommended):
- Windows: Add certificate info to
tauri.conf.json
- macOS: Set up signing identity
- Linux: GPG signing for repositories
- Windows: Add certificate info to
-
Build release:
npm run tauri build
-
Or use GitHub Actions:
- Push to
main
branch - GitHub creates draft release
- Review and publish
- Push to
- Direct download: Host installers on your website
- GitHub Releases: Automatic with Actions
- Auto-updater: Configure Tauri's updater
- App stores: Additional configuration required
Enable auto-updates:
-
Add to
tauri.conf.json
:{ "updater": { "active": true, "endpoints": ["https://your-api.com/updates"], "dialog": true } }
-
Set up update server
-
Sign updates for security
Build fails on Windows
- Install Visual Studio Build Tools
- Ensure WebView2 is installed
- Check Rust toolchain:
rustup update
Docker build errors
- Verify Docker daemon is running
- Check disk space
- Run
npm run docker:clean
SCSS linting warnings
- Blueprint.js overrides need
!important
- Some warnings are expected
- Run
npm run lint:css
to auto-fix
Tauri command not found
- Ensure all dependencies installed:
npm install
- Check Rust installation:
cargo --version
- Verify in correct directory
macOS code signing
- Requires Apple Developer account
- Configure in
tauri.conf.json
- See Tauri docs
- Check
/docs/
for additional documentation - Review Tauri Documentation
- See Blueprint.js Documentation
- Open an issue on GitHub
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Follow the code style
- Add tests if applicable
- Update documentation
- Submit a pull request to
dev
This template is available under the MIT License. See LICENSE file for details.
Built with ❤️ using Tauri, React, and Blueprint.js. Happy coding! 🚀