Hexagonal Architecture
Isolate application core logic from external dependencies using ports and adapters.
Open detail chart →the Backend Expanse
Clean architecture, CQRS, hexagonal patterns, and API design principles for maintainable server-side systems.
Domain logic sits at the centre, insulated from the outside world. Ports define the contracts; adapters satisfy them. Infrastructure depends inward — the core depends on nothing.
Commands mutate state through a handler into the write store, then a projection syncs a denormalized read model. Queries bypass the domain model entirely — reading directly from the read store. Each path is optimized independently.
The IoC container holds the wiring graph. At construction time it resolves each dependency, injects it into the service, and confirms the handshake. Services declare what they need — the container decides how to satisfy it, decoupling callers from implementations.
OrderService invokes Checkout with a request. The context delegates to whichever ShippingStrategy is currently injected — Standard, Express, Overnight, or Economy — then returns the result. The strategy rotates every few seconds, showing how behaviour changes without modifying the calling code.
Producers emit domain events onto a shared bus; subscribers receive only the events they declare interest in. OrderSvc, InventorySvc, and PaymentSvc publish independently — the bus routes to AuditSvc (all), WarehouseSvc (orders + stock), NotifySvc (orders), and BillingSvc (payments). No producer knows its consumers.
Foundational principles compose into advanced patterns. Select any node to inspect the skill and its role in the broader architecture.
Select a skill to inspect
Isolate application core logic from external dependencies using ports and adapters.
Open detail chart →Provide dependencies to a component from the outside rather than constructing them internally.
Open detail chart →Define a family of algorithms behind a common interface and make them interchangeable at runtime.
Open detail chart →Separate read and write models to optimise each path independently and reduce contention.
Open detail chart →Every module, class, or function should have one reason to change — separating concerns produces systems that are easier to reason about.
Open detail chart →