Architecture
Application boundaries
The Tauri shell, Rust backend, static frontend, and command surface.
The application has two explicit sides: a static frontend served by Tauri and a Rust backend exposed through narrowly scoped commands. The backend is authoritative for host detection, VM validation, persistence, disk creation, and process lifecycle.
Tauri shell
The main window is defined in src-tauri/tauri.conf.json. Tauri serves the static files in src/ as the frontend distribution and enables the global Tauri bridge. The window has a minimum size and is resizable.
Command surface
The current invoke handler registers seven commands:
get_app_info— returns the application name, version, data directory, configuration path, vms directory, schema version, and timestamps.detect_host— runs host diagnostics on a blocking worker thread and returns the structured host result.list_vms— returns saved machine summaries and reconciles runtime state.create_vm— validates input, creates a QCOW2 disk, and persists a machine definition.start_vm— launches QEMU and records the running state after QMP confirms it.stop_vm— stops QEMU through QMP with termination fallbacks.get_vm_console— returns the loopback WebSocket URL and per-run password for a running machine.
The frontend calls these through window.__TAURI__.core.invoke from src/services/tauri.js and the service wrappers. There is no arbitrary filesystem command, arbitrary QEMU argument command, media command, or networking command.
Frontend boundary
The frontend is static and has no bundler. It renders loading, error, machine, and console states and calls the backend through the registered commands. It does not read files or start processes directly. Host and machine data are rendered as structured values rather than trusted HTML.
Capabilities and CSP
The capability set is minimal and scoped to the main window. The Content Security Policy restricts scripts, styles, images, fonts, and connections to local application resources, the Tauri IPC endpoint, and loopback WebSocket connections for the console. Remote web content is not loaded into a privileged window.
The command surface is still narrow
Source references
- src-tauri/src/lib.rs — invoke handler.
- commands/vm.rs — VM creation, lifecycle, and console commands.
- src/app.js — frontend bootstrap and routing.
- capabilities/default.json — capability scope.
- tauri.conf.json — window, CSP, and frontend distribution.
Continue with Virtualization integration.