A modern, lightweight application boilerplate combining the power of Tauri, Blazor WebAssembly, and Radzen for desktop, web, and mobile platforms.
- Features
- Project Structure
- Getting Started
- Building
- Advanced Features
- Performance Optimizations
- CI/CD
- Contributing
- License
- Acknowledgments
- Lightweight Desktop Framework: Tauri offers much smaller bundle sizes compared to Electron
- Blazor WebAssembly: Build interactive web UIs with C# instead of JavaScript
- No Node.js Required: Pure .NET and Rust stack without JavaScript toolchain dependencies
- Secure by Default: Harnesses Tauri's security-focused architecture
- Cross-Platform: Works on Windows, macOS, Linux, Android, and iOS
- Radzen Components: Beautiful UI components from Radzen
- Material 3 Design: Modern design system with light/dark mode support
- Built with .NET 9.0: Leverages the latest .NET features
The project is organized as follows:
/
├── .cargo/ # Cargo configuration
├── .github/ # GitHub workflows for CI/CD
│ └── workflows/ # CI, release, and changelog automation
├── .vscode/ # VS Code configuration
│ ├── launch.json # Debug configurations
│ ├── tasks.json # Build tasks
│ ├── settings.json # Editor settings
│ └── extensions.json # Recommended extensions
├── docs/ # Documentation files
├── scripts/ # Build and utility scripts
│ ├── build-macos-universal.sh # macOS universal binary build script
│ ├── fast-build.sh # Optimized build script
│ ├── optimize-rust.sh # Rust optimization script
│ └── run-project.sh # Development runner
├── src/ # Blazor WebAssembly application
│ ├── Components/ # Reusable Blazor components
│ ├── Layout/ # Application layout components
│ ├── Pages/ # Application pages
│ ├── Properties/ # .NET project properties
│ ├── Services/ # Application services
│ ├── wwwroot/ # Static web assets
│ │ ├── css/ # Stylesheets including Material 3
│ │ ├── fonts/ # Application fonts
│ │ └── images/ # Images and icons
│ ├── App.razor # Root Blazor component
│ ├── Program.cs # Application entry point
│ └── TauriBlazorBoilerplate.csproj # .NET project file
└── src-tauri/ # Tauri native application
├── capabilities/ # Tauri capabilities configuration
├── icons/ # Application icons
├── src/ # Rust source code
│ ├── lib.rs # Core functionality
│ └── main.rs # Native application entry point
├── build.rs # Tauri build script
├── Cargo.toml # Rust dependencies
├── rust-toolchain.toml # Rust toolchain specification
└── tauri.conf.json # Tauri configuration
- .NET 9.0 SDK
- Rust
- Tauri Prerequisites for your platform
- For mobile development:
- Android Studio (for Android)
- Xcode (for iOS, macOS only)
- Clone the repository:
git clone https://github.com/devstroop/tauri-blazor-boilerplate.git
cd tauri-blazor-boilerplate
- Install Tauri CLI:
cargo install tauri-cli
- Install Rust targets (for cross-compilation or platform-specific builds):
# For macOS universal builds
rustup target add x86_64-apple-darwin aarch64-apple-darwin
# For Android (arm64 and x86_64)
rustup target add aarch64-linux-android x86_64-linux-android
# For iOS (arm64)
rustup target add aarch64-apple-ios
# For standard platforms if needed
rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-pc-windows-msvc
- Make scripts executable:
chmod +x scripts/*.sh
- Run the development server:
cargo tauri dev
This project includes VS Code configurations for optimal development:
-
Tasks: Press
Ctrl+Shift+B
(Windows/Linux) orCmd+Shift+B
(macOS) to access build tasksfast-build
: Quick development buildfast-build-release
: Optimized release buildbuild-macos-universal
: Universal macOS binary buildfast-build-universal
: Quick universal macOS build
-
Debugging: Press
F5
to start debugging or use the Run panelTauri: Boilerplate Debug
: Debug full applicationBlazor: Boilerplate Debug
: Debug only Blazor WebAssemblyAttach to Blazor WebAssembly
: Attach to running WebAssembly
For quick iteration during development:
# Start the development server with hot reloading
cargo tauri dev
# Fast build with development optimizations
./scripts/fast-build.sh
Build production-ready applications:
# Standard production build
cargo tauri build
# Optimized release build with our script
./scripts/fast-build.sh --release
Create a universal binary compatible with both Intel and Apple Silicon Macs:
# Using the dedicated script
./scripts/build-macos-universal.sh
# Or using the fast-build script with universal flag
./scripts/fast-build.sh --universal --release
# Or directly with cargo
cargo tauri build --target universal-apple-darwin
For more information, see MACOS_UNIVERSAL_BUILDS.md.
To build for Android:
-
Install Android prerequisites:
# Install Android SDK and NDK via Android Studio # Set environment variables (add to your shell profile) export ANDROID_HOME=/path/to/android/sdk export NDK_HOME=$ANDROID_HOME/ndk/[version]
-
Install Tauri Android CLI tools:
cargo install tauri-cli --features android cargo install cargo-ndk
-
Add Android-specific configuration to
tauri.conf.json
:# Execute from project root cargo tauri android init
-
Build for Android:
# Development build cargo tauri android dev # Production build cargo tauri android build
The APK will be generated in src-tauri/gen/android/app/build/outputs/apk/
.
To build for iOS (requires macOS):
-
Install iOS prerequisites:
# Install Xcode Command Line Tools xcode-select --install # Install Tauri iOS CLI tools cargo install tauri-cli --features ios
-
Add iOS-specific configuration to
tauri.conf.json
:# Execute from project root cargo tauri ios init
-
Build for iOS:
# Development build cargo tauri ios dev # Production build cargo tauri ios build
Open the generated Xcode project in src-tauri/gen/ios/[AppName]
and run on a simulator or device.
- Light/Dark mode toggle with Material 3 design
- Persistent theme settings
- Native dialogs and file system access
- Window management and system information
- Cross-platform APIs
- Global error handler with notifications
- Structured logging
- Application loading spinner
- Operation progress indicators
- Mobile-first approach
- Adaptive layouts
- Custom
.cargo/config.toml
with optimized settings - Specific toolchain requirements in
rust-toolchain.toml
- CI/CD optimizations with efficient caching
- Release build tuning for smaller, faster binaries
- Incremental compilation for faster dev cycles
- Efficient dependency caching
- Parallel compilation enabled by default
This project includes GitHub Actions workflows for:
- Continuous Integration testing on all platforms
- Automated releases for desktop platforms
- Changelog generation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Tauri - For the lightweight application framework
- Blazor - For the WebAssembly framework
- Radzen - For the Blazor component library
- .NET - For the core framework
Created with ❤️ by Devstroop Team