Skip to content
bitzorcas
EN

Concept

Layer Stack

The five-layer architecture inside each module: Endpoints → Application → Domain → Infrastructure → Persistence Models.

Last updated

Overview

The layer stack diagram shows the five layers inside each module, from outside in: Endpoints → Application → Domain → Infrastructure → Persistence Models.

Dependencies flow strictly inward — outer layers depend on inner layers, but inner layers are unaware of outer layers. The Domain layer is the pure core of every module, with zero dependencies on other layers.

Key takeaways

  • Endpoints contain only Minimal API route mappings — no business logic
  • Application holds command/query handlers and Mediator pipeline behaviors
  • Domain is the pure core — entities, aggregate roots, domain events, value objects
  • Infrastructure implements repository interfaces, depending on external services
  • Persistence Models are database-mapped entities, separated from domain entities