excalidraw · snapshot

Excalidraw: repository health 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.

550source files
163test files
46modules
33hosts called from code

1. Summary

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.

RatingScaleScore
Engineering standards7/10 Good
Security6/10 Fair
Configuration and secrets6/10 Fair
Data and persistence5/10 Fair
Error handling and resilience6/10 Fair
Availability and recovery5/10 Fair
Performance and scale7/10 Good
Each rating is reasoned in the section it names; 6 or below is carried into the risk register.

2. Architecture at a glance

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).

module dependencies 105 136 157 166 167 179 181 182 182 192 200 209 233 296 467 521 622 653 669 1015 no edge drawn .husky 1 file @docusaurus 3 files @excalidraw 2 files dev-docs 6 files dev-docs/src 7 files examples/with-nextjs 8 files examples/with-script-in-browser 11 files excalidraw-app 14 files excalidraw-app/app-language 3 files excalidraw-app/collab 3 files excalidraw-app/components 10 files excalidraw-app/data 11 files excalidraw-app/share 3 files excalidraw-app/tests 4 files packages 1 file packages/common 9 files packages/common/src 21 files packages/element 4 files packages/element/src 58 files packages/element/tests 28 files packages/excalidraw 49 files packages/excalidraw/actions 50 files packages/excalidraw/charts 8 files packages/excalidraw/components 147 files packages/excalidraw/components/ColorPicker 12 files packages/excalidraw/components/Sidebar 10 files packages/excalidraw/components/Stats 14 files packages/excalidraw/components/TTDDialog 41 files packages/excalidraw/components/dropdownMenu 17 files packages/excalidraw/data 15 files packages/excalidraw/fonts 13 files packages/excalidraw/hooks 12 files packages/excalidraw/renderer 9 files packages/excalidraw/subset 9 files packages/excalidraw/tests 82 files packages/fractional-indexing 4 files packages/laser-pointer 7 files packages/math 3 files packages/math/src 16 files packages/math/tests 9 files packages/utils 9 files public 1 file scripts 11 files scripts/stats 4 files scripts/woff2 2 files
Figure 1 · module dependenciesGenerated from 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.
Modules 46 rows
ModuleFilesWhat it owns
packages/excalidraw/components147The editor UI, including the 11,517-line App.tsx that runs the canvas and input.
packages/excalidraw/tests82Editor integration and regression tests.
packages/element/src58The element model: shapes, binding, arrows, text, frames, scene, store and history deltas.
packages/excalidraw/actions50User actions (export, align, style, finalize) behind menus and shortcuts.
packages/excalidraw49Library entry point, public types, clipboard, i18n and scene helpers.
packages/excalidraw/components/TTDDialog41Text-to-diagram and Mermaid-to-Excalidraw dialog.
packages/element/tests28Unit tests for the element package.
packages/common/src21Shared constants, colours, events, utilities and feature flags.
packages/excalidraw/components/dropdownMenu17Dropdown menu primitives.
packages/math/src16Points, vectors, curves, segments and other 2D geometry.
packages/excalidraw/data15File formats: restore, JSON, blob, encryption, library loading.
excalidraw-app14The web app shell: App.tsx, Sentry, Plus iframe export.
packages/excalidraw/components/Stats14Stats panel and dimension editors.
packages/excalidraw/fonts13Bundled font faces and font loading.
(repo root)13Workspace manifest, tsconfig, vitest, Docker and Vercel configuration.
packages/excalidraw/components/ColorPicker12Colour picker.
packages/excalidraw/hooks12Shared React hooks.
excalidraw-app/data11App persistence: Firebase, share-link backend, localStorage, IndexedDB, tab sync.
examples/with-script-in-browser11Example integration loaded from a script tag.
scripts11Build, release, changelog and locale coverage scripts.
excalidraw-app/components10App-only UI: AI client, error boundary, debug canvas, Plus export.
packages/excalidraw/components/Sidebar10Sidebar primitives.
packages/utils9Public export and shape utilities (@excalidraw/utils).
packages/excalidraw/subset9Font subsetting with WASM HarfBuzz and woff2 bindings.
packages/excalidraw/renderer9Static and interactive canvas rendering.
packages/common9Package manifest and the debug timing helper.
packages/math/tests9Unit tests for the math package.
packages/excalidraw/charts8Chart generation from pasted tabular data.
examples/with-nextjs8Example Next.js integration.
dev-docs/src7Docusaurus site components (the docs have moved to plus.excalidraw.com).
packages/laser-pointer7Laser pointer trail geometry (@excalidraw/laser-pointer).
dev-docs6Docusaurus configuration and redirects.
scripts/stats4Bundle and performance stats posted from CI.
excalidraw-app/tests4App-level tests.
packages/fractional-indexing4Fractional index keys that order elements for sync.
packages/element4Element package manifest and build configuration.
excalidraw-app/collab3Live collaboration: socket portal, room lifecycle, errors.
excalidraw-app/share3Share dialog for collaboration links.
excalidraw-app/app-language3Language detection and selection.
packages/math3Math package manifest and build configuration.
@docusaurus3Docusaurus type shims.
scripts/woff22Vite plugins that rewrite woff2 font URLs to the CDN.
@excalidraw2Shared eslint and prettier configuration packages.
packages1Shared base tsconfig and eslint configuration.
.husky1Pre-commit hook running lint-staged.
public1Static assets served as is.
Entry point kindCountWhere
Web app bootstrap1excalidraw-app/index.tsx
Published npm packages7packages/*/package.json
Cross-window message handlers3excalidraw-app/ExcalidrawPlusIframeExport.tsx:205, packages/excalidraw/components/App.tsx:1924, App.tsx:4022
DOM event listener registrations172matches across 41 files, most in packages/excalidraw/components/App.tsx
Root package scripts43package.json
CI workflows12.github/workflows/
Container image1Dockerfile

3. Ratings

Engineering standards

Engineering standards: 7/10, Good

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.

Security rating

Security: 6/10, Fair

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.

Configuration and secrets rating

Configuration and secrets: 6/10, Fair

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.

Data and persistence rating

Data and persistence: 5/10, Fair

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.

Error handling and resilience rating

Error handling and resilience: 6/10, Fair

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.

Availability and recovery rating

Availability and recovery: 5/10, Fair

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.

Performance and scale rating

Performance and scale: 7/10, Good

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.

4. Findings a quick read turned up

SeverityFindingsRatings they fall under
High1Security rating
Medium6Security rating, Data and persistence rating, Error handling and resilience rating, Availability and recovery rating, Engineering standards
Low7Security 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.

The three that matter most

SeverityFindingRating
HighFirestore and Storage rules allow unauthenticated writes to any document and file path.Security rating
MediumThe production release workflow pipes a remote install script to a shell while holding the Sentry auth token.Security rating
MediumCollaboration scenes and shared files are kept forever, with no expiry or deletion path.Data and persistence rating

5. What the full report covers

The Full Audit and Documentation report of this repository documents:

  • 10 configuration variables, each with where it is read and what sets it
  • 85 external integrations, with what breaks when each is unavailable
  • 33 outbound hosts the code calls, each checked against what the code is for
  • 26 infrastructure and packaging paths probed, present or absent
  • 6 observability signals, present or absent
  • Every entry point, with where it is declared and what handles it
  • The seven ratings reasoned criterion by criterion, with the evidence for each
  • Every finding in a severity-rated risk register, with its evidence
  • A remediation roadmap: what to fix now, next and later, each with its effort
  • README corrections as a patch, and the documents linked into one set
Download