docs(architecture): realtime layer in dependency-flow + vertical-feature-spec

This commit is contained in:
2026-05-09 00:47:51 +02:00
parent 2a406ecf9d
commit cc53600339
2 changed files with 9 additions and 4 deletions

View File

@@ -111,7 +111,11 @@ apps/web-next/src/server/bind-production.ts (bindAll)
│ production → PayloadJobsEventBus + PayloadJobQueue
│ dev-seed → InMemoryEventBus + InMemoryJobQueue
│ ↓
├─ bindProductionBlog(config, tracer, logger, bus, queue)
├─ resolveRealtime → IRealtimeBroadcaster + IRealtimeHandlerRegistry (ADR-016)
│ server.ts → SocketIORealtimeBroadcaster + RealtimeHandlerRegistry (passed in from server.ts)
│ page/test → InMemoryRealtimeBroadcaster + RealtimeHandlerRegistry (defaults)
│ ↓
├─ bindProductionBlog(config, tracer, logger, bus, queue, realtime, realtimeRegistry)
│ │
│ ├─ blogContainer.bind(TRACER).toConstantValue(tracer)
│ ├─ blogContainer.bind(LOGGER).toConstantValue(logger)
@@ -119,8 +123,9 @@ apps/web-next/src/server/bind-production.ts (bindAll)
│ │ (real repo: inline this.tracer.startSpan + this.logger.captureException per method)
│ ├─ withSpan(tracer, ..., withCapture(logger, ..., useCase(deps))) → UseCase symbol
│ ├─ withSpan(tracer, ..., withCapture(logger, ..., controller(uc))) → Controller symbol
│ ├─ // <gen:event-handlers> bus.subscribe(...) (ADR-015, gen event consume)
─ // <gen:jobs> queue.register(...) in dev-seed; Payload task in prod
│ ├─ // <gen:event-handlers> bus.subscribe(...) (ADR-015, gen event consume)
─ // <gen:jobs> queue.register(...) in dev-seed; Payload task in prod
│ └─ // <gen:realtime-handlers> realtimeRegistry.register(...) (ADR-016, gen realtime handler)
└─ (same for auth, marketing-pages, navigation, media)
```

View File

@@ -257,7 +257,7 @@ packages/navigation/
index.ts
```
Optional `events/`, `jobs/`, `integrations/cms/jobs/` directories (see ADR-015 and `docs/guides/events-and-jobs.md`); features may grow them on demand. The spec's canonical layout above remains correct as the minimum.
Optional `events/`, `jobs/`, `integrations/cms/jobs/` directories (see ADR-015 and `docs/guides/events-and-jobs.md`); optional `realtime/` and `realtime/handlers/` directories (see ADR-016 and `docs/guides/realtime.md`); features may grow any of them on demand. The spec's canonical layout above remains correct as the minimum.
**Request flow:**