> ## Documentation Index
> Fetch the complete documentation index at: https://openidea.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture overview

> The processes and layers of OpenIDEA: the Tauri shell, the webview frontend, the UI-less Rust host, feature crates, external servers, plugins and the remote server.

OpenIDEA is a Tauri 2 desktop app. The UI is a React + CodeMirror 6 frontend in the system webview; everything that touches the disk, processes or the network runs in Rust. The Rust side is built so that the same backend runs inside the desktop app and, for remote development, on another machine as `openidea-server`.

## The big picture

```mermaid theme={null}
flowchart TB
  subgraph Desktop["Desktop app (one process)"]
    direction TB
    subgraph Webview["Webview: src/"]
      WB["workbench + features<br/>actions, keymaps, contributions"]
      ED["editor: CodeMirror 6"]
      PL["platform/ipc<br/>call, onIdeEvent, Channel"]
      WB --> PL
      ED --> PL
    end
    subgraph Shell["src-tauri: glue"]
      CMD["commands/*.rs<br/>typed IPC adapters"]
      EV["events.rs: TauriSink<br/>ide://event"]
      RD["remote_dev.rs<br/>remote_invoke"]
    end
    subgraph Host["ide-host: Host (no UI toolkit)"]
      OPS["ops/: shared command implementations"]
      PRJ["Project per window<br/>documents, LSP, index, VCS"]
      PH["plugins: PluginHost"]
    end
    CRATES["feature crates<br/>ide-lsp, ide-dap, ide-index, ide-vcs,<br/>ide-search, ide-run, ide-terminal..."]
    CORE["ide-core: shared types"]
    PL -- "invoke (JSON)" --> CMD
    EV -- "IdeEvent" --> PL
    CMD --> OPS
    OPS --> PRJ
    PRJ --> CRATES
    PH --> WASM["ide-plugin: wasmtime<br/>one actor thread per plugin"]
    CRATES --> CORE
  end
  LS["language servers"]
  DA["debug adapters"]
  TOOLS["git, build tools, PTYs, ACP agents"]
  MCP["external AI agents"]
  CRATES -- "LSP / JSON-RPC over stdio" --> LS
  CRATES -- "DAP" --> DA
  CRATES --> TOOLS
  MCP -- "MCP over HTTP 127.0.0.1" --> Host
  subgraph Remote["Remote machine"]
    SRV["openidea-server --stdio<br/>ide-host: Host + rpc"]
  end
  RD -- "JSON-RPC over SSH / wsl.exe / docker exec" --> SRV
```

## Layers

| Layer | Where | Role |
| - | - | - |
| Frontend | `src/` | Rendering, interaction and editor state. Features register actions, tool windows and editor extensions; they reach the backend only through the generated bindings. See [Frontend](https://openidea.sh/en/contribute/architecture/frontend.md). |
| Generated bindings | `src/bindings.ts` | Typed TypeScript for every command and IPC type, generated by tauri-specta. Never edited by hand. See [IPC](https://openidea.sh/en/contribute/architecture/ipc.md). |
| Desktop shell | `src-tauri/` | Glue only: `AppState`, one `commands/<domain>.rs` per domain, the event sink, windows, menus, the remote-development client. No domain logic. |
| Host | `crates/ide-host` | The IDE backend without a UI toolkit: projects per window, settings, terminals, processes, trust, plugins, MCP, and `ops/` — the implementations that both the desktop commands and `openidea-server` call. |
| Feature crates | `crates/ide-*` | One domain each (LSP, DAP, index, git, search, run, database…). They depend on `ide-core` and never on each other's internals. See [Crates](https://openidea.sh/en/contribute/architecture/crates.md). |
| Shared vocabulary | `crates/ide-core` | Ids, text coordinates, `IdeError`, `IdeEvent`, settings types — anything that crosses a crate or the IPC boundary. |

## Processes

* **The app process** hosts the webview and the whole Rust backend (Tokio runtime plus blocking pools). There is one backend for all windows; each project window owns one `Project` in the host.
* **Language servers and debug adapters** are child processes, started lazily per language and workspace root from `languages/<id>.toml`. The backend speaks LSP / DAP to them (`ide-lsp`, `ide-dap` over `ide-jsonrpc`). See [Code intelligence](https://openidea.sh/en/contribute/architecture/code-intelligence.md).
* **Tools** are run through their CLIs where that keeps behaviour identical to the command line: `git` for writes (reads use gitoxide in-process), `docker`, `adb`, `gh`, Maven/Gradle, coding agents over ACP.
* **Plugins** run in-process as WebAssembly components, each on its own thread with its own sandboxed store. See [Plugin host](https://openidea.sh/en/contribute/architecture/plugin-host.md).
* **`openidea-server`** is the same `Host` with a JSON-RPC front instead of Tauri. The desktop starts it over SSH, WSL or `docker exec` and routes a remote window's commands to it. See [Remote development](https://openidea.sh/en/contribute/architecture/remote.md).
* **Local servers** for outside clients: the MCP server for AI agents (`ide-mcp`) and the built-in static web server (`ide-web`), both on `127.0.0.1`.

## How a request flows

Taking Find in Files as an example:

1. The search feature allocates a `RequestId`, creates a `Channel`, and calls `commands.searchStart(request, query, channel)` from `src/bindings.ts`.
2. Tauri dispatches to `search_start` in `src-tauri/src/commands/search.rs`, after the invoke handler has checked project trust.
3. The command forwards to `ide_host::ops::search::start`, which registers a `CancellationToken` for the request and runs the `ide-search` engine on a blocking thread.
4. Each file's matches are sent through the channel as they are found; the command resolves after sending `Done`.
5. If the user cancels, the UI calls `cancel_request(request)` and the token stops the walk.

The same `ops::search::start` serves a remote window: the frontend's `invoke` is routed to `remote_invoke`, the server runs the identical function, and channel values come back tagged with their channel id.

## Where to go next

> [card] [Rust or UI?](https://openidea.sh/en/contribute/architecture/boundaries.md)
>
> Which side a feature belongs on, with examples.

> [card] [IPC](https://openidea.sh/en/contribute/architecture/ipc.md)
>
> Commands, errors, streaming, cancellation and events.

> [card] [Crates](https://openidea.sh/en/contribute/architecture/crates.md)
>
> Every backend crate and what it owns.

> [card] [Frontend](https://openidea.sh/en/contribute/architecture/frontend.md)
>
> Actions, keymaps, context keys and contributions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.