How storytold/figcraft works
FigCraft is a native and browser-based interface design and prototyping app, with CLI and agent-facing control paths. A designer edits a persistent document through the UI; the engine applies commands to design objects and supports layout, components, prototypes, importing/exporting and inspection. Collaboration synchronizes edits through a separate networking layer. The README documents broader capabilities than the sampled code; dashed links mark those documented or plausible integrations where direct wiring was not shown.
Main entry points: cmd.rs Command engine · app.rs Editor UI · src/main.rs Desktop app · src/main.rs Browser app
Components 22
App surfaces
- Desktop app
apps/figcraft/src/main.rs - Browser app
apps/figcraft-web/src/main.rs - Editor UI
crates/ui-egui/src/app.rs - Desktop services
apps/figcraft/src/services.rs - URL options
apps/figcraft-web/src/query.rs
Design editing
- Command engine
crates/engine/src/cmd.rs - Canvas editing
crates/engine/src/canvas.rs - Document model
crates/collab/src/change.rs - Auto layout
crates/layout/src/lib.rs - Components
crates/engine/src/cmd/component.rs - Prototyping
crates/engine/src/proto_run.rs - Developer mode
crates/engine/src/dev.rs
Files and export
- File commands
crates/engine/src/cmd/file.rs - File formats
crates/format/src/fig.rs - SVG support
crates/svg/src/lib.rs - PDF output
crates/pdf/src/lib.rs
Collaboration
- Change sync
crates/collab/src/client.rs - Session authority
crates/collab/src/server.rs - Collab networking
crates/collab-net/src/net.rs
Automation
- CLI
apps/figcraft-cli/src/main.rs - MCP server
crates/mcp/src/server.rs
Other components
- Designer
Connections 25
- Designer → Desktop app: opens and edits
README.md - Designer → Browser app: opens and edits
README.md - Desktop app → Editor UI: runs editor
apps/figcraft/src/main.rs - Browser app → Editor UI: runs editor
apps/figcraft-web/src/main.rs - Desktop app → Desktop services: provides services
apps/figcraft/src/main.rs - Browser app → URL options: reads URL options
apps/figcraft-web/src/main.rs - Editor UI → Command engine: executes commands
- Command engine → Canvas editing: dispatches edits
- Command engine → Document model: changes document
- Designer → Auto layout: creates layouts
README.md - Designer → Components: builds variants
README.md - Designer → Prototyping: defines flows
README.md - Designer → Developer mode: inspects designs
README.md - Command engine → File commands: handles file actions
- File commands → File formats: reads and writes
- Designer → SVG support: imports and exports
README.md - Designer → PDF output: exports
README.md - Change sync → Document model: synchronizes changes
crates/collab/src/client.rs - Session authority → Change sync: orders and rebroadcasts
crates/collab/src/server.rs - Collab networking → Session authority: transports messages
- Editor UI → Change sync: shares edits
README.md - Designer → CLI: runs commands
README.md - CLI → Command engine: uses same engine
README.md - Designer → MCP server: requests tools
README.md - MCP server → Command engine: executes tools