Nest modular monolith designed for service extraction
0001. Nest modular monolith designed for service extraction
Section titled “0001. Nest modular monolith designed for service extraction”- Status: accepted
- Date: 2025-01-01
Context
Section titled “Context”The API could be a classic tightly coupled Nest monolith or a premature microservice fleet. Hidden cross-module imports make later extraction expensive.
Decision
Section titled “Decision”Ship apps/nest as a modular monolith: hexagonal feature modules, zero cross-module imports, EventBus / @frame/events for integration, ports/adapters at boundaries — so a module can move out later without a big-bang rewrite.
Consequences
Section titled “Consequences”- Agents must not add direct imports between feature modules.
- Extraction path is phased (in-process → hybrid broker → independent services); see Starlight guide.
- Shared persistence stays in
@frame/modelsuntil a module owns its data boundary.
- Skill:
apps/nest/.agents/skills/frame-nest/SKILL.md - App context:
apps/nest/AGENTS.md