# penpot/penpot architecture

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

- Interactive diagram: https://gitdiagram.com/penpot/penpot
- Repository: https://github.com/penpot/penpot

## Overview

Penpot is a browser-based collaborative design platform with a backend, editor-specific text and rendering runtimes, and extension surfaces. The principal workflow is a designer editing a document, collaborating with a team, and using design-system and developer-facing capabilities to carry the result toward implementation. The README documents these product relationships; the source index identifies several substantial runtime modules, but much of the application wiring was not sampled, so the graph avoids asserting detailed internal call chains.

Main entry points: [`frontend/src/app`](https://github.com/penpot/penpot/tree/develop/frontend/src/app) (Design workspace), [`backend/src/app/main.clj`](https://github.com/penpot/penpot/blob/develop/backend/src/app/main.clj) (Application backend), [`mcp/packages/server/src/PenpotMcpServer.ts`](https://github.com/penpot/penpot/blob/develop/mcp/packages/server/src/PenpotMcpServer.ts) (MCP server), [`plugins/apps/colors-to-tokens-plugin/src/app/utils/transform-to-token.ts`](https://github.com/penpot/penpot/blob/develop/plugins/apps/colors-to-tokens-plugin/src/app/utils/transform-to-token.ts) (Design tokens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Design workspace"]
  node_workspace["Design workspace"]
  node_tokens["Design tokens"]
  node_inspect["Code inspection<br/>[viewer.clj]"]
end

subgraph group_backend["Backend services"]
  node_backendapp["Application backend<br/>[main.clj]"]
  node_rpc["API commands"]
  node_graph["Document graph"]
  node_storage[("File storage<br/>[storage.clj]")]
  node_collab["Collaboration transport<br/>[websocket.clj]"]
  node_media["Media processing<br/>[index.ts]"]
end

subgraph group_integration["Developer integrations"]
  node_plugins["Plugin runtime<br/>[plugin-manager.ts]"]
  node_mcpserver["MCP server<br/>[PenpotMcpServer.ts]"]
  node_mcpplugin["MCP plugin<br/>[main.ts]"]
end

subgraph group_runtime["Editor runtimes"]
  node_textedit["Text editing<br/>[TextEditor.js]"]
  node_render["Rendering engine<br/>[main.rs]"]
end

node_designer(("Designer"))

node_designer -->|"designs in"| node_workspace
node_workspace -.->|"edits text"| node_textedit
node_workspace -.->|"renders designs"| node_render
node_workspace -->|"collaborates through"| node_backendapp
node_backendapp -.->|"serves commands"| node_rpc
node_backendapp -.->|"manages documents"| node_graph
node_backendapp -.->|"persists files"| node_storage
node_workspace -->|"uses tokens"| node_tokens
node_workspace -->|"extends via"| node_plugins
node_workspace -->|"exposes code"| node_inspect
node_workspace -->|"connects design and code"| node_mcpserver
node_mcpserver -.->|"dispatches plugin tasks"| node_mcpplugin
node_backendapp -.->|"supports real-time use"| node_collab
node_backendapp -.->|"processes media"| node_media

click node_workspace "https://github.com/penpot/penpot/tree/develop/frontend/src/app"
click node_textedit "https://github.com/penpot/penpot/blob/develop/frontend/text-editor/src/editor/TextEditor.js"
click node_render "https://github.com/penpot/penpot/blob/develop/render-wasm/src/main.rs"
click node_backendapp "https://github.com/penpot/penpot/blob/develop/backend/src/app/main.clj"
click node_rpc "https://github.com/penpot/penpot/tree/develop/backend/src/app/rpc/commands"
click node_graph "https://github.com/penpot/penpot/tree/develop/backend/src/app/graph"
click node_storage "https://github.com/penpot/penpot/blob/develop/backend/src/app/storage.clj"
click node_collab "https://github.com/penpot/penpot/blob/develop/backend/src/app/http/websocket.clj"
click node_tokens "https://github.com/penpot/penpot/blob/develop/plugins/apps/colors-to-tokens-plugin/src/app/utils/transform-to-token.ts"
click node_plugins "https://github.com/penpot/penpot/blob/develop/plugins/libs/plugins-runtime/src/lib/plugin-manager.ts"
click node_mcpserver "https://github.com/penpot/penpot/blob/develop/mcp/packages/server/src/PenpotMcpServer.ts"
click node_mcpplugin "https://github.com/penpot/penpot/blob/develop/mcp/packages/plugin/src/main.ts"
click node_media "https://github.com/penpot/penpot/blob/develop/media-processor/src/index.ts"
click node_inspect "https://github.com/penpot/penpot/blob/develop/backend/src/app/rpc/commands/viewer.clj"

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_workspace,node_tokens,node_inspect toneBlue
class node_backendapp,node_rpc,node_graph,node_storage,node_collab,node_media toneAmber
class node_plugins,node_mcpserver,node_mcpplugin toneMint
class node_textedit,node_render toneRose
class node_designer toneIndigo
```

## Components

### Design workspace

- [Design workspace](https://github.com/penpot/penpot/tree/develop/frontend/src/app): `frontend/src/app`
- [Design tokens](https://github.com/penpot/penpot/blob/develop/plugins/apps/colors-to-tokens-plugin/src/app/utils/transform-to-token.ts): `plugins/apps/colors-to-tokens-plugin/src/app/utils/transform-to-token.ts`
- [Code inspection](https://github.com/penpot/penpot/blob/develop/backend/src/app/rpc/commands/viewer.clj): `backend/src/app/rpc/commands/viewer.clj`

### Backend services

- [Application backend](https://github.com/penpot/penpot/blob/develop/backend/src/app/main.clj): `backend/src/app/main.clj`
- [API commands](https://github.com/penpot/penpot/tree/develop/backend/src/app/rpc/commands): `backend/src/app/rpc/commands`
- [Document graph](https://github.com/penpot/penpot/tree/develop/backend/src/app/graph): `backend/src/app/graph`
- [File storage](https://github.com/penpot/penpot/blob/develop/backend/src/app/storage.clj): `backend/src/app/storage.clj`
- [Collaboration transport](https://github.com/penpot/penpot/blob/develop/backend/src/app/http/websocket.clj): `backend/src/app/http/websocket.clj`
- [Media processing](https://github.com/penpot/penpot/blob/develop/media-processor/src/index.ts): `media-processor/src/index.ts`

### Developer integrations

- [Plugin runtime](https://github.com/penpot/penpot/blob/develop/plugins/libs/plugins-runtime/src/lib/plugin-manager.ts): `plugins/libs/plugins-runtime/src/lib/plugin-manager.ts`
- [MCP server](https://github.com/penpot/penpot/blob/develop/mcp/packages/server/src/PenpotMcpServer.ts): `mcp/packages/server/src/PenpotMcpServer.ts`
- [MCP plugin](https://github.com/penpot/penpot/blob/develop/mcp/packages/plugin/src/main.ts): `mcp/packages/plugin/src/main.ts`

### Editor runtimes

- [Text editing](https://github.com/penpot/penpot/blob/develop/frontend/text-editor/src/editor/TextEditor.js): `frontend/text-editor/src/editor/TextEditor.js`
- [Rendering engine](https://github.com/penpot/penpot/blob/develop/render-wasm/src/main.rs): `render-wasm/src/main.rs`

### Other components

- **Designer**

## Connections

- Designer → Design workspace: designs in
- Design workspace → Text editing: edits text
- Design workspace → Rendering engine: renders designs
- Design workspace → Application backend: collaborates through
- Application backend → API commands: serves commands
- Application backend → Document graph: manages documents
- Application backend → File storage: persists files
- Design workspace → Design tokens: uses tokens
- Design workspace → Plugin runtime: extends via
- Design workspace → Code inspection: exposes code
- Design workspace → MCP server: connects design and code
- MCP server → MCP plugin: dispatches plugin tasks
- Application backend → Collaboration transport: supports real-time use
- Application backend → Media processing: processes media
