- Status: Accepted
- Date: 2026-07-17
Node services duplicated Express bootstrap (helmet, CORS, rate limits, health, metrics, error envelopes). Entry points mixed transport, use cases, and infrastructure, which blocked meaningful tests and created drift.
- Centralize HTTP bootstrap in
@speccursor/shared-utilsviacreateHttpKernelandlistenAndServe. - Structure each app as
index.ts(process) /app.ts(assembly) /routes/application/infrastructure. - Prefer Redis list queues (
LPUSH/RPOP) for jobs and a singleCOUNT(*) OVER()+LIMITpagination query for list endpoints. - Fail closed on webhook HMAC when
rawBodyis missing — never re-serializereq.bodyfor signature checks.
- Lower bootstrap duplication and consistent observability endpoints.
- Route/use-case tests can mount real routers with in-memory doubles.
- New endpoints must not reintroduce monolithic
index.tshandlers.