docs(architecture): refresh containers + nx boundaries diagrams, add local-infra diagram #119

Merged
julien merged 1 commits from docs/architecture-refresh-infra-diagram into main 2026-05-13 11:15:04 +02:00
Owner

Summary

Dépoussiérage of docs/architecture.md after the auth/session track and a new local-infra diagram.

Fixed

  • §2 Containersportal-admin was missing despite shipping in ADR-0020 and being scaffolded in apps/portal-admin. Added as a sibling SPA with its own session cookie (__Host-portal_admin_session), and the BFF box now distinguishes /api/* (end-user) from /api/admin/* (RBAC + @RequireMfa({ freshness: 600 })).
  • §3 Nx module boundaries — three small lies:
    • shared-ui was drawn under scope:portal-shell. The actual tag in libs/shared/ui/project.json:7 is scope:shared. Same for shared-state (which wasn't on the diagram at all). Both now live in the scope:shared bubble.
    • portal-admin was absent. Added with its planned (dashed) edges to the shared libs and a note that no scope:portal-admin row exists in eslint.config.mjs yet — that lands when admin modules grow real lib deps (follow-up).
    • The "forbidden" examples included shared-tokens ⟶ shared-ui framed as "narrower scope", which doesn't apply (both are scope:shared / type:shared). Replaced with examples actually enforced by depConstraints.

Added

  • §5 Local dev infrastructure — visualises what docker compose up actually starts: postgres / redis / otel-collector always up, plus opt-in profiles dbtools (pgweb), observability (Jaeger), serve-static (Caddy). Shows ports, named volumes, the bring-up cheat sheet, and the separate CI-runners stack (apf-portal-ci-runners, distinct network). Sources point straight at the compose files so a contributor can chase any detail in one click.

Misc

  • Updated the "Trace context propagation" row in the "To be added" table — its trigger ("first observability instrumentation lands") was already met. Now flagged as overdue / pending a follow-up PR (deferred from this scope).
  • Carried the pre-existing one-line fix on the §4 squash[…] node (mermaid was rejecting unquoted parens inside the label).

Test plan

  • pnpm exec prettier --check docs/architecture.md → clean.
  • Re-read all five mermaid blocks for syntax (no unquoted parens / : / ( inside [] labels). Compose-side --profile X only appears inside "…" so it's safe.
  • Render in Gitea / IDE markdown preview — the five mermaid blocks should display without errors.
  • Eyeball §5 against infra/local/dev.compose.yml: every service + profile present, ports match.
## Summary Dépoussiérage of `docs/architecture.md` after the auth/session track and a new local-infra diagram. ### Fixed - **§2 Containers** — `portal-admin` was missing despite shipping in ADR-0020 and being scaffolded in `apps/portal-admin`. Added as a sibling SPA with its own session cookie (`__Host-portal_admin_session`), and the BFF box now distinguishes `/api/*` (end-user) from `/api/admin/*` (RBAC + `@RequireMfa({ freshness: 600 })`). - **§3 Nx module boundaries** — three small lies: - `shared-ui` was drawn under `scope:portal-shell`. The actual tag in [libs/shared/ui/project.json:7](libs/shared/ui/project.json#L7) is `scope:shared`. Same for `shared-state` (which wasn't on the diagram at all). Both now live in the `scope:shared` bubble. - `portal-admin` was absent. Added with its planned (dashed) edges to the shared libs and a note that no `scope:portal-admin` row exists in `eslint.config.mjs` yet — that lands when admin modules grow real lib deps (follow-up). - The "forbidden" examples included `shared-tokens ⟶ shared-ui` framed as "narrower scope", which doesn't apply (both are `scope:shared` / `type:shared`). Replaced with examples actually enforced by `depConstraints`. ### Added - **§5 Local dev infrastructure** — visualises what `docker compose up` actually starts: postgres / redis / otel-collector always up, plus opt-in profiles `dbtools` (pgweb), `observability` (Jaeger), `serve-static` (Caddy). Shows ports, named volumes, the bring-up cheat sheet, and the separate CI-runners stack (`apf-portal-ci-runners`, distinct network). Sources point straight at the compose files so a contributor can chase any detail in one click. ### Misc - Updated the "Trace context propagation" row in the "To be added" table — its trigger ("first observability instrumentation lands") was already met. Now flagged as overdue / pending a follow-up PR (deferred from this scope). - Carried the pre-existing one-line fix on the §4 `squash[…]` node (mermaid was rejecting unquoted parens inside the label). ## Test plan - [x] `pnpm exec prettier --check docs/architecture.md` → clean. - [x] Re-read all five mermaid blocks for syntax (no unquoted parens / `:` / `(` inside `[]` labels). Compose-side `--profile X` only appears inside `"…"` so it's safe. - [ ] Render in Gitea / IDE markdown preview — the five mermaid blocks should display without errors. - [ ] Eyeball §5 against [infra/local/dev.compose.yml](../infra/local/dev.compose.yml): every service + profile present, ports match.
julien added 1 commit 2026-05-13 11:13:40 +02:00
docs(architecture): refresh containers + nx boundaries diagrams, add local-infra diagram
CI / commits (pull_request) Successful in 2m2s
CI / scan (pull_request) Successful in 2m14s
CI / check (pull_request) Successful in 2m15s
CI / a11y (pull_request) Successful in 1m57s
CI / perf (pull_request) Successful in 4m54s
4af0269edf
post-auth-track état-des-lieux of docs/architecture.md. three
small lies caught, one diagram added.

containers (§2):
  portal-admin (adr-0020) was missing from the c4 level-2 view
  despite being scaffolded under apps/portal-admin and shipping
  its own session cookie. added as a sibling spa on a distinct
  origin with its own session (__host-portal_admin_session),
  and the bff box now distinguishes /api/* (end-user) from
  /api/admin/* (rbac + @requiremfa).

nx boundaries (§3):
  - shared-ui was drawn under scope:portal-shell. its actual tag
    in project.json is scope:shared. same for shared-state, which
    wasn't on the diagram at all. both moved to the scope:shared
    bubble.
  - portal-admin absent. added with planned (dashed) edges to the
    shared libs; no scope:portal-admin row exists yet in
    eslint.config.mjs, that's a follow-up when admin modules grow.
  - the "forbidden" examples framed shared-tokens ⟶ shared-ui as a
    narrower-scope violation. both are scope:shared / type:shared,
    so depConstraints actually permit it. replaced with examples
    that are genuinely lint-enforced.

local dev infrastructure (§5, new):
  visualises what `docker compose up` starts: postgres + redis +
  otel-collector always-up, plus opt-in profiles dbtools (pgweb),
  observability (jaeger), serve-static (caddy per adr-0019).
  shows ports, named volumes, bring-up cheat sheet, and the
  separate ci-runners stack (apf-portal-ci-runners, dedicated
  network). source links point at the compose files so a
  contributor chases details in one click.

to-be-added table:
  trace-context-propagation row updated — its trigger ("first
  observability instrumentation lands") was already met. now
  flagged as overdue / pending a follow-up.

also carries the one-line mermaid syntax fix on §4's `squash`
node (parens-inside-label needed quoting). pre-existing local
edit.
julien merged commit 6aee56abe9 into main 2026-05-13 11:15:04 +02:00
julien deleted branch docs/architecture-refresh-infra-diagram 2026-05-13 11:15:08 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: julien/apf_portal#119