Section 3 of 17

The architecture on one page

Contents
maintenancefleetbookingbillingsharedapiapiapiapiapifeaturefeature-*feature-*feature-*feature-*uiui-*ui-*ui-*ui-*ui-*data-accessdata-accessdata-accessdata-accessdata-accessdata-accessmodelmodelmodelmodelmodelmodelutilutil-*util-*util-*util-*util-*
apps/<app>/                         thin: bootstrap, root routes, root providers
libs/<domain>/feature-<use-case>/   smart components for one use case (a page or a flow)
libs/<domain>/ui-<name>/            presentational components: inputs in, events out
libs/<domain>/data-access/          state, effects, HTTP, facade
libs/<domain>/model/                types and pure domain functions, no framework
libs/<domain>/util-<name>/          technical helpers for this domain
libs/<domain>/api/                  the only thing other domains may import
libs/<domain>/feature-shell/        the domain's routes and providers
libs/shared/<type>-<name>/          used by every domain, knows none of them

Six sentences to remember:

  1. Every library has one domain and one type, written as tags, and the tags decide what it may import.
  2. Imports point down the type ladder: feature → ui, data-access → model → util. Never up, never sideways between features.
  3. A domain sees another domain only through its api library. Everything else in a domain is private.
  4. shared knows no domain. If a "shared" file mentions work orders, it belongs to maintenance.
  5. Components never talk to HTTP. Data flows through data-access; the feature sees a facade or selectors, never a URL.
  6. Applications are thin. An app wires routes and providers; features live in libraries, so a second app costs nothing.