# graphiteeditor/graphite architecture

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

- Interactive diagram: https://gitdiagram.com/graphiteeditor/graphite
- Repository: https://github.com/graphiteeditor/graphite

## Overview

Graphite is a graphics editor built around nondestructive, layer-based compositing and procedural node-graph design. The main user workflow is to interact with the editor, ingest or open content, edit it through tools and graph operations, then render and save the result. The README also describes vector and raster creation and desktop availability; collaboration and document-format capabilities are represented as distinct subsystems. Sampled excerpts support the desktop event loop and parts of document ingestion and storage; links to unsampled subsystems are omitted where their callers are not evidenced.

Main entry points: [`editor/src/messages/portfolio/document_storage_io.rs`](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document_storage_io.rs) (Document storage I/O), [`editor/src/dispatcher.rs`](https://github.com/graphiteeditor/graphite/blob/master/editor/src/dispatcher.rs) (Message dispatcher), [`node-graph/graph-craft/src/proto.rs`](https://github.com/graphiteeditor/graphite/blob/master/node-graph/graph-craft/src/proto.rs) (Procedural node graph), [`editor/src/application.rs`](https://github.com/graphiteeditor/graphite/blob/master/editor/src/application.rs) (Editor application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Editor clients"]
  node_frontend["Web editor<br/>[App.svelte]"]
  node_desktop["Desktop app<br/>[app.rs]"]
  node_wrapper["Desktop wrapper<br/>[lib.rs]"]
end

subgraph group_editing["Editing workflow"]
  node_editor_app["Editor application<br/>[application.rs]"]
  node_dispatcher["Message dispatcher<br/>[dispatcher.rs]"]
  node_ingest["Content ingestion"]
  node_tools["Editing tools"]
  node_graph_ops["Graph operations"]
end

subgraph group_engine["Graph and rendering"]
  node_node_graph["Procedural node graph<br/>[proto.rs]"]
  node_brush["Raster brush pipeline<br/>[pipeline.rs]"]
  node_gpu["GPU executor<br/>[pipeline.rs]"]
end

subgraph group_documents["Document services"]
  node_doc_storage["Document storage I/O"]
  node_metadata["Graph metadata bridge"]
  node_format["Document format<br/>[lib.rs]"]
  node_container["Document container<br/>[lib.rs]"]
  node_resource_storage["Resource storage"]
end

subgraph group_collaboration["Collaboration"]
  node_peer_transport["Peer transport<br/>[lib.rs]"]
  node_live_docs["Live documents<br/>[lib.rs]"]
end

node_artist(("Artist"))

node_artist -.->|"edits in"| node_frontend
node_artist -.->|"edits in"| node_desktop
node_desktop -->|"creates"| node_wrapper
node_editor_app -->|"uses"| node_dispatcher
node_editor_app -.->|"routes content"| node_ingest
node_dispatcher -.->|"dispatches messages"| node_tools
node_dispatcher -.->|"dispatches messages"| node_graph_ops
node_graph_ops -.->|"edits graph"| node_node_graph
node_node_graph -.->|"evaluates nodes"| node_brush
node_node_graph -.->|"uses executor"| node_gpu
node_doc_storage -->|"validates metadata"| node_metadata
node_doc_storage -.->|"loads and saves"| node_format
node_format -.->|"uses container"| node_container
node_doc_storage -.->|"accesses resources"| node_resource_storage
node_live_docs -.->|"synchronizes via"| node_peer_transport

click node_frontend "https://github.com/graphiteeditor/graphite/blob/master/frontend/src/App.svelte"
click node_desktop "https://github.com/graphiteeditor/graphite/blob/master/desktop/src/app.rs"
click node_wrapper "https://github.com/graphiteeditor/graphite/blob/master/desktop/wrapper/src/lib.rs"
click node_editor_app "https://github.com/graphiteeditor/graphite/blob/master/editor/src/application.rs"
click node_dispatcher "https://github.com/graphiteeditor/graphite/blob/master/editor/src/dispatcher.rs"
click node_ingest "https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/ingest/ingest_message_handler.rs"
click node_tools "https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/tool/tool_message_handler.rs"
click node_graph_ops "https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs"
click node_node_graph "https://github.com/graphiteeditor/graphite/blob/master/node-graph/graph-craft/src/proto.rs"
click node_brush "https://github.com/graphiteeditor/graphite/blob/master/node-graph/nodes/brush/src/basic_brush/pipeline.rs"
click node_gpu "https://github.com/graphiteeditor/graphite/blob/master/node-graph/libraries/wgpu-executor/src/pipeline.rs"
click node_doc_storage "https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document_storage_io.rs"
click node_metadata "https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document/utility_types/network_interface/storage_metadata.rs"
click node_format "https://github.com/graphiteeditor/graphite/blob/master/document/format/src/lib.rs"
click node_container "https://github.com/graphiteeditor/graphite/blob/master/document/container/src/lib.rs"
click node_resource_storage "https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/resource_storage/resource_storage_message_handler.rs"
click node_peer_transport "https://github.com/graphiteeditor/graphite/blob/master/document/peer-transport/src/lib.rs"
click node_live_docs "https://github.com/graphiteeditor/graphite/blob/master/document/live/src/lib.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_frontend,node_desktop,node_wrapper toneBlue
class node_editor_app,node_dispatcher,node_ingest,node_tools,node_graph_ops toneAmber
class node_node_graph,node_brush,node_gpu toneMint
class node_doc_storage,node_metadata,node_format,node_container,node_resource_storage toneRose
class node_peer_transport,node_live_docs,node_artist toneIndigo
```

## Components

### Editor clients

- [Web editor](https://github.com/graphiteeditor/graphite/blob/master/frontend/src/App.svelte): `frontend/src/App.svelte`
- [Desktop app](https://github.com/graphiteeditor/graphite/blob/master/desktop/src/app.rs): `desktop/src/app.rs`
- [Desktop wrapper](https://github.com/graphiteeditor/graphite/blob/master/desktop/wrapper/src/lib.rs): `desktop/wrapper/src/lib.rs`

### Editing workflow

- [Editor application](https://github.com/graphiteeditor/graphite/blob/master/editor/src/application.rs): `editor/src/application.rs`
- [Message dispatcher](https://github.com/graphiteeditor/graphite/blob/master/editor/src/dispatcher.rs): `editor/src/dispatcher.rs`
- [Content ingestion](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/ingest/ingest_message_handler.rs): `editor/src/messages/portfolio/ingest/ingest_message_handler.rs`
- [Editing tools](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/tool/tool_message_handler.rs): `editor/src/messages/tool/tool_message_handler.rs`
- [Graph operations](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs): `editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs`

### Graph and rendering

- [Procedural node graph](https://github.com/graphiteeditor/graphite/blob/master/node-graph/graph-craft/src/proto.rs): `node-graph/graph-craft/src/proto.rs`
- [Raster brush pipeline](https://github.com/graphiteeditor/graphite/blob/master/node-graph/nodes/brush/src/basic_brush/pipeline.rs): `node-graph/nodes/brush/src/basic_brush/pipeline.rs`
- [GPU executor](https://github.com/graphiteeditor/graphite/blob/master/node-graph/libraries/wgpu-executor/src/pipeline.rs): `node-graph/libraries/wgpu-executor/src/pipeline.rs`

### Document services

- [Document storage I/O](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document_storage_io.rs): `editor/src/messages/portfolio/document_storage_io.rs`
- [Graph metadata bridge](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/portfolio/document/utility_types/network_interface/storage_metadata.rs): `editor/src/messages/portfolio/document/utility_types/network_interface/storage_metadata.rs`
- [Document format](https://github.com/graphiteeditor/graphite/blob/master/document/format/src/lib.rs): `document/format/src/lib.rs`
- [Document container](https://github.com/graphiteeditor/graphite/blob/master/document/container/src/lib.rs): `document/container/src/lib.rs`
- [Resource storage](https://github.com/graphiteeditor/graphite/blob/master/editor/src/messages/resource_storage/resource_storage_message_handler.rs): `editor/src/messages/resource_storage/resource_storage_message_handler.rs`

### Collaboration

- [Peer transport](https://github.com/graphiteeditor/graphite/blob/master/document/peer-transport/src/lib.rs): `document/peer-transport/src/lib.rs`
- [Live documents](https://github.com/graphiteeditor/graphite/blob/master/document/live/src/lib.rs): `document/live/src/lib.rs`

### Other components

- **Artist**

## Connections

- Artist → Web editor: edits in (evidence: `README.md`)
- Artist → Desktop app: edits in (evidence: `README.md`)
- Desktop app → Desktop wrapper: creates (evidence: `desktop/src/app.rs`)
- Editor application → Message dispatcher: uses (evidence: `editor/src/application.rs`)
- Editor application → Content ingestion: routes content
- Message dispatcher → Editing tools: dispatches messages
- Message dispatcher → Graph operations: dispatches messages
- Graph operations → Procedural node graph: edits graph
- Procedural node graph → Raster brush pipeline: evaluates nodes
- Procedural node graph → GPU executor: uses executor
- Document storage I/O → Graph metadata bridge: validates metadata (evidence: `editor/src/messages/portfolio/document_storage_io.rs`)
- Document storage I/O → Document format: loads and saves
- Document format → Document container: uses container
- Document storage I/O → Resource storage: accesses resources
- Live documents → Peer transport: synchronizes via
