# ember1414/forgedesk architecture

> Architecture diagram of the GitHub repository ember1414/forgedesk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ember1414/forgedesk
- Repository: https://github.com/ember1414/forgedesk

## Overview

ForgeDesk is a cross-platform desktop Git client. The user opens or selects a repository, inspects its status and history, then stages, previews, and performs Git operations; snapshots and operation history provide recovery. Separate branches cover GitHub collaboration, terminal/editor/diagnostics, and plugins/themes/settings. The sampled source confirms the React route and history-query path, the Rust Git engine split, and the plugin sandbox; other feature connections are documented in the README but their implementation was not sampled.

Main entry points: [`crates/commands/src`](https://github.com/ember1414/forgedesk/tree/main/crates/commands/src) (Command handlers), [`src/app/routes.tsx`](https://github.com/ember1414/forgedesk/blob/main/src/app/routes.tsx) (Feature routes), [`src/lib/ipc/client.ts`](https://github.com/ember1414/forgedesk/blob/main/src/lib/ipc/client.ts) (Tauri IPC), [`crates/services/src/repository.rs`](https://github.com/ember1414/forgedesk/blob/main/crates/services/src/repository.rs) (Repository service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop interface"]
  node_app["React application<br/>[App.tsx]"]
  node_routes["Feature routes<br/>[routes.tsx]"]
  node_ipc["Tauri IPC<br/>[client.ts]"]
end

subgraph group_git["Repository operations"]
  node_commands["Command handlers"]
  node_repository["Repository service<br/>[repository.rs]"]
  node_gitengine["Git engines<br/>[libgit2_engine.rs]"]
  node_domain["Git domain"]
  node_workspace["Workspace and sync<br/>[workspace.rs]"]
end

subgraph group_safety["History and recovery"]
  node_history["History graph<br/>[useGraphQuery.ts]"]
  node_safetyui["Snapshots and operations<br/>[SnapshotsPage.tsx]"]
  node_snapshot["Snapshot manager<br/>[ref_manager.rs]"]
  node_storage[("SQLite storage<br/>[database.rs]")]
end

subgraph group_hosting["GitHub integration"]
  node_githubui["GitHub features"]
  node_provider["GitHub provider<br/>[client.rs]"]
end

subgraph group_extensions["Extensions and platform"]
  node_terminal["Terminal and editor<br/>[manager.ts]"]
  node_diagnostics["Diagnostics<br/>[lib.rs]"]
  node_pluginui["Plugin interface"]
  node_pluginhost["Plugin sandbox<br/>[engine_wasmi.rs]"]
  node_settings["Settings and themes<br/>[settingsStore.ts]"]
end

node_user(("User"))
node_github(("GitHub"))

node_user -->|"uses"| node_app
node_app -->|"loads"| node_routes
node_routes -.->|"routes to"| node_history
node_routes -->|"routes to"| node_safetyui
node_routes -->|"routes to"| node_githubui
node_history -->|"requests pages"| node_ipc
node_ipc -.->|"invokes"| node_commands
node_commands -->|"delegates"| node_repository
node_repository -->|"uses engines"| node_gitengine
node_gitengine -->|"implements operations"| node_domain
node_repository -.->|"supports workspace"| node_workspace
node_commands -.->|"backs up writes"| node_snapshot
node_safetyui -.->|"restores snapshots"| node_snapshot
node_commands -.->|"persists state"| node_storage
node_githubui -.->|"uses provider"| node_provider
node_provider -.->|"calls API"| node_github
node_terminal -->|"refreshes state"| node_ipc
node_diagnostics -.->|"supports diagnosis"| node_commands
node_pluginui -.->|"manages plugins"| node_pluginhost
node_settings -->|"loads settings"| node_ipc

click node_app "https://github.com/ember1414/forgedesk/blob/main/src/app/App.tsx"
click node_routes "https://github.com/ember1414/forgedesk/blob/main/src/app/routes.tsx"
click node_ipc "https://github.com/ember1414/forgedesk/blob/main/src/lib/ipc/client.ts"
click node_commands "https://github.com/ember1414/forgedesk/tree/main/crates/commands/src"
click node_repository "https://github.com/ember1414/forgedesk/blob/main/crates/services/src/repository.rs"
click node_gitengine "https://github.com/ember1414/forgedesk/blob/main/crates/git-engine/src/engine/libgit2_engine.rs"
click node_domain "https://github.com/ember1414/forgedesk/tree/main/crates/domain/src/git"
click node_workspace "https://github.com/ember1414/forgedesk/blob/main/crates/services/src/workspace.rs"
click node_history "https://github.com/ember1414/forgedesk/blob/main/src/features/history/useGraphQuery.ts"
click node_safetyui "https://github.com/ember1414/forgedesk/blob/main/src/features/snapshots/SnapshotsPage.tsx"
click node_snapshot "https://github.com/ember1414/forgedesk/blob/main/crates/snapshot/src/ref_manager.rs"
click node_storage "https://github.com/ember1414/forgedesk/blob/main/crates/storage/src/database.rs"
click node_githubui "https://github.com/ember1414/forgedesk/tree/main/src/features/github"
click node_provider "https://github.com/ember1414/forgedesk/blob/main/crates/provider/src/client.rs"
click node_terminal "https://github.com/ember1414/forgedesk/blob/main/src/features/terminal/manager.ts"
click node_diagnostics "https://github.com/ember1414/forgedesk/blob/main/crates/diagnostics/src/lib.rs"
click node_pluginui "https://github.com/ember1414/forgedesk/blob/main/src/features/plugins/PluginPanelsPage.tsx"
click node_pluginhost "https://github.com/ember1414/forgedesk/blob/main/crates/plugin-host/src/engine_wasmi.rs"
click node_settings "https://github.com/ember1414/forgedesk/blob/main/src/stores/settingsStore.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_routes,node_ipc,node_user toneBlue
class node_commands,node_repository,node_gitengine,node_domain,node_workspace toneAmber
class node_history,node_safetyui,node_snapshot,node_storage toneMint
class node_githubui,node_provider toneRose
class node_terminal,node_diagnostics,node_pluginui,node_pluginhost,node_settings,node_github toneIndigo
```

## Components

### Desktop interface

- [React application](https://github.com/ember1414/forgedesk/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Feature routes](https://github.com/ember1414/forgedesk/blob/main/src/app/routes.tsx): `src/app/routes.tsx`
- [Tauri IPC](https://github.com/ember1414/forgedesk/blob/main/src/lib/ipc/client.ts): `src/lib/ipc/client.ts`

### Repository operations

- [Command handlers](https://github.com/ember1414/forgedesk/tree/main/crates/commands/src): `crates/commands/src`
- [Repository service](https://github.com/ember1414/forgedesk/blob/main/crates/services/src/repository.rs): `crates/services/src/repository.rs`
- [Git engines](https://github.com/ember1414/forgedesk/blob/main/crates/git-engine/src/engine/libgit2_engine.rs): `crates/git-engine/src/engine/libgit2_engine.rs`
- [Git domain](https://github.com/ember1414/forgedesk/tree/main/crates/domain/src/git): `crates/domain/src/git`
- [Workspace and sync](https://github.com/ember1414/forgedesk/blob/main/crates/services/src/workspace.rs): `crates/services/src/workspace.rs`

### History and recovery

- [History graph](https://github.com/ember1414/forgedesk/blob/main/src/features/history/useGraphQuery.ts): `src/features/history/useGraphQuery.ts`
- [Snapshots and operations](https://github.com/ember1414/forgedesk/blob/main/src/features/snapshots/SnapshotsPage.tsx): `src/features/snapshots/SnapshotsPage.tsx`
- [Snapshot manager](https://github.com/ember1414/forgedesk/blob/main/crates/snapshot/src/ref_manager.rs): `crates/snapshot/src/ref_manager.rs`
- [SQLite storage](https://github.com/ember1414/forgedesk/blob/main/crates/storage/src/database.rs): `crates/storage/src/database.rs`

### GitHub integration

- [GitHub features](https://github.com/ember1414/forgedesk/tree/main/src/features/github): `src/features/github`
- [GitHub provider](https://github.com/ember1414/forgedesk/blob/main/crates/provider/src/client.rs): `crates/provider/src/client.rs`

### Extensions and platform

- [Terminal and editor](https://github.com/ember1414/forgedesk/blob/main/src/features/terminal/manager.ts): `src/features/terminal/manager.ts`
- [Diagnostics](https://github.com/ember1414/forgedesk/blob/main/crates/diagnostics/src/lib.rs): `crates/diagnostics/src/lib.rs`
- [Plugin interface](https://github.com/ember1414/forgedesk/blob/main/src/features/plugins/PluginPanelsPage.tsx): `src/features/plugins/PluginPanelsPage.tsx`
- [Plugin sandbox](https://github.com/ember1414/forgedesk/blob/main/crates/plugin-host/src/engine_wasmi.rs): `crates/plugin-host/src/engine_wasmi.rs`
- [Settings and themes](https://github.com/ember1414/forgedesk/blob/main/src/stores/settingsStore.ts): `src/stores/settingsStore.ts`

### Other components

- **User**
- **GitHub**

## Connections

- User → React application: uses
- React application → Feature routes: loads (evidence: `src/app/App.tsx`)
- Feature routes → History graph: routes to
- Feature routes → Snapshots and operations: routes to (evidence: `src/app/routes.tsx`)
- Feature routes → GitHub features: routes to (evidence: `src/app/routes.tsx`)
- History graph → Tauri IPC: requests pages (evidence: `src/features/history/useGraphQuery.ts`)
- Tauri IPC → Command handlers: invokes
- Command handlers → Repository service: delegates (evidence: `crates/commands/src/repository.rs`)
- Repository service → Git engines: uses engines
- Git engines → Git domain: implements operations (evidence: `crates/git-engine/src/engine/libgit2_engine.rs`)
- Repository service → Workspace and sync: supports workspace
- Command handlers → Snapshot manager: backs up writes
- Snapshots and operations → Snapshot manager: restores snapshots
- Command handlers → SQLite storage: persists state
- GitHub features → GitHub provider: uses provider
- GitHub provider → GitHub: calls API
- Terminal and editor → Tauri IPC: refreshes state (evidence: `src/features/terminal/manager.ts`)
- Diagnostics → Command handlers: supports diagnosis
- Plugin interface → Plugin sandbox: manages plugins
- Settings and themes → Tauri IPC: loads settings (evidence: `src/stores/settingsStore.ts`)
