DEVELOPMENT.md in the repository — edit it there.Development
New here? Start with SETUP.md to get it running, then read CONTRIBUTING.md for the workflow.
cargo build # fast iteration (debug)
cargo test
cargo fmt && cargo clippy --all-targets --all-features -- -D warnings
pnpm run dev # engine + UI on a random seeded port pair
pnpm --filter slicer-engine-docs docs:dev # live docs site
sea-orm-cli migrate generate "my_migration" -d src/db # scaffold DB migrationDev servers run on a seeded port pair. pnpm run dev rolls a three-digit seed and serves the UI on 4<seed> and the engine on 5<seed>, with a work directory of its own — so a second worktree, a colleague on the same box, or an agent session never collides with yours. It prints the URL to open; the UI dev server proxies /api and /ws to the engine, so that one URL is all you need. Add -- --seed 742 to pin it, -- --ui-only / -- --backend-only for half the stack, and use pnpm run dev:web-slicer or pnpm run dev:desktop for the other runtimes.
Git hooks (autoformat on commit): pnpm install sets up Lefthook via the prepare script. On every commit it formats just the staged files so they already match CI — Prettier for ui/**/*.{ts,html,scss,css} and rustfmt for *.rs. Skip once with git commit --no-verify, or disable with LEFTHOOK=0 git commit.
See CONTRIBUTING.md for workflow, AGENTS.md for AI-agent guidance, and ARCHITECTURE.md for the long-form architecture overview (also rendered on the docs site).
G-code diagnostics: tools/gcode-analysis/ has Python scripts to measure and visualise sliced output — wall overlap, unfilled gaps, bead-width distribution, and layer/zoom renders.
Not sure what to check after a change? Ask the agent "what should I test?" — the test-changes skill replies with a short checklist for the platform you name (remote + web by default).
Architecture at a glance
The same engine runs in three different environments — on a server, compiled into the browser, and bundled into the desktop app — so the G-code is always identical no matter where you slice.
The UI selects its runtime mode at startup:
| Mode | Where slicing happens | When |
|---|---|---|
cloud | On your server | Default web build |
web | In your browser | web-slicer build |
native | On your desktop | Desktop app |
See Scene Engine and Slicing Pipeline for the contract.
References
RepRap G-code Wiki · Arachne Paper · Clipper2 · Marlin G-code · Klipper G-code · Tauri