Section 3 of 17
The architecture on one page
Contents
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:
- Every library has one domain and one type, written as tags, and the tags decide what it may import.
- Imports point down the type ladder: feature → ui, data-access → model → util. Never up, never sideways between features.
- A domain sees another domain only through its
apilibrary. Everything else in a domain is private. sharedknows no domain. If a "shared" file mentions work orders, it belongs to maintenance.- Components never talk to HTTP. Data flows through
data-access; the feature sees a facade or selectors, never a URL. - Applications are thin. An app wires routes and providers; features live in libraries, so a second app costs nothing.