# deepfounder-ai/desigma architecture

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

- Interactive diagram: https://gitdiagram.com/deepfounder-ai/desigma
- Repository: https://github.com/deepfounder-ai/desigma

## Overview

Desigma is a local-first native interface-design editor. Users open or import a design, edit its document on the canvas with design and prototype tools, then present, export, or hand off the result. The graph preserves documented capabilities including decks, variables, comments, libraries, and developer code generation. Some feature paths are identified from the tree and README rather than sampled implementation; those connections are shown as unverified where appropriate.

Main entry points: [`crates/desigma-app/src/app.rs`](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/app.rs) (Desktop app), [`crates/desigma-doc/src/lib.rs`](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-doc/src/lib.rs) (Design document), [`crates/desigma-app/src/canvas/interact.rs`](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/canvas/interact.rs) (Canvas interactions), [`crates/desigma-app/src/decks/ui.rs`](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/decks/ui.rs) (Deck editing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["App experience"]
  node_app["Desktop app<br/>[app.rs]"]
  node_home["File browser<br/>[mod.rs]"]
  node_deck["Deck editing<br/>[ui.rs]"]
end

subgraph group_editing["Design editing"]
  node_canvas["Canvas interactions<br/>[interact.rs]"]
  node_tools["Editor tools<br/>[tools.rs]"]
  node_text["Rich text<br/>[richtext.rs]"]
  node_variables["Variables and modes<br/>[view.rs]"]
  node_comments["Comments<br/>[mod.rs]"]
  node_prototype["Prototype playback<br/>[player.rs]"]
end

subgraph group_document["Document pipeline"]
  node_document["Design document<br/>[lib.rs]"]
  node_figimport["Figma import<br/>[rest_import.rs]"]
  node_figcontainer[".fig decoding<br/>[kiwi.rs]"]
  node_renderer["CPU renderer<br/>[lib.rs]"]
end

subgraph group_sharing["Sharing and handoff"]
  node_export["Design export<br/>[lib.rs]"]
  node_present["Presentation<br/>[present.rs]"]
  node_devmode["Developer handoff<br/>[mod.rs]"]
end

subgraph group_services["Local services"]
  node_library[("Shared libraries<br/>[store.rs]")]
  node_fontcache[("Font cache<br/>[cache.rs]")]
  node_mcp["MCP document tools<br/>[engine.rs]"]
end

node_designer(("Designer"))

node_designer -->|"opens"| node_app
node_app -->|"shows files"| node_home
node_home -->|"opens design"| node_app
node_app -->|"hosts editing"| node_canvas
node_canvas -->|"dispatches tools"| node_tools
node_canvas -->|"edits text"| node_text
node_canvas -.->|"edits nodes"| node_document
node_app -->|"hosts variables"| node_variables
node_app -->|"hosts comments"| node_comments
node_app -->|"hosts prototyping"| node_prototype
node_designer -->|"imports REST JSON"| node_figimport
node_designer -->|"imports .fig"| node_figcontainer
node_figcontainer -->|"reuses mapper"| node_figimport
node_figimport -->|"builds document"| node_document
node_document -->|"renders pages"| node_renderer
node_document -.->|"exports designs"| node_export
node_designer -->|"creates slides"| node_deck
node_deck -->|"starts presentation"| node_present
node_deck -->|"exports deck PDF"| node_export
node_designer -->|"requests handoff"| node_devmode
node_designer -->|"uses shared assets"| node_library
node_app -->|"loads fonts"| node_fontcache
node_designer -.->|"uses document tools"| node_mcp
node_mcp -->|"runs commands"| node_document

click node_app "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/app.rs"
click node_home "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/home/mod.rs"
click node_deck "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/decks/ui.rs"
click node_canvas "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/canvas/interact.rs"
click node_tools "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/canvas/tools.rs"
click node_text "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/richtext.rs"
click node_variables "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/variables/view.rs"
click node_comments "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/comments/mod.rs"
click node_prototype "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/proto/player.rs"
click node_document "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-doc/src/lib.rs"
click node_figimport "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-fig/src/rest_import.rs"
click node_figcontainer "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-fig/src/kiwi.rs"
click node_renderer "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-render/src/lib.rs"
click node_export "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-export/src/lib.rs"
click node_present "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/present.rs"
click node_devmode "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/dev/mod.rs"
click node_library "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-library/src/store.rs"
click node_fontcache "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-fonts/src/cache.rs"
click node_mcp "https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-mcp/src/engine.rs"

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_home,node_deck toneBlue
class node_canvas,node_tools,node_text,node_variables,node_comments,node_prototype toneAmber
class node_document,node_figimport,node_figcontainer,node_renderer toneMint
class node_export,node_present,node_devmode toneRose
class node_library,node_fontcache,node_mcp,node_designer toneIndigo
```

## Components

### App experience

- [Desktop app](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/app.rs): `crates/desigma-app/src/app.rs`
- [File browser](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/home/mod.rs): `crates/desigma-app/src/home/mod.rs`
- [Deck editing](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/decks/ui.rs): `crates/desigma-app/src/decks/ui.rs`

### Design editing

- [Canvas interactions](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/canvas/interact.rs): `crates/desigma-app/src/canvas/interact.rs`
- [Editor tools](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/canvas/tools.rs): `crates/desigma-app/src/canvas/tools.rs`
- [Rich text](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/richtext.rs): `crates/desigma-app/src/richtext.rs`
- [Variables and modes](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/variables/view.rs): `crates/desigma-app/src/variables/view.rs`
- [Comments](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/comments/mod.rs): `crates/desigma-app/src/comments/mod.rs`
- [Prototype playback](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/proto/player.rs): `crates/desigma-app/src/proto/player.rs`

### Document pipeline

- [Design document](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-doc/src/lib.rs): `crates/desigma-doc/src/lib.rs`
- [Figma import](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-fig/src/rest_import.rs): `crates/desigma-fig/src/rest_import.rs`
- [.fig decoding](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-fig/src/kiwi.rs): `crates/desigma-fig/src/kiwi.rs`
- [CPU renderer](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-render/src/lib.rs): `crates/desigma-render/src/lib.rs`

### Sharing and handoff

- [Design export](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-export/src/lib.rs): `crates/desigma-export/src/lib.rs`
- [Presentation](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/present.rs): `crates/desigma-app/src/present.rs`
- [Developer handoff](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-app/src/dev/mod.rs): `crates/desigma-app/src/dev/mod.rs`

### Local services

- [Shared libraries](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-library/src/store.rs): `crates/desigma-library/src/store.rs`
- [Font cache](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-fonts/src/cache.rs): `crates/desigma-fonts/src/cache.rs`
- [MCP document tools](https://github.com/deepfounder-ai/desigma/blob/main/crates/desigma-mcp/src/engine.rs): `crates/desigma-mcp/src/engine.rs`

### Other components

- **Designer**

## Connections

- Designer → Desktop app: opens
- Desktop app → File browser: shows files (evidence: `crates/desigma-app/src/app.rs`)
- File browser → Desktop app: opens design (evidence: `crates/desigma-app/src/home/mod.rs`)
- Desktop app → Canvas interactions: hosts editing (evidence: `crates/desigma-app/src/app.rs`)
- Canvas interactions → Editor tools: dispatches tools
- Canvas interactions → Rich text: edits text
- Canvas interactions → Design document: edits nodes
- Desktop app → Variables and modes: hosts variables (evidence: `crates/desigma-app/src/app.rs`)
- Desktop app → Comments: hosts comments (evidence: `crates/desigma-app/src/app.rs`)
- Desktop app → Prototype playback: hosts prototyping (evidence: `crates/desigma-app/src/app.rs`)
- Designer → Figma import: imports REST JSON
- Designer → .fig decoding: imports .fig
- .fig decoding → Figma import: reuses mapper (evidence: `crates/desigma-fig/src/rest_import.rs`)
- Figma import → Design document: builds document (evidence: `crates/desigma-fig/src/rest_import.rs`)
- Design document → CPU renderer: renders pages (evidence: `crates/desigma-render/src/lib.rs`)
- Design document → Design export: exports designs
- Designer → Deck editing: creates slides
- Deck editing → Presentation: starts presentation
- Deck editing → Design export: exports deck PDF
- Designer → Developer handoff: requests handoff
- Designer → Shared libraries: uses shared assets
- Desktop app → Font cache: loads fonts (evidence: `crates/desigma-app/src/app.rs`)
- Designer → MCP document tools: uses document tools
- MCP document tools → Design document: runs commands (evidence: `crates/desigma-mcp/src/engine.rs`)
