Skip to main content

12 docs tagged with "clean-architecture"

View all tags

A Practical Guide to Laravel × DDD × Clean Architecture

No Laravel experience required. A 24-chapter guide for SPA developers (Vue/React) that explains Laravel as an API backend together with domain-driven design (DDD) and clean architecture, step by step. It covers modeling with bounded contexts and EventStorming, the theory of value objects, entities, aggregates, and repositories, through to implementation patterns, transactions, testing, and authentication in a Laravel project.

Aggregates — The Consistency Boundary and the Aggregate Root

Explains the DDD aggregate (Aggregate) using the Order aggregate as the example. It covers why the aggregate root is the sole access point, how to decide aggregate boundaries (lifecycle / consistency / transaction / references), choosing between immediate and eventual consistency, referencing across aggregates by ID, and the idea of snapshots.

An Overview of DDD — Strategic Design and Tactical Design

DDD has two layers — strategic design, which decides where to draw the lines, and tactical design, which decides how to build what is inside them. This chapter maps out how the two relate, what happens when you adopt only the tactical patterns, and which layer this guide covers where. Definitions of the individual terms are left to later chapters.

Conclusion and Next Steps — Introducing DDD Incrementally

Organizes the key points of this guide's introduction and all five parts (DDD strategic design / tactical design / clean architecture / practical techniques / a comprehensive hands-on example), and summarizes a roadmap for incremental adoption—value objects → use case layer → repository → domain events—along with frequently asked questions and recommended books, communities, and learning paths.

Designing the Use Case Layer — Command / Query Separation and DTOs

Explains the design of the application layer (use case layer). Covers its responsibilities of coordinating domain objects, managing transactions, and converting input/output; Command / Query separation based on the CQS principle; Command objects and DTOs; dedicated Query services; and design guidelines such as single responsibility.

Domain Services — Business Logic That Does Not Belong to an Entity

Explains the DDD domain service (Domain Service) with implementation examples of discount calculation, stock allocation, and shipping-fee calculation. It covers the criteria for placing logic that spans multiple aggregates and has no infrastructure dependency, the difference from use cases (application services), and design guidelines for avoiding an anemic domain model.

Getting Started — A Practical Guide to Laravel × DDD × Clean Architecture

An introduction to DDD and clean architecture with Laravel, aimed at developers experienced with SPA development (Vue/React). It covers what you will learn, the e-commerce order system used as the running example, the SPA + API architecture assumed throughout, an overview of DDD and clean architecture, and the books to read alongside.

In Practice: Implementing the Order System — An Example That Cuts Across All Layers

Integrates the DDD and clean architecture learned so far, implementing the 4 layers (presentation / application / domain / infrastructure) using the order creation and confirmation APIs as the subject. Summarizes each layer's responsibilities, the flow of data transformation, and layered tests (domain / UseCase / Repository) to bring the whole picture together.

The Basic Concepts of DDD — Domain Objects, Aggregates, Repositories

Organizes the core terminology of DDD's tactical design. It explains the definitions of domain / domain object / domain model / business rule, the difference between an entity and a value object, the aggregate as a consistency boundary, and the role of the repository in abstracting persistence, with concrete examples.

Why DDD — The Limits of the Fat Controller / Fat Model

Organizes the problems that arise when handling complex business logic in traditional Laravel MVC—Fat Controller, Fat Model, and scattered logic—and explains the four benefits gained by adopting DDD: clarifying business rules, resilience to change, testability, and team communication.