1.4 KiB
1.4 KiB
Core Data Flow (Strict)
This document defines the Core data flow rules and boundaries.
Core scope:
core/**
Core does not know:
- HTTP
- Next.js
- databases
- DTOs
- UI models
1) Layers inside Core
Core contains two inner layers:
- Domain
- Application
1.1 Domain
Domain is business truth.
Allowed:
- Entities
- Value Objects
- Domain Services
Forbidden:
- DTOs
- frameworks
- IO
See docs/architecture/core/DOMAIN_OBJECTS.md.
1.2 Application
Application coordinates business intents.
Allowed:
- Use Cases (commands and queries)
- Application-level ports (repository ports, gateways)
Forbidden:
- HTTP
- persistence implementations
- frontend models
2) Core I/O boundary
All communication across the Core boundary occurs through ports.
Rules:
- Port interfaces live in Core.
- Implementations live outside Core.
3) Core data types (strict)
- Use Case inputs are plain data and/or domain types.
- Use Case outputs are plain data and/or domain types.
Core MUST NOT define HTTP DTOs.
4) Canonical flow
Delivery App (HTTP or Website)
↓
Core Application (Use Case)
↓
Core Domain (Entities, Value Objects)
↓
Ports (repository, gateway)
↓
Adapter implementation (outside Core)
5) Non-negotiable rules
- Core is framework-agnostic.
- DTOs do not enter Core.
- Core defines ports; outer layers implement them.