Getting Started - aguspe/turbo_desktop GitHub Wiki
Getting Started
This guide walks you through creating your first Turbo Desktop app from scratch.
Prerequisites
- Ruby >= 3.1.0 and Rails >= 7.0
- Node.js >= 18
- Rust — install from rustup.rs
- Tauri CLI —
cargo install tauri-cli
Step 1: Create a Rails App
Start with a standard Rails app (or use an existing one):
rails new myapp
cd myapp
Step 2: Add the Turbo Desktop Gem
# Gemfile
gem "turbo_desktop-rails"
bundle install
rails generate turbo_desktop:install
This does two things:
- Creates
config/initializers/turbo_desktop.rbwith default path configuration - Mounts the engine at
/turbo-desktopin your routes
Step 3: Scaffold the Desktop Shell
npx turbo-desktop init
This creates a desktop/ directory with:
turbo-desktop.config.json— your app name, server URL, window size- Tauri configuration files
Step 4: Configure the Server URL
Edit desktop/turbo-desktop.config.json:
{
"server_url": "http://localhost:3000",
"app_name": "My App",
"window": {
"width": 1000,
"height": 700,
"resizable": true
}
}
Step 5: Run It
# Terminal 1: Start Rails
bin/rails server
# Terminal 2: Start the desktop app
cd desktop
cargo tauri dev
Your Rails app is now running in a native desktop window!
What Happens Under the Hood
- Tauri opens a native window with a WebView
- The WebView loads your Rails server URL
turbo-desktop.jsis injected into every page- The JS intercepts Turbo Drive visits and bridges them to native
- Path configuration rules control how URLs are presented (default, modal, new window, etc.)
Next Steps
- Example App — See a complete working example
- Path Configuration — Learn how to route URLs to modals, new windows, etc.
- Bridge Components — Add native notifications, menus, and more