3 min readCalm pace · scan the outline anytime

Core overview

Framework-agnostic Modular Hexagonal Domain-Driven Design — the Core layer of this documentation site.

Core

Core is the framework-agnostic Modular Hexagonal Domain-Driven Design standard. It describes how modules are shaped, how Use Cases orchestrate Domain work through ports, and how peers communicate without coupling Application/Domain layers.

Version1.0.0-draft
LanguageProfessional English
ExamplesGreenfield only — Ordering, Warehouse, Directory, Identity
Must not containHost framework APIs, ORM models/query builders, admin UI widgets, host tooling commands

Host-specific mapping lives under Adapters. Adapters explain how Core lands on a host; they must not redefine Core. When Core pages show host examples, they list all documented hosts fairly (Laravel, Symfony, Yii, CodeIgniter, CakePHP, Spiral, Slim, Mezzio) — never a single host as if it were Core.

This site is the sole architecture canon. Other repositories — demos, playgrounds, and production apps — must take Modular Hexagonal DDD rules from here instead of maintaining a divergent long-form standard. Product backlogs stay in each project’s own ROADMAP.md.

Design test (repeat)

If the peer module is deleted and replaced by HTTP, does Application/Domain still compile?

Contents

PageTopic
PhilosophyDomain-centricity, ports & adapters, bounded contexts
Module layoutApplication / Domain / Infrastructure / UI + Shared promote rule
Strictness ladderDomain hardest → composition root wiring → outer adapters
Golden flowUI → Use Case → Domain → Port → Adapter
Use cases & DTOs*UseCase + __invoke; Application vs Domain DTOs
Ports & persistenceManual map record ↔ Entity; no ORM in Domain
Cross-module ACLSync bridge — Ordering ↔ Warehouse
Cross-module eventsAsync bridge — OrderFulfilled → Warehouse inbound Use Case
Cross-module contractsThin façades, event schemas, evolution
Event deliveryIdempotency, duplicates, outbox, query exceptions
Transactions & failuresPer-Use-Case ownership, ACL fail-before-commit
OrchestrationSaga-lite multi-step flows (still ACL + Events)
Reads & reportingProjections and ACL reads — no cross-module ORM joins
Shared kernelPromote technical capabilities used by ≥2 modules
Decision treeLocal / repository / ACL / Event / Shared
Anti-patternsCommon mistakes and fixes
Where does this go?Placement quick reference
Portable requirementsMUST checklist (from portable PRD)
Core versioningSemVer for Core, docs /v1, contracts
Optional assistant packOptional rules slice for AI assistants — not required
Pure PHP + PSR skeletonFramework-free sample layout
Adopt in another projectHow other repos should use this site
Modular Hexagonal Domain-Driven Design
Core 1.0.0-draft