1.2 KiB
1.2 KiB
Clean Architecture Data Flow (Shared Contract)
This document defines the shared data-flow rules that apply across all delivery applications.
It does not contain app-specific rules.
App-specific contracts:
- Core:
docs/architecture/core/CORE_DATA_FLOW.md - API:
docs/architecture/api/API_DATA_FLOW.md - Website:
docs/architecture/website/WEBSITE_DATA_FLOW.md
1) Dependency rule (non-negotiable)
Dependencies point inward.
Delivery apps → adapters → core
Core never depends on delivery apps.
2) Cross-boundary mapping rule
If data crosses a boundary, it is mapped.
Examples:
- HTTP Request DTO is mapped to Core input.
- Core result is mapped to HTTP Response DTO.
3) Ownership rule
Each layer owns its data shapes.
- Core owns domain and application models.
- API owns HTTP DTOs.
- Website owns ViewData and ViewModels.
No layer re-exports another layer’s models as-is across a boundary.
4) Non-negotiable rules
- Core contains business truth.
- Delivery apps translate and enforce.
- Adapters implement ports.