Layercake is an interactive platform for designing, executing, and reviewing graph-based plans. It combines a visual DAG builder, rich graph editors, automated exporters, and agentic tooling across three surfaces: a Rust backend and CLI, a React web application, and a Tauri desktop shell that bundles everything into a single install.
- Visual Workflow Builder – compose plan DAGs with drag-and-drop nodes, data-source wiring, execution states, and automatic dependency tracking.
- Rich Graph Editing – edit nodes, edges, layers, and metadata in spreadsheet or visual modes with live layout controls, layer toggles, and export-ready previews.
- Data Source Management – import CSV/TSV assets, persist raw payloads, and replay transformations through the plan pipeline.
- Desktop & Web Experiences – ship a self-contained Tauri desktop app or run the Vite-powered web UI against the same Rust backend.
- Real-Time Collaboration – share presence, edit history, and live cursor state through the GraphQL + WebSocket collaboration layer.
- Agentic Workflows – expose Layercake projects, graphs, and transformations to MCP-compliant assistants (Claude, Ollama, etc.) for chat-driven analysis and tooling.
- Automation & Exporters – run plans headlessly from the CLI, watch for file changes, and emit PlantUML, Graphviz, Mermaid, GML, or custom Handlebars templates.
- Persistent Storage & Audit – all projects, DAGs, edits, chat credentials, and plan runs are stored in SQLite via SeaORM migrations.
| Path | Purpose |
|---|---|
layercake-core/ |
Rust workspace crate with the CLI, GraphQL/REST server, plan runtime, exporters, and MCP integration. |
frontend/ |
Vite + React + Mantine UI with ReactFlow-based plan and graph editors. |
src-tauri/ |
Tauri 2 shell that embeds the backend, manages SQLite files, and ships the desktop app. |
external-modules/ |
Optional integrations (e.g. axum-mcp transport helpers). |
resources/ |
Sample projects, Handlebars templates, reference exports, and shared assets. |
docs/ |
Architecture notes, review logs, and migration plans. |
scripts/ |
Dev/build helpers (dev.sh, platform builds, installers). |
- Bundles the backend server and React UI into a single binary, storing data under the OS-specific app data directory.
- Launch for development with:
npm run tauri:dev
- Build signed installers per platform:
npm run tauri:build # current platform npm run tauri:build:macos # or tauri:build:linux / tauri:build:windows
- The desktop shell starts an embedded server, negotiates a shared secret, and points the UI at it automatically.
- Start the backend (defaults shown):
cargo run --bin layercake -- serve \ --port 3001 \ --database layercake.db \ --cors-origin http://localhost:1422
- Point the frontend at that API by creating
frontend/.env.local(or exporting before the next step):echo 'VITE_API_BASE_URL=http://localhost:3001' > frontend/.env.local
- Run the Vite dev server:
npm run frontend:dev
Open http://localhost:1422 to access the plan editor, data source manager, graph editors, chat workspace, and system settings.
The repository also ships ./dev.sh (web) and ./dev.sh --tauri (desktop) scripts that wire up the services, enforce ports (3001/1422), initialize the database, and stream logs.
- Execute plans directly:
cargo run --bin layercake -- run \ --plan resources/sample-v1/attack_tree/plan.yaml \ --watch
- Initialize a new plan YAML:
cargo run --bin layercake -- init --plan my-plan.yaml
- Generate starter projects:
cargo run --bin layercake -- generate sample attack_tree ./output-dir
- Run the backend server for remote clients:
cargo run --bin layercake -- serve --port 8080 --database ./layercake.db
- Manage migrations:
cargo run --bin layercake -- db init cargo run --bin layercake -- db migrate up cargo run --bin layercake -- db migrate fresh
The CLI ships optional features for the interactive console and chat credential manager (enabled in default builds). See cargo run --bin layercake -- --help for the complete command tree.
- Rust 1.70+ with
cargo - Node.js 18+ and
npm - Git, make, and platform build dependencies listed in BUILD.md
- (Desktop builds) Tauri prerequisites for your OS (WebKit2GTK on Linux, Xcode CLT on macOS, MSVC + WebView2 on Windows)
# Install frontend dependencies
npm run frontend:install
# Optionally warm the Rust workspace
cargo build -p layercake-core./dev.sh– runs the Rust backend on port3001and the Vite dev server on1422../dev.sh --tauri– launches the desktop shell with hot reload.- Logs stream to
backend.log,frontend.log, andtauri.login the repo root.
- The backend uses SQLite via SeaORM, defaulting to
layercake.dbin the repository (dev) or the platform app data dir (desktop). - Run
cargo run --bin layercake -- db initafter cloning or deleting the database file to reapply migrations. - Use
cargo run --bin layercake -- db migrate freshto reset schema state during development.
- Projects group data sources, plan DAGs, graphs, chat logs, and collaboration sessions.
- Plan DAGs (Plan Visual Editor) orchestrate ingestion, transformation, copy, and export nodes. Changes upstream automatically recompute downstream artifacts.
- Graphs can be edited visually or via tabular controls. Edits are stored as replayable
GraphEdits, so data refreshes reapply your manual changes. - Data Sources record raw payloads plus parsed node/edge/layer JSON, enabling repeatable imports.
- Exports use built-in renderers (PlantUML, Graphviz, Mermaid, GML) or custom Handlebars templates located under
resources/library. - Chat & MCP integrate with Claude, Gemini, OpenAI, Ollama, and other OpenAI-compatible services. Manage credentials via the System Settings UI or the CLI (
cargo run --bin layercake -- chat-credentials ...).
Sample CSVs, plans, and rendered outputs live in resources/sample-v1. Import them through the UI or run the CLI samples to explore the pipeline.
- Backend:
npm run backend:test(wrapscargo test -p layercake-core) - Frontend type/smoke build:
npm run frontend:build - Formatting & linting:
cargo fmt cargo clippy --all-targets --all-features
- Desktop bundles:
npm run tauri:build(see BUILD.md for signing/notarization guidance)
- Export Templates – add Handlebars templates under
resources/libraryand register them in the plan DAG to emit custom text or code artifacts. - MCP Tools – extend
external-modules/axum-mcpor the server’smcpmodule to expose additional functions/resources to agentic clients. - Pipeline Stages – add Rust modules under
layercake-core/src/pipelineand wire them into plan execution for custom transformations. - Frontend Components – React components live under
frontend/src/components; Plan/Graph editors leverage ReactFlow and Mantine for rapid iteration.
- BUILD.md – platform prerequisites and packaging instructions.
- DEV_SCRIPTS.md – details on the
dev.shhelper. - README-Tips.md – watcher tooling, rendering tips, and automation snippets.
- SPECIFICATION.md – end-to-end product vision, data model, and technology stack.
docs/– collaboration model, mutation refactors, error handling guides, and architecture discussions.
Layercake is evolving rapidly toward distributed collaborative graph editing and agent-driven workflows. Issues, pull requests, and design discussions are welcome!