# pdfcrafttool/pdfcraft architecture

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

- Interactive diagram: https://gitdiagram.com/pdfcrafttool/pdfcraft
- Repository: https://github.com/pdfcrafttool/pdfcraft

## Overview

PDFCraft is a browser-based PDF utility suite: users select a tool, provide a document, run a local PDF operation, and obtain a result without uploading files. Its product also includes a visual workflow editor, a PDF Studio, and a standalone direct editor. The tree and README establish these capabilities; sampled source confirms selected catalog, workflow, OCG, and direct-editor relationships. Most individual tool and processor wiring was not sampled, so those connections are left out rather than inferred.

Main entry points: [`src/components/workflow/WorkflowEditor.tsx`](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/workflow/WorkflowEditor.tsx) (Workflow editor), [`public/direct-pdf-editor/app.js`](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/app.js) (Direct editor UI), [`src/app/[locale]/HomePageClient.tsx`](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/app/%5Blocale%5D/HomePageClient.tsx) (Home page), [`src/app/[locale]/tools/ToolsPageClient.tsx`](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/app/%5Blocale%5D/tools/ToolsPageClient.tsx) (Tool catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Tool discovery"]
  node_home["Home page<br/>[HomePageClient.tsx]"]
  node_catalog["Tool catalog"]
  node_toolgrid["Tool grid<br/>[ToolGrid.tsx]"]
  node_toolconfig["Tool registry<br/>[tools.ts]"]
end

subgraph group_processing["PDF processing"]
  node_toolui["Tool interfaces"]
  node_processors["PDF processors"]
  node_pdfengine["PDF engine"]
  node_wasm["Browser WASM runtimes"]
end

subgraph group_workflows["Workflow editor"]
  node_workflowui["Workflow editor<br/>[WorkflowEditor.tsx]"]
  node_workflowexec["Workflow engine<br/>[engine.ts]"]
  node_workflowstore[("Workflow storage<br/>[storage.ts]")]
  node_templates["Workflow templates"]
end

subgraph group_editing["PDF editing"]
  node_studio["PDF Studio<br/>[PDFStudio.tsx]"]
  node_directapp["Direct editor UI<br/>[app.js]"]
  node_directcore["Editor core<br/>[core.js]"]
  node_engineloader["Editor engine loader<br/>[engine-loader.js]"]
  node_editwasm["Editor WASM module<br/>[editcore.js]"]
  node_shading["Shading surgery<br/>[shadingsurgery.js]"]
  node_type3["Type3 surgery<br/>[type3surgery.js]"]
end

node_user(("User"))

node_user -->|"opens"| node_home
node_home -->|"loads tools"| node_toolconfig
node_user -->|"browses tools"| node_catalog
node_catalog -->|"renders"| node_toolgrid
node_toolgrid -->|"uses registry"| node_toolconfig
node_user -->|"selects tool"| node_toolui
node_user -->|"builds workflow"| node_workflowui
node_workflowui -->|"uses engine"| node_workflowexec
node_workflowui -.->|"chooses templates"| node_templates
node_workflowui -.->|"saves workflows"| node_workflowstore
node_user -->|"opens studio"| node_studio
node_user -.->|"edits PDF"| node_directapp
node_directcore -->|"loads engine"| node_engineloader
node_engineloader -->|"imports module"| node_editwasm
node_directapp -->|"protects artwork"| node_shading
node_directapp -->|"consolidates content"| node_type3
node_type3 -->|"uses surgery"| node_shading

click node_home "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/app/%5Blocale%5D/HomePageClient.tsx"
click node_catalog "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/app/%5Blocale%5D/tools/ToolsPageClient.tsx"
click node_toolgrid "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/tools/ToolGrid.tsx"
click node_toolconfig "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/config/tools.ts"
click node_toolui "https://github.com/pdfcrafttool/pdfcraft/tree/main/src/components/tools"
click node_processors "https://github.com/pdfcrafttool/pdfcraft/tree/main/src/lib/pdf/processors"
click node_pdfengine "https://github.com/pdfcrafttool/pdfcraft/tree/main/src/lib/pdf"
click node_wasm "https://github.com/pdfcrafttool/pdfcraft/tree/main/public"
click node_workflowui "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/workflow/WorkflowEditor.tsx"
click node_workflowexec "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/lib/workflow/engine.ts"
click node_workflowstore "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/lib/workflow/storage.ts"
click node_templates "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/config/workflow-templates.ts"
click node_studio "https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/studio/PDFStudio.tsx"
click node_directapp "https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/app.js"
click node_directcore "https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/core.js"
click node_engineloader "https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/engine-loader.js"
click node_editwasm "https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/editcore.js"
click node_shading "https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/shadingsurgery.js"
click node_type3 "https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/type3surgery.js"

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_home,node_catalog,node_toolgrid,node_toolconfig,node_user toneBlue
class node_toolui,node_processors,node_pdfengine,node_wasm toneAmber
class node_workflowui,node_workflowexec,node_workflowstore,node_templates toneMint
class node_studio,node_directapp,node_directcore,node_engineloader,node_editwasm,node_shading,node_type3 toneRose
```

## Components

### Tool discovery

- [Home page](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/app/%5Blocale%5D/HomePageClient.tsx): `src/app/[locale]/HomePageClient.tsx`
- [Tool catalog](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/app/%5Blocale%5D/tools/ToolsPageClient.tsx): `src/app/[locale]/tools/ToolsPageClient.tsx`
- [Tool grid](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/tools/ToolGrid.tsx): `src/components/tools/ToolGrid.tsx`
- [Tool registry](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/config/tools.ts): `src/config/tools.ts`

### PDF processing

- [Tool interfaces](https://github.com/pdfcrafttool/pdfcraft/tree/main/src/components/tools): `src/components/tools`
- [PDF processors](https://github.com/pdfcrafttool/pdfcraft/tree/main/src/lib/pdf/processors): `src/lib/pdf/processors`
- [PDF engine](https://github.com/pdfcrafttool/pdfcraft/tree/main/src/lib/pdf): `src/lib/pdf`
- [Browser WASM runtimes](https://github.com/pdfcrafttool/pdfcraft/tree/main/public): `public`

### Workflow editor

- [Workflow editor](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/workflow/WorkflowEditor.tsx): `src/components/workflow/WorkflowEditor.tsx`
- [Workflow engine](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/lib/workflow/engine.ts): `src/lib/workflow/engine.ts`
- [Workflow storage](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/lib/workflow/storage.ts): `src/lib/workflow/storage.ts`
- [Workflow templates](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/config/workflow-templates.ts): `src/config/workflow-templates.ts`

### PDF editing

- [PDF Studio](https://github.com/pdfcrafttool/pdfcraft/blob/main/src/components/studio/PDFStudio.tsx): `src/components/studio/PDFStudio.tsx`
- [Direct editor UI](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/app.js): `public/direct-pdf-editor/app.js`
- [Editor core](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/core.js): `public/direct-pdf-editor/core.js`
- [Editor engine loader](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/engine-loader.js): `public/direct-pdf-editor/engine-loader.js`
- [Editor WASM module](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/editcore.js): `public/direct-pdf-editor/editcore.js`
- [Shading surgery](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/shadingsurgery.js): `public/direct-pdf-editor/shadingsurgery.js`
- [Type3 surgery](https://github.com/pdfcrafttool/pdfcraft/blob/main/public/direct-pdf-editor/type3surgery.js): `public/direct-pdf-editor/type3surgery.js`

### Other components

- **User**

## Connections

- User → Home page: opens (evidence: `README.md`)
- Home page → Tool registry: loads tools (evidence: `src/app/[locale]/HomePageClient.tsx`)
- User → Tool catalog: browses tools (evidence: `README.md`)
- Tool catalog → Tool grid: renders (evidence: `src/app/[locale]/tools/ToolsPageClient.tsx`)
- Tool grid → Tool registry: uses registry (evidence: `src/components/tools/ToolGrid.tsx`)
- User → Tool interfaces: selects tool (evidence: `README.md`)
- User → Workflow editor: builds workflow (evidence: `README.md`)
- Workflow editor → Workflow engine: uses engine
- Workflow editor → Workflow templates: chooses templates
- Workflow editor → Workflow storage: saves workflows
- User → PDF Studio: opens studio
- User → Direct editor UI: edits PDF
- Editor core → Editor engine loader: loads engine (evidence: `public/direct-pdf-editor/core.js`)
- Editor engine loader → Editor WASM module: imports module (evidence: `public/direct-pdf-editor/engine-loader.js`)
- Direct editor UI → Shading surgery: protects artwork (evidence: `public/direct-pdf-editor/app.js`)
- Direct editor UI → Type3 surgery: consolidates content (evidence: `public/direct-pdf-editor/app.js`)
- Type3 surgery → Shading surgery: uses surgery (evidence: `public/direct-pdf-editor/type3surgery.js`)
