pastello-app

0012. Dart workspace with separate app and engine packages

Context

The drawing engine is developed in-house (ADR 0005) and must stay independent from the UI, storage and state management. A convention alone (“do not import the UI from the engine”) is easy to break as contributors come and go.

Decision

The repository is a Dart pub workspace with two packages:

pastello/
├── pubspec.yaml                  # workspace root
├── app/                          # the Flutter app
│   └── lib/src/
│       ├── app/                  # MaterialApp, theme, routing
│       ├── core/                 # shared utilities
│       ├── l10n/                 # ARB translations
│       └── features/
│           ├── editor/
│           ├── gallery/          # gallery and trash
│           ├── stickers/         # content catalog and packs
│           ├── export/           # gallery export, share, print
│           └── parents/          # parental gate, about, backup
└── packages/
    └── pastello_engine/          # the drawing engine
        ├── lib/src/
        │   ├── document/         # Drawing, Element, serialization, migrations
        │   ├── commands/         # undo/redo commands
        │   ├── geometry/         # strokes, eraser, hit testing, lasso
        │   └── rendering/        # painters, raster cache
        ├── test/                 # unit and golden tests
        └── benchmark/            # performance harness

Consequences

Alternatives considered