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.
| Version | 1.0.0-draft |
| Language | Professional English |
| Examples | Greenfield only — Ordering, Warehouse, Directory, Identity |
| Must not contain | Host 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
| Page | Topic |
|---|---|
| Philosophy | Domain-centricity, ports & adapters, bounded contexts |
| Module layout | Application / Domain / Infrastructure / UI + Shared promote rule |
| Strictness ladder | Domain hardest → composition root wiring → outer adapters |
| Golden flow | UI → Use Case → Domain → Port → Adapter |
| Use cases & DTOs | *UseCase + __invoke; Application vs Domain DTOs |
| Ports & persistence | Manual map record ↔ Entity; no ORM in Domain |
| Cross-module ACL | Sync bridge — Ordering ↔ Warehouse |
| Cross-module events | Async bridge — OrderFulfilled → Warehouse inbound Use Case |
| Cross-module contracts | Thin façades, event schemas, evolution |
| Event delivery | Idempotency, duplicates, outbox, query exceptions |
| Transactions & failures | Per-Use-Case ownership, ACL fail-before-commit |
| Orchestration | Saga-lite multi-step flows (still ACL + Events) |
| Reads & reporting | Projections and ACL reads — no cross-module ORM joins |
| Shared kernel | Promote technical capabilities used by ≥2 modules |
| Decision tree | Local / repository / ACL / Event / Shared |
| Anti-patterns | Common mistakes and fixes |
| Where does this go? | Placement quick reference |
| Portable requirements | MUST checklist (from portable PRD) |
| Core versioning | SemVer for Core, docs /v1, contracts |
| Optional assistant pack | Optional rules slice for AI assistants — not required |
| Pure PHP + PSR skeleton | Framework-free sample layout |
| Adopt in another project | How other repos should use this site |