How folio-brainstorm/reverie works
Rêverie is a TypeScript raster-painting engine for browser creative tools. Its primary workflow runs from an application using the Web facade, through pointer input and frame-budgeted scheduling, into core stroke painting and sparse layer/world state; the Canvas renderer presents that state separately from world-region image export and encoding. The graph also preserves documented core capabilities such as selection, history, brush dynamics, document/project handling, and camera/view control. Several subsystem links rely on README statements because their implementation files were not sampled.
Main entry points: CanvasDrawingSession.ts Drawing session · World.ts World and layers · Raster.ts Sparse raster · DownloadEncodedImage.ts Browser downloads
Components 20
Browser runtime
- Canvas facade
web/src/facade/ReverieCanvas.ts - Drawing session
web/src/session/CanvasDrawingSession.ts - Pointer input
web/src/input/ResolvePointerStrokeInput.ts - Frame scheduler
web/src/scheduler/DrawingScheduler.ts - Browser downloads
web/src/export/DownloadEncodedImage.ts
Painting model
- Stroke pipeline
core/src/core/stroke/Stroke.ts - Brush system
core/src/core/brush - Pixel painting
core/src/core/paint/PaintPixel.ts - Selection mask
core/src/core/selection/SelectionMask.ts - Undo history
core/src/core/history/DocumentHistory.ts - Sparse raster
core/src/core/raster/Raster.ts - World and layers
core/src/core/world/World.ts - Camera and view
core/src/core/camera/Camera.ts
Rendering
- Canvas renderer
renderers/canvas-renderer/src/canvas/CanvasRenderer.ts - Render core
core/src/core/rendering/RenderingCore.ts
Image export
- Region renderer
exporter/src/renderer/ExportRenderer.ts - Image encoders
exporter/src/encoder
Documents
- Document serialization
core/src/core/document - Project containers
core/src/core/project
Other components
- Application
Connections 24
- Application → Canvas facade: uses
README.md - Canvas facade → Drawing session: owns
web/src/facade/ReverieCanvas.ts - Drawing session → Pointer input: normalizes input
web/src/session/CanvasDrawingSession.ts - Drawing session → Frame scheduler: queues commands
web/src/session/CanvasDrawingSession.ts - Frame scheduler → Stroke pipeline: executes stamps
web/src/scheduler/DrawingScheduler.ts - Stroke pipeline → Brush system: places stamps
README.md - Stroke pipeline → Pixel painting: writes pixels
README.md - Pixel painting → Sparse raster: updates pixels
README.md - Pixel painting → Selection mask: applies mask
README.md - Drawing session → Undo history: records edits
web/src/session/CanvasDrawingSession.ts - Undo history → Sparse raster: tracks changes
README.md - World and layers → Sparse raster: owns layer rasters
README.md - Application → Camera and view: controls view
README.md - Canvas renderer → Render core: renders source
README.md - Render core → World and layers: reads composition
README.md - Render core → Camera and view: projects view
README.md - Application → Canvas renderer: presents canvas
README.md - Application → Browser downloads: requests download
README.md - Browser downloads → Region renderer: renders region
- Region renderer → World and layers: reads layers
exporter/src/renderer/ExportRenderer.ts - Region renderer → Sparse raster: reads pixels
exporter/src/renderer/ExportRenderer.ts - Browser downloads → Image encoders: encodes image
README.md - Document serialization → World and layers: serializes state
- Project containers → Document serialization: packages document