How storytold/designcraft works
DesignCraft is a Rust page-layout and publishing application for desktop and browser, with headless and agent-driven entry points. Users create or open a document, edit pages and content through the UI or commands, compose and render spreads, then save or export formats such as IDML and PDF. The engine is the command/session boundary shared by these routes; text composition and rendering are distinct stages. The graph preserves documented format, color, and MCP capabilities. Some links are README-documented or inferred from architecture because their implementation excerpts were not provided.
Main entry points: src/lib.rs Session commands · canvas.rs Editor UI · src/lib.rs Text composition · doc Document model
Components 24
User interfaces
- Desktop app
apps/designcraft/src/main.rs - Browser app
apps/designcraft-web/src/main.rs - Web file shell
apps/designcraft-web/src/web.rs - Headless CLI
apps/designcraft-cli/src/main.rs - Editor UI
crates/ui-egui/src/canvas.rs - Properties panel
crates/ui-egui/src/panels/properties.rs
Document engine
- Session commands
crates/engine/src/lib.rs - Editing commands
crates/engine/src/cmd/object.rs - Document model
crates/doc
Layout and content
- Text composition
crates/compose/src/lib.rs - Paragraph breaking
crates/compose/src/breaker.rs - Font database
crates/fonts/src/fontdb.rs - Geometry
crates/geom/src/path.rs - Pointer tools
crates/tools/src/snap.rs - Spread renderer
crates/render/src/lib.rs - Color management
crates/color/src/cms/mod.rs
Formats and output
- IDML exchange
crates/idml/src/import.rs - PDF export
crates/pdf/src/export.rs - EPUB export
crates/epub/src/lib.rs - Text import
crates/textimport/src/docx.rs
Automation
- JSON control
apps/designcraft/src/control_server.rs - MCP server
crates/mcp/src/server.rs
Other components
- Designer
- Agent client
Connections 29
- Designer → Desktop app: uses
README.md - Designer → Browser app: uses
README.md - Designer → Headless CLI: runs
apps/designcraft-cli/src/main.rs - Desktop app → Editor UI: hosts
apps/designcraft/src/main.rs - Browser app → Editor UI: hosts
apps/designcraft-web/src/main.rs - Browser app → Web file shell: starts
apps/designcraft-web/src/main.rs - Web file shell → Editor UI: delivers files
- Editor UI → Session commands: executes commands
crates/engine/src/lib.rs - Properties panel → Editor UI: renders in
crates/ui-egui/src/panels/properties.rs - Headless CLI → Session commands: executes commands
apps/designcraft-cli/src/main.rs - Session commands → Editing commands: dispatches
crates/engine/src/lib.rs - Session commands → Document model: edits
- Editing commands → Document model: updates
- Session commands → Text composition: composes stories
crates/engine/src/lib.rs - Text composition → Paragraph breaking: breaks paragraphs
crates/compose/src/lib.rs - Text composition → Font database: shapes text
- Pointer tools → Session commands: reduces gestures
crates/engine/src/lib.rs - Spread renderer → Text composition: uses composed text
crates/render/src/lib.rs - Spread renderer → Document model: renders spreads
crates/render/src/lib.rs - Color management → Document model: provides colors
- Session commands → IDML exchange: imports and exports
- Session commands → PDF export: exports
- Session commands → EPUB export: exports
- Session commands → Text import: imports text
- Agent client → JSON control: sends JSON
- JSON control → Session commands: executes commands
- Agent client → MCP server: sends MCP
README.md - MCP server → Session commands: dispatches tools
- Session commands → Spread renderer: renders output