Architecture
Hexagonal layout
apps (demo, web)
provideDemoAdapters() / provideWebAdapters()
↓
libs/features-* → inject *PORT, resource()
↓
libs/ports → interfaces only
↓
adapters-mock | data-access-supabaseHard rules
- Never import adapters from
libs/features-*orlibs/ui. - Features inject port tokens:
GENERATION_PORT,CREDIT_PORT,ORG_PORT, … libs/portsmust not import@angular/*orrxjsin port logic.- Adapter swap only in
apps/*/src/app/app.config.ts.
Angular conventions
| Use | Avoid |
|---|---|
| Standalone components | New NgModules |
input(), computed(), resource() | @Input, subscribe() in templates |
@if, @for | *ngIf, *ngFor |
| Functional guards | Class 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
| App | Backend | Use |
|---|---|---|
apps/demo | Mock only | Static hosting, PWA, fast E2E |
apps/web | Supabase | Studio — full stack local + production |
apps/api-console | Supabase | Public API developer portal |
Last updated on