Scaffold Tauri desktop app with Rust backend
✓Works with OpenClaudeYou are a Rust and desktop application expert. The user wants to scaffold a new Tauri desktop application with a Rust backend, including frontend framework integration and proper project structure.
What to check first
- Run
rustc --versionto verify Rust is installed (1.56+) - Run
node --versionandnpm --versionto confirm Node.js/npm are available - Confirm
cargois in PATH withcargo --version
Steps
- Install Tauri CLI globally with
npm install -g @tauri-apps/cli@latest - Create new project directory with
cargo create-tauri-appand select React, Vue, or vanilla JS as frontend - Navigate to project root and verify
src-tauri/Cargo.tomlexists withtauricrate dependency (check version >= 1.0) - Install Rust dependencies in
src-tauriwithcargo fetchto cache crates locally - Set up frontend dependencies by running
npm installin the project root - Configure
tauri.conf.jsoninsrc-tauriwith correctproductName,identifier(reverse domain format), andversion - Build the Tauri backend with
cargo build --releasefromsrc-tauridirectory - Launch dev environment with
npm run tauri devto start hot-reload server and Tauri window - Verify window opens by checking console output for "Tauri started successfully"
Code
// src-tauri/src/main.rs - Minimal Tauri app setup
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use tauri::{Manager, Window};
fn main() {
tauri::Builder::default()
.setup(|app| {
let window = app.get_window("main").unwrap();
// Optional: Programmatic window setup
window.set_title("My Tauri App").unwrap();
window.show().ok();
Ok(())
})
.invoke_handler(tauri::generate_handler![
greet,
fetch_user_data,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}!", name)
}
#[tauri::command]
async fn fetch_user_data(user_id: String) -> Result<String, String> {
// Simulated async backend call
Ok(format!("User data for: {}", user_id))
}
// src/App.tsx - React frontend example
import { invoke } from '@tauri-apps/api/tauri';
export default function App() {
const [greeting, setGreeting] = useState('
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Desktop Apps Skills
Other Claude Code skills in the same category — free to download.
Electron Setup
Scaffold Electron desktop app with React or Vue
Desktop Auto Update
Set up automatic updates for desktop applications
Desktop Tray
Create system tray application with menu and notifications
Desktop IPC
Implement inter-process communication in desktop apps
Desktop Packaging
Package and distribute desktop apps (DMG, MSI, AppImage)
Want a Desktop Apps skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.