Skip to Content
ConceptsArchitecture

Architecture

Hexagonal layout

apps (demo, web) provideDemoAdapters() / provideWebAdapters() libs/features-* → inject *PORT, resource() libs/ports → interfaces only adapters-mock | data-access-supabase

Hard rules

  1. Never import adapters from libs/features-* or libs/ui.
  2. Features inject port tokens: GENERATION_PORT, CREDIT_PORT, ORG_PORT, …
  3. libs/ports must not import @angular/* or rxjs in port logic.
  4. Adapter swap only in apps/*/src/app/app.config.ts.

Angular conventions

UseAvoid
Standalone componentsNew NgModules
input(), computed(), resource()@Input, subscribe() in templates
@if, @for*ngIf, *ngFor
Functional guardsClass guards

Critical: inject() in guards

Call inject() before any await in guards. After the first await there is no injection context → NG0203.

resource() stability

Pass a stable string key in params, not a new object each computed run — avoids gallery flicker.

Port results

Adapters return PortResult<T> (ok + data or error). Features branch on result.ok; templates use resource() loaders.

Apps

AppBackendUse
apps/demoMock onlyStatic hosting, PWA, fast E2E
apps/webSupabaseStudio — full stack local + production
apps/api-consoleSupabasePublic API developer portal
Last updated on