# storytold/effectcraft architecture

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

- Interactive diagram: https://gitdiagram.com/storytold/effectcraft
- Repository: https://github.com/storytold/effectcraft

## Overview

EffectCraft is a motion-graphics compositor for building animated compositions, applying effects, previewing frames, and exporting media. The principal workflow is documented in the README; the source index and excerpts additionally establish browser persistence, file handling, worker offload, and rendering internals. Several major capabilities are documented but their implementation was not sampled, so those subsystem links cite the README rather than implying that their source was inspected.

Main entry points: [`crates/project/src/lib.rs`](https://github.com/storytold/effectcraft/blob/main/crates/project/src/lib.rs) (Project model), [`apps/effectcraft-web/src/app.rs`](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/app.rs) (Browser app), [`crates/engine/src/commands`](https://github.com/storytold/effectcraft/tree/main/crates/engine/src/commands) (Command registry), [`crates/render/src/lib.rs`](https://github.com/storytold/effectcraft/blob/main/crates/render/src/lib.rs) (CPU compositor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["User interfaces"]
  node_desktop["Desktop shell<br/>[main.rs]"]
  node_webapp["Browser app<br/>[app.rs]"]
  node_panels["Editor panels"]
  node_cli["Command-line client<br/>[main.rs]"]
end

subgraph group_authoring["Composition authoring"]
  node_commands["Command registry"]
  node_project["Project model<br/>[lib.rs]"]
  node_keyframes["Keyframes<br/>[lib.rs]"]
  node_expressions["Expressions<br/>[runtime.rs]"]
  node_effects["Effect catalog<br/>[catalog.rs]"]
  node_tracking["Tracking and masks"]
end

subgraph group_rendering["Compositing and export"]
  node_media["Media decoding"]
  node_renderer["CPU compositor<br/>[lib.rs]"]
  node_gpu["GPU pipelines<br/>[context.rs]"]
  node_renderqueue["Render queue<br/>[render_queue.rs]"]
  node_export["Export pipeline<br/>[pipeline.rs]"]
  node_lottie["Lottie interchange"]
end

subgraph group_services["Storage and automation"]
  node_webfiles["Browser file service<br/>[files.rs]"]
  node_store[("Browser file store<br/>[store.rs]")]
  node_persistence["Browser persistence<br/>[persist.rs]"]
  node_workers["Web workers<br/>[worker.rs]"]
  node_automation["Agent control server<br/>[server.rs]"]
end

node_artist(("Artist"))

node_artist -->|"opens project"| node_desktop
node_artist -->|"creates composition"| node_webapp
node_desktop -->|"presents editor"| node_panels
node_webapp -->|"presents editor"| node_panels
node_panels -->|"dispatches actions"| node_commands
node_cli -.->|"runs commands"| node_commands
node_automation -.->|"exposes actions"| node_commands
node_commands -->|"edits document"| node_project
node_project -->|"stores animation"| node_keyframes
node_project -->|"evaluates expressions"| node_expressions
node_project -->|"stacks effects"| node_effects
node_commands -.->|"runs tracking tools"| node_tracking
node_project -->|"renders composition"| node_renderer
node_renderer -.->|"requests footage"| node_media
node_renderer -.->|"applies effects"| node_effects
node_renderer -.->|"dispatches kernels"| node_gpu
node_project -->|"defines render jobs"| node_renderqueue
node_renderqueue -->|"exports output"| node_export
node_project -->|"imports and exports"| node_lottie
node_webapp -->|"reads and downloads"| node_webfiles
node_webfiles -->|"reads and writes"| node_store
node_webapp -->|"restores session"| node_persistence
node_persistence -->|"flushes changes"| node_store
node_webapp -->|"offloads jobs"| node_workers
node_workers -->|"transfers job files"| node_webfiles

click node_desktop "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft/src/main.rs"
click node_webapp "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/app.rs"
click node_panels "https://github.com/storytold/effectcraft/tree/main/crates/ui-egui/src/panels"
click node_commands "https://github.com/storytold/effectcraft/tree/main/crates/engine/src/commands"
click node_project "https://github.com/storytold/effectcraft/blob/main/crates/project/src/lib.rs"
click node_keyframes "https://github.com/storytold/effectcraft/blob/main/crates/keyframe/src/lib.rs"
click node_expressions "https://github.com/storytold/effectcraft/blob/main/crates/expr/src/runtime.rs"
click node_effects "https://github.com/storytold/effectcraft/blob/main/crates/effects/src/catalog.rs"
click node_tracking "https://github.com/storytold/effectcraft/tree/main/crates/track/src"
click node_media "https://github.com/storytold/effectcraft/tree/main/crates/media/src"
click node_renderer "https://github.com/storytold/effectcraft/blob/main/crates/render/src/lib.rs"
click node_gpu "https://github.com/storytold/effectcraft/blob/main/crates/gpu/src/context.rs"
click node_renderqueue "https://github.com/storytold/effectcraft/blob/main/crates/project/src/render_queue.rs"
click node_export "https://github.com/storytold/effectcraft/blob/main/crates/export/src/pipeline.rs"
click node_lottie "https://github.com/storytold/effectcraft/tree/main/crates/lottie/src"
click node_webfiles "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/files.rs"
click node_store "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/store.rs"
click node_persistence "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/persist.rs"
click node_workers "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/worker.rs"
click node_automation "https://github.com/storytold/effectcraft/blob/main/crates/automation/src/server.rs"
click node_cli "https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-cli/src/main.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_desktop,node_webapp,node_panels,node_cli toneBlue
class node_commands,node_project,node_keyframes,node_expressions,node_effects,node_tracking toneAmber
class node_media,node_renderer,node_gpu,node_renderqueue,node_export,node_lottie toneMint
class node_webfiles,node_store,node_persistence,node_workers,node_automation toneRose
class node_artist toneIndigo
```

## Components

### User interfaces

- [Desktop shell](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft/src/main.rs): `apps/effectcraft/src/main.rs`
- [Browser app](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/app.rs): `apps/effectcraft-web/src/app.rs`
- [Editor panels](https://github.com/storytold/effectcraft/tree/main/crates/ui-egui/src/panels): `crates/ui-egui/src/panels`
- [Command-line client](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-cli/src/main.rs): `apps/effectcraft-cli/src/main.rs`

### Composition authoring

- [Command registry](https://github.com/storytold/effectcraft/tree/main/crates/engine/src/commands): `crates/engine/src/commands`
- [Project model](https://github.com/storytold/effectcraft/blob/main/crates/project/src/lib.rs): `crates/project/src/lib.rs`
- [Keyframes](https://github.com/storytold/effectcraft/blob/main/crates/keyframe/src/lib.rs): `crates/keyframe/src/lib.rs`
- [Expressions](https://github.com/storytold/effectcraft/blob/main/crates/expr/src/runtime.rs): `crates/expr/src/runtime.rs`
- [Effect catalog](https://github.com/storytold/effectcraft/blob/main/crates/effects/src/catalog.rs): `crates/effects/src/catalog.rs`
- [Tracking and masks](https://github.com/storytold/effectcraft/tree/main/crates/track/src): `crates/track/src`

### Compositing and export

- [Media decoding](https://github.com/storytold/effectcraft/tree/main/crates/media/src): `crates/media/src`
- [CPU compositor](https://github.com/storytold/effectcraft/blob/main/crates/render/src/lib.rs): `crates/render/src/lib.rs`
- [GPU pipelines](https://github.com/storytold/effectcraft/blob/main/crates/gpu/src/context.rs): `crates/gpu/src/context.rs`
- [Render queue](https://github.com/storytold/effectcraft/blob/main/crates/project/src/render_queue.rs): `crates/project/src/render_queue.rs`
- [Export pipeline](https://github.com/storytold/effectcraft/blob/main/crates/export/src/pipeline.rs): `crates/export/src/pipeline.rs`
- [Lottie interchange](https://github.com/storytold/effectcraft/tree/main/crates/lottie/src): `crates/lottie/src`

### Storage and automation

- [Browser file service](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/files.rs): `apps/effectcraft-web/src/files.rs`
- [Browser file store](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/store.rs): `apps/effectcraft-web/src/store.rs`
- [Browser persistence](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/persist.rs): `apps/effectcraft-web/src/persist.rs`
- [Web workers](https://github.com/storytold/effectcraft/blob/main/apps/effectcraft-web/src/worker.rs): `apps/effectcraft-web/src/worker.rs`
- [Agent control server](https://github.com/storytold/effectcraft/blob/main/crates/automation/src/server.rs): `crates/automation/src/server.rs`

### Other components

- **Artist**

## Connections

- Artist → Desktop shell: opens project
- Artist → Browser app: creates composition
- Desktop shell → Editor panels: presents editor
- Browser app → Editor panels: presents editor
- Editor panels → Command registry: dispatches actions
- Command-line client → Command registry: runs commands
- Agent control server → Command registry: exposes actions
- Command registry → Project model: edits document
- Project model → Keyframes: stores animation
- Project model → Expressions: evaluates expressions
- Project model → Effect catalog: stacks effects
- Command registry → Tracking and masks: runs tracking tools
- Project model → CPU compositor: renders composition (evidence: `crates/render/src/lib.rs`)
- CPU compositor → Media decoding: requests footage
- CPU compositor → Effect catalog: applies effects
- CPU compositor → GPU pipelines: dispatches kernels
- Project model → Render queue: defines render jobs (evidence: `crates/project/src/lib.rs`)
- Render queue → Export pipeline: exports output
- Project model → Lottie interchange: imports and exports
- Browser app → Browser file service: reads and downloads (evidence: `apps/effectcraft-web/src/app.rs`)
- Browser file service → Browser file store: reads and writes (evidence: `apps/effectcraft-web/src/files.rs`)
- Browser app → Browser persistence: restores session (evidence: `apps/effectcraft-web/src/app.rs`)
- Browser persistence → Browser file store: flushes changes (evidence: `apps/effectcraft-web/src/persist.rs`)
- Browser app → Web workers: offloads jobs (evidence: `apps/effectcraft-web/src/app.rs`)
- Web workers → Browser file service: transfers job files (evidence: `apps/effectcraft-web/src/worker.rs`)
