Files
gridpilot.gg/docs/architecture/shared/DATA_FLOW.md
2026-01-11 14:42:54 +01:00

1.2 KiB
Raw Blame History

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:

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 layers models as-is across a boundary.

4) Non-negotiable rules

  1. Core contains business truth.
  2. Delivery apps translate and enforce.
  3. Adapters implement ports.