# tonykastaneda/amalith architecture

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

- Interactive diagram: https://gitdiagram.com/tonykastaneda/amalith
- Repository: https://github.com/tonykastaneda/amalith

## Overview

Amalith is a cross-platform vector-design application centered on an infinite-pasteboard document model and a shared undoable command engine. The principal workflow is a designer editing artwork in the native shell; every mutation goes through the Editor, which applies reversible edits to the document. The repository also includes file-format support, scripting/automation, adjustment processing, and a separately presented marketing website. Several subsystem links below rely on README documentation; unsampled implementations are not inferred beyond those documented capabilities.

Main entry points: [`crates/amalith-commands/src/editor.rs`](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/editor.rs) (Command editor), [`crates/amalith-shell/src/app/mod.rs`](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/app/mod.rs) (Desktop shell), [`crates/amalith-script/src/host/app.rs`](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/host/app.rs) (Script host API), [`crates/amalith-core/src/document.rs`](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-core/src/document.rs) (Document model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Native editor"]
  node_shell["Desktop shell<br/>[mod.rs]"]
  node_canvas["Canvas tools<br/>[canvas.rs]"]
  node_selection["Selection tools<br/>[select.rs]"]
  node_text["Text editing<br/>[textedit.rs]"]
  node_render["Canvas rendering<br/>[mod.rs]"]
end

subgraph group_editing["Document and editing"]
  node_editor["Command editor<br/>[editor.rs]"]
  node_vocabulary["Command vocabulary<br/>[command.rs]"]
  node_edits["Reversible edits<br/>[edit.rs]"]
  node_history["Undo history<br/>[history.rs]"]
  node_pathfinder["Path operations<br/>[pathfinder.rs]"]
  node_document["Document model<br/>[document.rs]"]
  node_objects["Artwork objects<br/>[object.rs]"]
end

subgraph group_formats["Files and rendering"]
  node_io["Document formats<br/>[lib.rs]"]
  node_svg["SVG support<br/>[svg.rs]"]
  node_ai["Illustrator support<br/>[ai.rs]"]
  node_adjust["Color adjustments<br/>[color.rs]"]
  node_gpu["GPU adjustment jobs<br/>[engine.rs]"]
end

subgraph group_automation["Automation"]
  node_script_engine["Script engine<br/>[engine.rs]"]
  node_script_host["Script host API<br/>[app.rs]"]
  node_script_fileio["Script file access<br/>[fileio.rs]"]
end

subgraph group_site["Website"]
  node_website_home["Marketing pages<br/>[page.tsx]"]
  node_website_downloads["Downloads page<br/>[page.tsx]"]
end

node_designer(("Designer"))
node_website_visitor(("Website visitor"))

node_designer -->|"uses"| node_shell
node_shell -->|"issues commands"| node_editor
node_designer -->|"draws and edits"| node_canvas
node_canvas -->|"submits mutations"| node_editor
node_selection -->|"submits mutations"| node_editor
node_text -->|"submits mutations"| node_editor
node_shell -.->|"renders editor"| node_render
node_editor -->|"executes commands"| node_vocabulary
node_editor -->|"applies edits"| node_edits
node_editor -->|"records history"| node_history
node_edits -->|"mutates document"| node_document
node_document -->|"owns artwork"| node_objects
node_editor -->|"dispatches operations"| node_pathfinder
node_shell -->|"saves and loads"| node_io
node_io -->|"serializes document"| node_document
node_shell -->|"imports SVG"| node_svg
node_shell -->|"imports Illustrator SVG"| node_ai
node_gpu -->|"uses color LUT"| node_adjust
node_script_engine -->|"registers host globals"| node_script_host
node_script_host -.->|"issues commands"| node_editor
node_script_host -->|"exposes file access"| node_script_fileio
node_website_visitor -->|"browses"| node_website_home
node_website_home -->|"links downloads"| node_website_downloads

click node_shell "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/app/mod.rs"
click node_canvas "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/canvas.rs"
click node_selection "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/select.rs"
click node_text "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/textedit.rs"
click node_render "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/app/render/mod.rs"
click node_editor "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/editor.rs"
click node_vocabulary "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/command.rs"
click node_edits "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/edit.rs"
click node_history "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/history.rs"
click node_pathfinder "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/pathfinder.rs"
click node_document "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-core/src/document.rs"
click node_objects "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-core/src/object.rs"
click node_io "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-io/src/lib.rs"
click node_svg "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-io/src/svg.rs"
click node_ai "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-io/src/ai.rs"
click node_adjust "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-adjust/src/color.rs"
click node_gpu "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/adjust/engine.rs"
click node_script_engine "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/engine.rs"
click node_script_host "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/host/app.rs"
click node_script_fileio "https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/host/fileio.rs"
click node_website_home "https://github.com/tonykastaneda/amalith/blob/main/website/app/page.tsx"
click node_website_downloads "https://github.com/tonykastaneda/amalith/blob/main/website/app/downloads/page.tsx"

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_shell,node_canvas,node_selection,node_text,node_render toneBlue
class node_editor,node_vocabulary,node_edits,node_history,node_pathfinder,node_document,node_objects toneAmber
class node_io,node_svg,node_ai,node_adjust,node_gpu toneMint
class node_script_engine,node_script_host,node_script_fileio toneRose
class node_website_home,node_website_downloads,node_designer,node_website_visitor toneIndigo
```

## Components

### Native editor

- [Desktop shell](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/app/mod.rs): `crates/amalith-shell/src/app/mod.rs`
- [Canvas tools](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/canvas.rs): `crates/amalith-shell/src/canvas.rs`
- [Selection tools](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/select.rs): `crates/amalith-shell/src/select.rs`
- [Text editing](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/textedit.rs): `crates/amalith-shell/src/textedit.rs`
- [Canvas rendering](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/app/render/mod.rs): `crates/amalith-shell/src/app/render/mod.rs`

### Document and editing

- [Command editor](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/editor.rs): `crates/amalith-commands/src/editor.rs`
- [Command vocabulary](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/command.rs): `crates/amalith-commands/src/command.rs`
- [Reversible edits](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/edit.rs): `crates/amalith-commands/src/edit.rs`
- [Undo history](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/history.rs): `crates/amalith-commands/src/history.rs`
- [Path operations](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-commands/src/pathfinder.rs): `crates/amalith-commands/src/pathfinder.rs`
- [Document model](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-core/src/document.rs): `crates/amalith-core/src/document.rs`
- [Artwork objects](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-core/src/object.rs): `crates/amalith-core/src/object.rs`

### Files and rendering

- [Document formats](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-io/src/lib.rs): `crates/amalith-io/src/lib.rs`
- [SVG support](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-io/src/svg.rs): `crates/amalith-io/src/svg.rs`
- [Illustrator support](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-io/src/ai.rs): `crates/amalith-io/src/ai.rs`
- [Color adjustments](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-adjust/src/color.rs): `crates/amalith-adjust/src/color.rs`
- [GPU adjustment jobs](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-shell/src/adjust/engine.rs): `crates/amalith-shell/src/adjust/engine.rs`

### Automation

- [Script engine](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/engine.rs): `crates/amalith-script/src/engine.rs`
- [Script host API](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/host/app.rs): `crates/amalith-script/src/host/app.rs`
- [Script file access](https://github.com/tonykastaneda/amalith/blob/main/crates/amalith-script/src/host/fileio.rs): `crates/amalith-script/src/host/fileio.rs`

### Website

- [Marketing pages](https://github.com/tonykastaneda/amalith/blob/main/website/app/page.tsx): `website/app/page.tsx`
- [Downloads page](https://github.com/tonykastaneda/amalith/blob/main/website/app/downloads/page.tsx): `website/app/downloads/page.tsx`

### Other components

- **Designer**
- **Website visitor**

## Connections

- Designer → Desktop shell: uses (evidence: `README.md`)
- Desktop shell → Command editor: issues commands (evidence: `README.md`)
- Designer → Canvas tools: draws and edits (evidence: `README.md`)
- Canvas tools → Command editor: submits mutations (evidence: `README.md`)
- Selection tools → Command editor: submits mutations (evidence: `README.md`)
- Text editing → Command editor: submits mutations (evidence: `README.md`)
- Desktop shell → Canvas rendering: renders editor
- Command editor → Command vocabulary: executes commands (evidence: `crates/amalith-commands/src/editor.rs`)
- Command editor → Reversible edits: applies edits (evidence: `crates/amalith-commands/src/editor.rs`)
- Command editor → Undo history: records history (evidence: `crates/amalith-commands/src/editor.rs`)
- Reversible edits → Document model: mutates document (evidence: `crates/amalith-commands/src/edit.rs`)
- Document model → Artwork objects: owns artwork (evidence: `crates/amalith-core/src/document.rs`)
- Command editor → Path operations: dispatches operations (evidence: `crates/amalith-commands/src/editor.rs`)
- Desktop shell → Document formats: saves and loads (evidence: `README.md`)
- Document formats → Document model: serializes document (evidence: `README.md`)
- Desktop shell → SVG support: imports SVG (evidence: `README.md`)
- Desktop shell → Illustrator support: imports Illustrator SVG (evidence: `README.md`)
- GPU adjustment jobs → Color adjustments: uses color LUT (evidence: `crates/amalith-shell/src/adjust/engine.rs`)
- Script engine → Script host API: registers host globals (evidence: `crates/amalith-script/src/engine.rs`)
- Script host API → Command editor: issues commands
- Script host API → Script file access: exposes file access (evidence: `crates/amalith-script/src/host/app.rs`)
- Website visitor → Marketing pages: browses (evidence: `README.md`)
- Marketing pages → Downloads page: links downloads (evidence: `website/app/page.tsx`)
