learn
packages/

Engine

Browser-independent drawing geometry, tools, renderer, scene capture, and history.

The engine never touches the network or the DOM data layer: tools produce geometry, the scene keeps state and history, and the renderer turns state into sketch-style paths with a seeded randomizer so strokes look hand-drawn but render identically. Frames stay flat and axis-aligned by construction.

What it owns

  • Drawing tools: shapes, lines, arrows, curves, freedraw, frames, text
  • Geometry: bounds, hit-testing, rotation, strokes, simplification
  • The renderer: sketch paths, transforms, culling, and SVG output
  • Scene state: layout, records, previews, and history

Files

File list and purposes from the folder README.

FilePurpose
src/tools/One tool per shape plus the tool manager.
src/geometry/Bounds, hit tests, curves, strokes, and simplification.
src/renderer/Element dispatch, sketch paths, transforms, and render loop.
src/scene/Scene state, layout, previews, records, and history.
src/element/Element factory.
src/text/Text measurement.
src/viewport/Viewport math and touch handling.
src/utils/Small shared helpers.

Dependencies

No runtime dependencies.

Development and tooling (1)
LibraryVersion rangeWhy it is used here
Vitest^5.0.1Runs the unit and regression test suites.

Dependencies as of commit b0026d9.

Internal packages used

engine package
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral

Talks to

Sources: packages/engine/README.md, packages/engine/src/README.md, packages/engine/src/tools/README.md, packages/engine/src/geometry/README.md, packages/engine/src/renderer/README.md, packages/engine/src/scene/README.md (documented at commit b0026d9)

On this page