Technical Documentation
Excalidraw Integration Plan
Excalidraw Integration Plan
Falcon Flowmira integrates Excalidraw only via the public
@excalidraw/excalidraw package. No internal source is vendored.
Integration surface
src/components/flowmira/excalidraw-board.tsx— client-only wrappersrc/routes/_authenticated/board.$id.tsx— Pro-gated routesrc/routes/_authenticated/whiteboards.tsx— Pro upgrade wall + listsrc/lib/excalidraw/serialize.ts— scene envelope helperssrc/lib/security/svg-sanitizer.ts— library-import sanitizationsrc/lib/security/scene-redaction.ts— secret redaction before save/export
Plan gating
- Server:
public.diagrams_enforce_free_limitstrigger +has_role/current_plan_codeRPCs. - Client:
useEntitlementshook +UpgradeWallcomponent. - Rafa tools: every whiteboard tool re-checks plan on the server before executing.
Persistence
- Table:
public.diagrams(kind = 'excalidraw'). - Named checkpoints:
snapshot_diagram_versionRPC. - Trash / restore: existing diagrams
is_archivedflag +trash_items. - Images: private Supabase storage, signed URLs only.
Rafa hand-off
- Rafa cannot mutate the whiteboard directly; it produces a proposed change set rendered in the Rafa side panel. The user reviews, accepts, or rejects.
- A checkpoint is snapshotted before any accepted apply.
- Destructive proposals (delete / replace) require explicit confirmation.
Six-sprint alignment
- Sprint 1 (repo eval) — this document set.
- Sprint 2 (proof of concept) —
board.$id.tsx, autosave, PNG/SVG. - Sprint 3 (Falcon whiteboard) — checkpoints, library import, workshop overlay.
- Sprint 4 (Rafa) — proposed-change preview UI.
- Sprint 5 (marketplace) — library import validation; templates.
- Sprint 6 (launch) — E2E tests in
tests/e2e/whiteboards.spec.ts.