Start in context
- 01Launch r0
The desktop app starts its React workbench and native services.
- 02Open a workspace
Settings and project context prepare files, search, and language tools.
BOOTSTRAP · WORKSPACE · PROJECT// SYSTEMS GUIDE · FROM USER FLOW TO IMPLEMENTATION
r0 is a native desktop IDE with a React and TypeScript workbench, a Tauri application host, domain-organized Rust commands, and a multi-crate Rust workspace. This guide follows a real project session from launch through editing, tools, review, and Git—and explains what each architectural layer contributes.
01 / HIGH-LEVEL USER FLOW
Start from what the person does. r0 keeps editing, AI assistance, project tools, verification, and source control near the same workspace; each step activates different frontend features and native services as needed.
The desktop app starts its React workbench and native services.
Settings and project context prepare files, search, and language tools.
BOOTSTRAP · WORKSPACE · PROJECTBrowse, open, search, and change project files.
Bring in AI, terminal, Git, database, and debugger tools as needed.
EDITOR · AI · TERMINAL · GITInspect edits and diffs, run project checks, and review status.
Stage intended files, commit, and continue the development loop.
REVIEW · RUN ACTIONS · VERSION CONTROL02 / HIGH-LEVEL SYSTEM MAP
The frontend owns presentation and feature workflows. Tauri hosts it and exposes native capabilities. Rust command adapters connect that desktop boundary to domain services and, where configured, external tools or providers.
src/Renders the application shell and feature-owned interface, hooks, stores, and services. The code is organized around user-facing capabilities such as AI, Git, terminal, and workspace navigation.
Browse this sourcesrc-tauri/Owns the native app lifecycle, desktop plugins, window setup, shared managed state, and the bridge between frontend requests and Rust-side functionality.
Browse this sourcesrc-tauri/src/commands/Groups desktop-facing operations by area—AI, project, editor, database, version control, UI, and development—so app-specific transport concerns are distinct from the domain crates.
Browse this sourcecrates/Holds focused native capabilities such as AI integrations, project/file operations, terminal sessions, Git, databases, language servers, extensions, search, remote support, and debugging.
Browse this source03 / APPLICATION STARTUP
Startup is split across the native process and frontend. The frontend tracks named bootstrap phases so settings, foundational services, and extensions do not all need to initialize in one blocking step.
src-tauri/src/main.rs prepares the Tauri application, its plugins, window behavior, and app configuration. The native process owns OS integration and shutdown.
src/main.tsx creates the React root. src/App.tsx provides the outer shell and lazy-loads the workbench or specialized windows.
The bootstrap service coordinates settings with foundational async work and records progress. The workbench can render while non-blocking setup continues.
After the first workbench frame, startup finishes foundation tasks, registers contributions, and then starts extension-runtime work before reaching the corresponding readiness phases.
app_setup.rs places shared managers—such as terminal, agent bridge, language server, debugger, and search state—into Tauri-managed application state.
The bootstrap implementation waits for settings and foundational tasks, reports their outcomes, then advances the workbench phase.
const foundationalResults = await Promise.allSettled([
settingsLoaded,
...foundationalBootstrapSteps.map((step) => step.run()),
]);
reportBootstrapResults(steps, foundationalResults);
useBootstrapPhaseStore.getState().actions.reachPhase("workbench-ready");
const extensionResults = await Promise.allSettled(
extensionBootstrapSteps.map((step) => step.run()),
);
reportBootstrapResults(extensionBootstrapSteps, extensionResults);
useBootstrapPhaseStore.getState().actions.reachPhase("extensions-ready");04 / COMMANDS, EVENTS, AND REQUEST LIFECYCLE
The Tauri boundary supports request/response commands and asynchronous events. Commands are grouped by domain in the app; domain crates hold reusable native capabilities. The exact path varies by feature.
UI reads current workspace and user input.
Tauri transports a command and its arguments.
Rust handler checks context and accesses managed services.
Project, AI, Git, terminal, or another service does its work.
User action
→ React feature updates UI state
→ Tauri command request crosses the desktop boundary
→ Rust command validates and coordinates the operation
→ Domain service performs native or integration work
← command result returns, or events report ongoing changes
← React feature updates the viewA user action such as opening or changing a project file is handled through project-oriented commands and services. A completed operation returns a result; an error must stay visible to the caller.
A terminal or agent session outlives a single command. r0 tracks session state and routes output/events so the right workbench window can update while the process is active.
The native workspace-change sink delivers file-change batches to subscribed windows and feeds the search index. This keeps editor views and search aware of file changes without making each view poll independently.
Tauri-managed state lets command handlers share long-lived managers. This excerpt follows the actual manager types used by app setup.
let terminal_manager = Arc::new(TerminalManager::new());
app.manage(terminal_manager.clone());
app.manage(FrontendTerminalSessions::default());
let acp_bridge = Arc::new(Mutex::new(AcpAgentBridge::new(
Arc::new(TauriAcpEventSink::new(app.handle().clone())),
acp_host_info(app.handle()),
terminal_manager,
commands::agent_launch_env(app.handle().clone()),
)));
app.manage(acp_bridge);05 / IDE SUBSYSTEMS
Frontend feature directories group the user-facing workflow; Rust crates group native implementation. src-tauri/src/commands connects the two where a feature needs desktop capabilities.
| Product area | Frontend | Native / Rust | What the area owns |
|---|---|---|---|
| Workbench and startup | features/bootstrap · features/layout · features/window | src-tauri app setup | Mounts the shell, initializes settings and feature contributions, manages windows, and prepares shared native services. |
| Editor and language tools | features/editor · features/outline · features/references | crates/lsp · crates/runtime | Connects editing and navigation workflows with language-server, runtime, and editor services. |
| Project files and search | features/workspace · features/file-explorer · features/file-search · features/quick-open | crates/project · crates/fff-search | Works with project roots, file operations, workspace changes, quick navigation, and search. |
| AI and agents | features/ai | crates/ai · crates/claude-ide · commands/ai | Connects the agent interface and session workflows to supported agent/protocol integrations and native workspace operations. |
| Git and GitHub | features/git · features/github | crates/version-control · crates/github · commands/version_control | Separates local repository operations from GitHub-connected features and their workbench UI. |
| Terminal and execution | features/terminal · features/run-actions | crates/terminal · crates/exec-path · crates/runtime · crates/wsl | Coordinates terminal sessions and execution-related support across available host environments. |
| Database and debugging | features/database · features/debugger | crates/database · crates/debugger | Provides dedicated database and debugging integration areas. Exact providers and setup depend on the installed build. |
| Extensions and appearance | features/extensions · extensions/themes · features/settings | crates/extensions · app settings and plugins | Connects extension/runtime and theme customization with user settings and desktop integration. |
| Additional integrations | features/browser · features/docker · features/remote · features/collaboration | crates/browser · crates/docker · crates/remote · crates/wsl | Organizes browser, container, remote, WSL, and collaboration-related capabilities into focused product areas. |
The workbench’s editor, outline, references, and navigation features are distinct from native language-server management. A language feature can depend on the project being open and the language tooling being available and configured.
Agent integrations are a workflow layer, not a substitute for review. The frontend handles sessions and user-facing change review; Rust AI services and commands coordinate supported providers and workspace operations.
Local source-control operations live in the version-control domain; GitHub integrations have their own feature and crate areas. Provider credentials and remote access are separate from merely opening a local repository.
Database engines, debuggers, browser tools, Docker, remote environments, extensions, and AI providers may require installation, configuration, or platform support. A directory in the repository does not imply every integration is active in every build.
06 / STATE, SESSIONS, AND LIFECYCLE
The app has more than one kind of state. Durable preferences, active workspace context, frontend view state, native service managers, and live terminal or agent sessions have different owners and lifetimes.
Settings initialize early because themes, keymaps, and other interface behavior depend on them. Bootstrap phases coordinate consumers so they do not write defaults over settings that have not loaded.
The active project/root informs file operations, search, language tools, terminal context, and version control. Multi-window workflows need explicit project and window ownership.
Tauri-managed state holds services such as terminal and language-server managers that are reused by commands. The app setup composes them with event sinks and per-window/session coordination.
Terminal and agent sessions have identifiers and connections. Window close, retry, or session replacement must clean up or supersede stale links so output is not attributed to the wrong session.
07 / CORE ARCHITECTURAL PRINCIPLES
These principles follow from the product’s actual structure and help contributors change one workflow without breaking neighboring ones.
Feature areas such as AI, Git, terminal, database, and workspace own their components, services, stores, and tests. Keep UI behavior close to the workflow it serves.
Tauri commands adapt app-level requests to native capabilities. Put reusable domain behavior in its service/crate when appropriate instead of coupling domain logic to a particular screen.
Commands can start or control an operation; events can report progress, output, or workspace changes. Model subscriptions and teardown as part of the feature, not incidental UI code.
A desktop app can have multiple windows and concurrent projects. Route file-change and session events to their intended owner, and verify the active project before performing mutations.
Load essential settings and foundational services before dependents need them; let later contributions such as extension runtime follow the workbench-ready phase.
AI providers, language servers, databases, remote environments, and extensions have their own setup and failure modes. Surface missing prerequisites instead of disguising an unavailable integration as success.
08 / VERTICAL WALKTHROUGH
For example, following a terminal action from its panel to native session management gives a practical way to orient yourself in this repository.
src/features/terminal/Look for the panel/component and hook responsible for the interaction.
src/features/terminal/services/ · hooks/ · stores/Identify how the UI tracks the active terminal, sends input, and subscribes to output or lifecycle events.
src-tauri/src/terminal.rs · src-tauri/src/main.rsInspect the Tauri commands and their registration/managed state. The app exposes operations including beginning a frontend session, creating a terminal, writing input, and resizing.
crates/terminal/Follow the terminal manager, shell, connection, and protocol modules for implementation details.
frontend tests · Rust tests · app buildCover session start, output, retry/cleanup, and window ownership where relevant—not only the first successful launch.
09 / SOURCE MAP
Use these entry points to follow the implementation. The repository is the source of truth as modules and integrations evolve.
src/
main.tsx React mount
App.tsx Shell, error boundary, lazy entry points
workbench-app.tsx Main workbench composition
features/ Feature-owned UI, state, and services
src-tauri/src/
main.rs Native process and Tauri builder
app_setup.rs App setup and shared managed state
commands/ Domain-organized desktop adapters
terminal.rs Terminal session bridge
file_events.rs Workspace change delivery
acp_events.rs Agent protocol event sink
crates/
ai/ project/ terminal/ version-control/
database/ lsp/ extensions/ fff-search/
debugger/ browser/ docker/ remote/ wsl/ ...src/main.tsx↗Application shellsrc/App.tsx↗Workbench compositionsrc/workbench-app.tsx↗Bootstrap orchestrationsrc/features/bootstrap/services/initialize-app-bootstrap.ts↗Native application entrysrc-tauri/src/main.rs↗Native service setupsrc-tauri/src/app_setup.rs↗Domain command modulessrc-tauri/src/commands/mod.rs↗Rust workspace manifestCargo.toml↗10 / CONTRIBUTOR CHECKLIST
01 Start from the user workflow and identify the owning frontend feature.
02 Trace each native call to its Tauri command and domain service.
03 Define the response, event, error, workspace, and window ownership behavior.
04 Add a focused regression test at the layer where the behavior lives.
05 Run relevant checks, review the diff, and verify the integrated workflow.
This guide describes implementation areas present in the public repository, not a guarantee that every provider, database, debugger, or platform integration is enabled in every release. Check the installed version’s release notes and project documentation for current support.
No results matching ""
Try searching for themes, shortcuts, Git, or terminal.