excalidraw · snapshot
Created · run_mwekdulh2429d0340fd6c271 · github.com/excalidraw/excalidraw @ master · commit 82d5847e57dc · model claude-opus-5-5
How healthy this repository is, in seven ratings and the findings a quick read turned up, each resting on a file you can open.
Excalidraw is a TypeScript monorepo for a hand-drawn style whiteboard. The core is a React component library published to npm as @excalidraw/excalidraw, built on six smaller packages for elements, geometry and shared utilities; excalidraw-app/ is the excalidraw.com web app, which adds end-to-end encrypted live collaboration (a socket server plus Firebase), encrypted shareable links, an AI text-to-diagram client and local persistence in localStorage and IndexedDB.
Overall health: Adequate. The code is strictly typed, well tested and gated by lint, type checks and coverage thresholds in CI, but the Firebase rules shipped in firebase-project/ let anyone write to any document or storage path, nothing ever expires what is stored there, and no outbound request has a timeout.
| Rating | Scale | Score |
|---|---|---|
| Engineering standards | 7/10 Good | |
| Security | 6/10 Fair | |
| Configuration and secrets | 6/10 Fair | |
| Data and persistence | 5/10 Fair | |
| Error handling and resilience | 6/10 Fair | |
| Availability and recovery | 5/10 Fair | |
| Performance and scale | 7/10 Good |
Dependencies mostly run one way: the app and the editor components call into packages/element, which calls into packages/math and packages/common. Not everywhere, though: 30 module pairs depend on each other both ways, the heaviest being editor components and actions (181 calls one way, 166 back).
modules.cjs, so it matches the tables in this section exactly. Columns are dependency depth: a module sits one column right of everything that calls into it. Line thickness is the number of calls and imports crossing that boundary, and an edge that loops underneath is a cycle, drawn rather than hidden. The 34 modules under “no edge drawn” take part in none of the edges shown, heaviest first. The accented box is the module with the most files.| Module | Files | What it owns |
|---|---|---|
| packages/excalidraw/components | 147 | The editor UI, including the 11,517-line App.tsx that runs the canvas and input. |
| packages/excalidraw/tests | 82 | Editor integration and regression tests. |
| packages/element/src | 58 | The element model: shapes, binding, arrows, text, frames, scene, store and history deltas. |
| packages/excalidraw/actions | 50 | User actions (export, align, style, finalize) behind menus and shortcuts. |
| packages/excalidraw | 49 | Library entry point, public types, clipboard, i18n and scene helpers. |
| packages/excalidraw/components/TTDDialog | 41 | Text-to-diagram and Mermaid-to-Excalidraw dialog. |
| packages/element/tests | 28 | Unit tests for the element package. |
| packages/common/src | 21 | Shared constants, colours, events, utilities and feature flags. |
| packages/excalidraw/components/dropdownMenu | 17 | Dropdown menu primitives. |
| packages/math/src | 16 | Points, vectors, curves, segments and other 2D geometry. |
| packages/excalidraw/data | 15 | File formats: restore, JSON, blob, encryption, library loading. |
| excalidraw-app | 14 | The web app shell: App.tsx, Sentry, Plus iframe export. |
| packages/excalidraw/components/Stats | 14 | Stats panel and dimension editors. |
| packages/excalidraw/fonts | 13 | Bundled font faces and font loading. |
| (repo root) | 13 | Workspace manifest, tsconfig, vitest, Docker and Vercel configuration. |
| packages/excalidraw/components/ColorPicker | 12 | Colour picker. |
| packages/excalidraw/hooks | 12 | Shared React hooks. |
| excalidraw-app/data | 11 | App persistence: Firebase, share-link backend, localStorage, IndexedDB, tab sync. |
| examples/with-script-in-browser | 11 | Example integration loaded from a script tag. |
| scripts | 11 | Build, release, changelog and locale coverage scripts. |
| excalidraw-app/components | 10 | App-only UI: AI client, error boundary, debug canvas, Plus export. |
| packages/excalidraw/components/Sidebar | 10 | Sidebar primitives. |
| packages/utils | 9 | Public export and shape utilities (@excalidraw/utils). |
| packages/excalidraw/subset | 9 | Font subsetting with WASM HarfBuzz and woff2 bindings. |
| packages/excalidraw/renderer | 9 | Static and interactive canvas rendering. |
| packages/common | 9 | Package manifest and the debug timing helper. |
| packages/math/tests | 9 | Unit tests for the math package. |
| packages/excalidraw/charts | 8 | Chart generation from pasted tabular data. |
| examples/with-nextjs | 8 | Example Next.js integration. |
| dev-docs/src | 7 | Docusaurus site components (the docs have moved to plus.excalidraw.com). |
| packages/laser-pointer | 7 | Laser pointer trail geometry (@excalidraw/laser-pointer). |
| dev-docs | 6 | Docusaurus configuration and redirects. |
| scripts/stats | 4 | Bundle and performance stats posted from CI. |
| excalidraw-app/tests | 4 | App-level tests. |
| packages/fractional-indexing | 4 | Fractional index keys that order elements for sync. |
| packages/element | 4 | Element package manifest and build configuration. |
| excalidraw-app/collab | 3 | Live collaboration: socket portal, room lifecycle, errors. |
| excalidraw-app/share | 3 | Share dialog for collaboration links. |
| excalidraw-app/app-language | 3 | Language detection and selection. |
| packages/math | 3 | Math package manifest and build configuration. |
| @docusaurus | 3 | Docusaurus type shims. |
| scripts/woff2 | 2 | Vite plugins that rewrite woff2 font URLs to the CDN. |
| @excalidraw | 2 | Shared eslint and prettier configuration packages. |
| packages | 1 | Shared base tsconfig and eslint configuration. |
| .husky | 1 | Pre-commit hook running lint-staged. |
| public | 1 | Static assets served as is. |
| Entry point kind | Count | Where |
|---|---|---|
| Web app bootstrap | 1 | excalidraw-app/index.tsx |
| Published npm packages | 7 | packages/*/package.json |
| Cross-window message handlers | 3 | excalidraw-app/ExcalidrawPlusIframeExport.tsx:205, packages/excalidraw/components/App.tsx:1924, App.tsx:4022 |
| DOM event listener registrations | 172 | matches across 41 files, most in packages/excalidraw/components/App.tsx |
| Root package scripts | 43 | package.json |
| CI workflows | 12 | .github/workflows/ |
| Container image | 1 | Dockerfile |
Weakest: structure and modularity
Strict TypeScript, eslint, prettier, husky and coverage thresholds in vitest.config.mts (60% lines, 70% branches) are enforced in CI by .github/workflows/test.yml and lint.yml, over 163 test files. Against that, packages/excalidraw/components/App.tsx runs to 11,517 lines, 198 functions exceed 100 lines, and 30 module pairs depend on each other both ways.
Weakest: authorisation
Scenes and files are encrypted in the browser and the key stays in the URL fragment, which excalidraw-app/sentry.ts strips before reporting, and CI actions are pinned by SHA. But firebase-project/firestore.rules grants get, write: if true on every document and storage.rules does the same for both file paths, with no authentication, size or shape checks.
Weakest: validation and defaults
Configuration is externalised through VITE_APP_* variables per environment (.env.development, .env.production), CI tokens come from GitHub secrets, and nothing private is committed. Nothing checks the values at start-up: excalidraw-app/data/firebase.ts:39 falls back to an empty config when the JSON fails to parse, and there is no .env.example documenting the variables declared in excalidraw-app/vite-env.d.ts.
Weakest: retention and lifecycle
Every load passes through restoreElements, which migrates old shapes, and saveToFirebase in excalidraw-app/data/firebase.ts reconciles inside a transaction. Nothing ever expires collaboration scenes or shared files in Firestore and Storage, and the open rules mean anyone holding a room ID can overwrite or delete it.
Weakest: timeouts
Errors surface well: TopErrorBoundary.tsx catches render failures and excalidraw-app/data/LocalData.ts detects storage quota exhaustion and tells the user. But no fetch in the app has a timeout or abort signal (excalidraw-app/data/index.ts:207 and :276, excalidraw-app/components/AI.tsx:65), and excalidraw-app/data/FileManager.ts:107 notes that a failed file save is never retried.
Weakest: backup
Deployment is a static build on Vercel or a digest-pinned nginx image with a health check (Dockerfile), and Sentry reports errors with release tracking. Nothing in firebase-project/ defines a backup or export of Firestore and Storage, and the evidence finds no metrics or alerting at all.
Weakest: data growth
The hot paths are measured and guarded: render throttling, per-element shape caches, and a size-limit workflow and scripts/stats/perf.mjs run in CI. Growth is the soft spot: the whole scene is reserialised to localStorage on every debounced save and rebroadcast every 20 seconds (SYNC_FULL_SCENE_INTERVAL_MS in excalidraw-app/app_constants.ts), so cost grows with the size of the drawing.
| Severity | Findings | Ratings they fall under |
|---|---|---|
| High | 1 | Security rating |
| Medium | 6 | Security rating, Data and persistence rating, Error handling and resilience rating, Availability and recovery rating, Engineering standards |
| Low | 7 | Security rating, Configuration and secrets rating, Error handling and resilience rating, Engineering standards |
These counts are a floor, not a total: they are at least the findings a quick read turned up. The full report works through every rating criterion and lists each finding with its evidence.
| Severity | Finding | Rating |
|---|---|---|
| High | Firestore and Storage rules allow unauthenticated writes to any document and file path. | Security rating |
| Medium | The production release workflow pipes a remote install script to a shell while holding the Sentry auth token. | Security rating |
| Medium | Collaboration scenes and shared files are kept forever, with no expiry or deletion path. | Data and persistence rating |
The Full Audit and Documentation report of this repository documents: