# 1612elphi/delphitools architecture

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

- Interactive diagram: https://gitdiagram.com/1612elphi/delphitools
- Repository: https://github.com/1612elphi/delphitools

## Overview

delphitools is a local-only browser toolkit for creative and practical tasks, organized as many modular tools rather than one linear product flow. Users enter through the tools or workflow routes, select a tool or workflow, and work with browser-side inputs and results. Substrata is a substantial graphics editor with document, layer, selection, effect, and export responsibilities. The README documents broad tool families; the tree supports their major capability areas, but sampled source does not establish every tool’s runtime wiring, so uncertain links are omitted.

Main entry points: [`app/lib/substrata/tool.ts`](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/tool.ts) (Substrata editor), [`app/components/tools/registry.ts`](https://github.com/1612elphi/delphitools/blob/main/app/components/tools/registry.ts) (Tool registry), [`app/lib/pandoc/client.ts`](https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/client.ts) (Pandoc engine), [`app/app.ts`](https://github.com/1612elphi/delphitools/blob/main/app/app.ts) (Ember application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and navigation"]
  node_app["Ember application<br/>[app.ts]"]
  node_router["Route map<br/>[router.ts]"]
  node_tool_route["Tool route<br/>[tool.ts]"]
  node_tool_controller["Tool controller<br/>[tool.ts]"]
  node_tool_registry["Tool registry<br/>[registry.ts]"]
end

subgraph group_tools["Tool capabilities"]
  node_image_tools["Image tools<br/>[image-compress.ts]"]
  node_media_tools["Audio video tools<br/>[media-convert.ts]"]
  node_pdf_tools["PDF tools<br/>[pdf-compress.ts]"]
  node_text_tools["Text tools<br/>[client.ts]"]
  node_colour_tools["Colour tools<br/>[colour-maths.ts]"]
end

subgraph group_workflows["Workflows"]
  node_workflow_route["Workflow route<br/>[workflow.ts]"]
  node_workflow_runtime["Workflow engine<br/>[workflows.ts]"]
  node_flow_service["Flow service<br/>[flow.ts]"]
end

subgraph group_substrata["Substrata editor"]
  node_substrata["Substrata editor<br/>[tool.ts]"]
  node_document_model["Document model<br/>[doc-model.ts]"]
  node_layer_ops["Layer operations<br/>[layer-ops.ts]"]
  node_selection_ops["Selection operations<br/>[select-ops.ts]"]
  node_effects["Image effects<br/>[effects.ts]"]
  node_export_run["Export runner<br/>[export-run.ts]"]
  node_substrata_db[("Document database<br/>[db.ts]")]
  node_layout_storage[("Layout preferences<br/>[layout-storage.ts]")]
end

subgraph group_runtime["Browser runtime"]
  node_pandoc_worker["Pandoc worker<br/>[pandoc.worker.ts]"]
  node_pandoc_service["Pandoc engine<br/>[client.ts]"]
  node_pdf_worker["PDF worker"]
  node_browser["Browser APIs"]
  node_wasm_host["Pandoc WASM host"]
end

node_user(("Creative user"))

node_user -->|"opens"| node_app
node_app -->|"initializes"| node_router
node_router -->|"dispatches"| node_tool_route
node_tool_route -->|"resolves"| node_tool_controller
node_tool_controller -->|"selects tool"| node_tool_registry
node_user -->|"opens workflow"| node_workflow_route
node_workflow_route -->|"runs"| node_workflow_runtime
node_workflow_runtime -->|"uses flow state"| node_flow_service
node_tool_registry -.->|"exposes"| node_image_tools
node_tool_registry -.->|"exposes"| node_media_tools
node_tool_registry -.->|"exposes"| node_pdf_tools
node_tool_registry -.->|"exposes"| node_text_tools
node_tool_registry -.->|"exposes"| node_colour_tools
node_user -->|"edits artwork"| node_substrata
node_substrata -->|"updates"| node_document_model
node_substrata -->|"manipulates layers"| node_layer_ops
node_substrata -->|"selects regions"| node_selection_ops
node_substrata -->|"applies effects"| node_effects
node_substrata -->|"exports"| node_export_run
node_document_model -->|"persists document"| node_substrata_db
node_substrata -->|"stores layout"| node_layout_storage
node_text_tools -->|"converts text"| node_pandoc_service
node_pandoc_service -->|"fetches WASM"| node_browser
node_pandoc_service -->|"sends requests"| node_pandoc_worker
node_pandoc_worker -->|"initializes engine"| node_wasm_host
node_pdf_tools -->|"compresses off-thread"| node_pdf_worker
node_pdf_worker -->|"loads MuPDF"| node_browser

click node_app "https://github.com/1612elphi/delphitools/blob/main/app/app.ts"
click node_router "https://github.com/1612elphi/delphitools/blob/main/app/router.ts"
click node_tool_route "https://github.com/1612elphi/delphitools/blob/main/app/routes/tools/tool.ts"
click node_tool_controller "https://github.com/1612elphi/delphitools/blob/main/app/controllers/tools/tool.ts"
click node_tool_registry "https://github.com/1612elphi/delphitools/blob/main/app/components/tools/registry.ts"
click node_workflow_route "https://github.com/1612elphi/delphitools/blob/main/app/routes/workflow.ts"
click node_workflow_runtime "https://github.com/1612elphi/delphitools/blob/main/app/lib/workflows.ts"
click node_flow_service "https://github.com/1612elphi/delphitools/blob/main/app/services/flow.ts"
click node_image_tools "https://github.com/1612elphi/delphitools/blob/main/app/lib/image-compress.ts"
click node_media_tools "https://github.com/1612elphi/delphitools/blob/main/app/lib/media-convert.ts"
click node_pdf_tools "https://github.com/1612elphi/delphitools/blob/main/app/lib/pdf-compress.ts"
click node_text_tools "https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/client.ts"
click node_colour_tools "https://github.com/1612elphi/delphitools/blob/main/app/lib/colour-maths.ts"
click node_substrata "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/tool.ts"
click node_document_model "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/doc-model.ts"
click node_layer_ops "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/layer-ops.ts"
click node_selection_ops "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/select-ops.ts"
click node_effects "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/effects.ts"
click node_export_run "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/export-run.ts"
click node_substrata_db "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/db.ts"
click node_layout_storage "https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/layout-storage.ts"
click node_pandoc_worker "https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/pandoc.worker.ts"
click node_pandoc_service "https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/client.ts"
click node_pdf_worker "https://github.com/1612elphi/delphitools/blob/main/app/lib/pdf-compress.worker.ts"

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_router,node_tool_route,node_tool_controller,node_tool_registry,node_user toneBlue
class node_image_tools,node_media_tools,node_pdf_tools,node_text_tools,node_colour_tools toneAmber
class node_workflow_route,node_workflow_runtime,node_flow_service toneMint
class node_substrata,node_document_model,node_layer_ops,node_selection_ops,node_effects,node_export_run,node_substrata_db,node_layout_storage toneRose
class node_pandoc_worker,node_pandoc_service,node_pdf_worker,node_browser,node_wasm_host toneIndigo
```

## Components

### App and navigation

- [Ember application](https://github.com/1612elphi/delphitools/blob/main/app/app.ts): `app/app.ts`
- [Route map](https://github.com/1612elphi/delphitools/blob/main/app/router.ts): `app/router.ts`
- [Tool route](https://github.com/1612elphi/delphitools/blob/main/app/routes/tools/tool.ts): `app/routes/tools/tool.ts`
- [Tool controller](https://github.com/1612elphi/delphitools/blob/main/app/controllers/tools/tool.ts): `app/controllers/tools/tool.ts`
- [Tool registry](https://github.com/1612elphi/delphitools/blob/main/app/components/tools/registry.ts): `app/components/tools/registry.ts`

### Tool capabilities

- [Image tools](https://github.com/1612elphi/delphitools/blob/main/app/lib/image-compress.ts): `app/lib/image-compress.ts`
- [Audio video tools](https://github.com/1612elphi/delphitools/blob/main/app/lib/media-convert.ts): `app/lib/media-convert.ts`
- [PDF tools](https://github.com/1612elphi/delphitools/blob/main/app/lib/pdf-compress.ts): `app/lib/pdf-compress.ts`
- [Text tools](https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/client.ts): `app/lib/pandoc/client.ts`
- [Colour tools](https://github.com/1612elphi/delphitools/blob/main/app/lib/colour-maths.ts): `app/lib/colour-maths.ts`

### Workflows

- [Workflow route](https://github.com/1612elphi/delphitools/blob/main/app/routes/workflow.ts): `app/routes/workflow.ts`
- [Workflow engine](https://github.com/1612elphi/delphitools/blob/main/app/lib/workflows.ts): `app/lib/workflows.ts`
- [Flow service](https://github.com/1612elphi/delphitools/blob/main/app/services/flow.ts): `app/services/flow.ts`

### Substrata editor

- [Substrata editor](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/tool.ts): `app/lib/substrata/tool.ts`
- [Document model](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/doc-model.ts): `app/lib/substrata/doc-model.ts`
- [Layer operations](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/layer-ops.ts): `app/lib/substrata/layer-ops.ts`
- [Selection operations](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/select-ops.ts): `app/lib/substrata/select-ops.ts`
- [Image effects](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/effects.ts): `app/lib/substrata/effects.ts`
- [Export runner](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/export-run.ts): `app/lib/substrata/export-run.ts`
- [Document database](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/db.ts): `app/lib/substrata/db.ts`
- [Layout preferences](https://github.com/1612elphi/delphitools/blob/main/app/lib/substrata/layout-storage.ts): `app/lib/substrata/layout-storage.ts`

### Browser runtime

- [Pandoc worker](https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/pandoc.worker.ts): `app/lib/pandoc/pandoc.worker.ts`
- [Pandoc engine](https://github.com/1612elphi/delphitools/blob/main/app/lib/pandoc/client.ts): `app/lib/pandoc/client.ts`
- [PDF worker](https://github.com/1612elphi/delphitools/blob/main/app/lib/pdf-compress.worker.ts): `app/lib/pdf-compress.worker.ts`
- **Browser APIs**
- **Pandoc WASM host**

### Other components

- **Creative user**

## Connections

- Creative user → Ember application: opens
- Ember application → Route map: initializes
- Route map → Tool route: dispatches
- Tool route → Tool controller: resolves
- Tool controller → Tool registry: selects tool
- Creative user → Workflow route: opens workflow
- Workflow route → Workflow engine: runs
- Workflow engine → Flow service: uses flow state
- Tool registry → Image tools: exposes
- Tool registry → Audio video tools: exposes
- Tool registry → PDF tools: exposes
- Tool registry → Text tools: exposes
- Tool registry → Colour tools: exposes
- Creative user → Substrata editor: edits artwork
- Substrata editor → Document model: updates
- Substrata editor → Layer operations: manipulates layers
- Substrata editor → Selection operations: selects regions
- Substrata editor → Image effects: applies effects
- Substrata editor → Export runner: exports
- Document model → Document database: persists document
- Substrata editor → Layout preferences: stores layout
- Text tools → Pandoc engine: converts text
- Pandoc engine → Browser APIs: fetches WASM
- Pandoc engine → Pandoc worker: sends requests
- Pandoc worker → Pandoc WASM host: initializes engine
- PDF tools → PDF worker: compresses off-thread
- PDF worker → Browser APIs: loads MuPDF
