Technical Documentation
Excalidraw Architecture Notes
Excalidraw Architecture Notes
Repository shape (upstream)
- Monorepo,
yarnworkspaces packages/excalidraw— the reusable React component published as@excalidraw/excalidrawexcalidraw-app/— the hosted Excalidraw+ web app (Firebase, service worker, analytics — NOT reused by Falcon Flowmira)packages/utils,packages/math,packages/common— internal helpers
Component boundaries reused by Falcon Flowmira
<Excalidraw />component (imports@excalidraw/excalidraw/index.css)exportToSvg(...),exportToBlob(...)— export helpersserializeAsJSON(...),restore(...)— scene serialization
Everything else is out of scope. The Falcon integration point is
src/components/flowmira/excalidraw-board.tsx, which:
- Lazy-loads the component via
React.lazybehind<ClientOnly>(Excalidraw toucheswindow/documentat import time). - Bridges the imperative Excalidraw API (
excalidrawAPIcallback) to the Falcon autosave, checkpoint, and export flows. - Debounces scene writes into
public.diagrams.document(Supabase) with plan gating enforced server-side.
Persistence model
- Whiteboards persist to
public.diagramswithkind = 'excalidraw'. - Image binaries greater than 200 KB are lifted out of the scene JSON and stored in private Supabase storage; only a signed URL reference is embedded.
- Named checkpoints use the existing
public.snapshot_diagram_versionRPC. - Trash and restore reuse the diagrams
is_archivedflag andtrash_itemstable.
Rendering model
- Client only. No SSR entry imports the Excalidraw module.
- Suspense skeleton renders during dynamic import.
- Theme is passed via the
themeprop and mirrored to Falcon's dual theme system (Onyx / Apple × Tesla).