Documents
04 - Backend Overview
04 - Backend Overview
Type
Document
Status
Published
Created
May 26, 2026
Updated
May 26, 2026
Updated by
Dosu Bot

The Helmor backend is a Rust application built on Tauri 2. It owns persistence, workspace lifecycle, agent orchestration, and all Git operations. The frontend communicates with it exclusively through Tauri IPC commands.

Tech stack#

ComponentTechnology
FrameworkTauri 2
Async runtimeTokio
DatabaseSQLite via rusqlite (WAL mode)
HTTPreqwest with rustls
EncryptionAES, HMAC, PBKDF2
Loggingtracing with JSON output

Module structure#

src-tauri/src/
├── commands/ # Tauri IPC handlers by domain
│ ├── workspace/ # Workspace CRUD, lifecycle
│ ├── session/ # Session management, streaming
│ ├── editor/ # File read/write operations
│ ├── git/ # Branch, commit, diff, push
│ ├── forge/ # GitHub integration, PRs
│ ├── scripts/ # Setup script execution
│ └── terminal/ # PTY management
├── models/ # SQLite data models
├── workspace/ # Workspace lifecycle, file ops, PR sync
├── agents/ # Agent orchestration
├── pipeline/ # Message streaming pipeline
├── sidecar.rs # Sidecar process management
└── db/ # Connection pooling, migrations

Database architecture#

Helmor uses a dual-pool SQLite setup:

  • Read pool — 8 connections for concurrent queries.
  • Write pool — 1 connection to serialize mutations.
  • All connections: WAL mode, 20 MiB cache, 256 MiB mmap.

Core tables: repos, workspaces, sessions, session_messages, settings.

Per-workspace locks serialize filesystem mutations with database updates to prevent corruption when multiple operations target the same workspace.

Data directory#

  • Production: ~/.helmor/
  • Development: ~/.helmor-dev/
  • Contents: helmor.db, workspaces/, chats/, logs/

Key responsibilities#

  • Workspace lifecycle — two-phase creation (fast DB insert + async worktree materialization), state transitions, archiving.
  • Session orchestration — message persistence, stream locking, heartbeat timeout (45s), provider session resumption.
  • Git operations — worktree management, branching, diffing, commit, push.
  • Sidecar supervision — spawn on first request, health monitoring, three-step shutdown ladder.