Stripe
Course Description
Master Domain-Driven Design and bridge the communication gap between users, product managers, and AI. Leverage TypeScript to model entities, value objects, aggregates and bounded contexts. Apply systems thinking to analyze how complex systems relate and constrain each other. Future-proof your systems for AI-assisted development by architecting well-defined domains for effective collaboration with LLMs and agentic coding tools. Develop the shared language and collaboration skills that distinguish senior developers and architects from purely technical contributors.
This course and others like it are available as part of our Frontend Masters video subscription.
Preview
CloseCourse Details
Published: September 15, 2025
Learn Straight from the Experts Who Shape the Modern Web
Your Path to Senior Developer and Beyond
- 250+ In-depth courses
- 18 Learning Paths
- Industry Leading Experts
- Live Interactive Workshops
Table of Contents
Introduction
Section Duration: 11 minutes
- Mike North introduces the course by discussing domain modeling, focusing on translating complex business problems into manageable units of code that can evolve easily. The course explores domain-driven design concepts and practical application through a gardening software example, demonstrating how to model business rules and contain complexity.
Value Objects & Entities
Section Duration: 1 hour, 40 minutes
- Mike explains value objects as data structures without unique IDs, such as RGB colors or distances, often embedded in other resources. In contrast, entities have unique IDs, are mutable, and are stored in databases to support relationships like one-to-one or has-many.
- Mike explains the project setup, including Node.js 23 or higher for module imports. He covers checking out the project, installing dependencies, and running the dev server. He also outlines the app's data flow, from client requests to server processing and UI updates.
- Mike walks through modeling temperature and location data, focusing on user needs and system interactions. He explains entities and value objects, guiding students to consider abstraction and simplicity when structuring data.
- Mike implements a temperature value object using Zod schemas to align type checking and validation for Celsius and Fahrenheit. He also creates a monthly temperature range entity with an ID and links it to a location, emphasizing backend structure and API contracts.
- Mike walks through creating a temperature value object and monthly range entity in the backend. He covers defining columns, handling complex types, setting up relationships, and managing keys, data types, and metadata for proper functionality.
- Mike shows how to parse file data into a model, validate it with a JSON schema, and use a server-side service to create and save location records. He handles async operations and returns the data for UI display, ensuring data integrity throughout.
- Mike handles monthly temperature records in an async function, using a for loop for sequential processing. He creates temperature ranges for each location, links them in the database, and ensures data consistency and type safety.
- Mike explains how to calculate a date based on temperature ranges. He walks through debugging, loading data, adjusting code, and modeling temperature structures for accurate results.
Conversations with Domain Experts
Section Duration: 1 hour, 5 minutes
- Mike discusses building a shared vocabulary with domain experts to improve collaboration. He suggests using visuals, asking open questions, documenting details, and seeking examples to ensure clarity. He also highlights the need to iterate, validate, and summarize concepts to maintain understanding.
- Mike introduces an exercise for students to practice identifying core values and avoid unnecessary details. He encourages focusing on building useful software rather than perfectly replicating reality. The discussion covers seed lifecycles, time-based actions, expiration, and reminders for effective seed management.
- Mike explains how to model plant stages and durations as a value object, using clear names like "plant stage." He focuses on essential seed packet data like time durations and start dates to keep the model user-friendly and relevant.
- Mike implements the seed packet model by adding fields like days to harvest, planting distance, and expiration date. He updates backend entities, ensures proper data flow, and addresses data representation, persistence, and UI integration.
- Mike adds a UI for the back of a seed packet, including planting distance and validation. He converts distances to feet to match the API, adjusts data structures, and uses helpers to keep data consistent.
Bounded Contexts & Domain Modeling
Section Duration: 57 minutes
- Mike explains bounded contexts as distinct areas with shared language and consistency. In a gardening app, this means separating plant data from UI elements like grids. He also introduces an anti-corruption layer to keep communication clean between contexts.
- Mike introduces a domain modeling exercise for a gardening app, focusing on raised beds, plant layouts, and spacing. He defines key entities like gardens, beds, and plants, stressing the need to capture essential elements like positioning and relationships. He also covers seed packets, plant metadata, and future ideas like plant cooperation.
- Mike walks through the implementation of the garden domain models by creating types and entities in the source folder. He focuses on building a workspace schema with zones, item placements, and garden metadata.
- Mike adds a garden bed entity to the server-side model, sets up relationships, and includes width and height. He creates and saves a bed, resolves property errors, updates routing, and handles type issues, showing the iterative process of expanding the app.
- Mike models plants by linking seed packets, plants, and their positions in a bed. He stresses accurate domain modeling, updates code to reflect this, disables redundant code, adjusts relationships, and ensures proper data persistence.
Validation & Aggregates
Section Duration: 40 minutes
- Mike works with the ddd-client-validation(START?) branch, focusing on business rules in the workspace controller. He implements validation for item placement, removal, and movement, returning errors as values instead of throwing them. He also enforces rules like boundary checks and preventing overlaps within the context.
- Mike briefly discusses planting rules like staying in bounds, avoiding overlaps, and limiting beds to 80% full. He then creates a validation to prevent harmful plants from being adjacent, highlighting the need for clear validation logic to support testing and modular code.
- Mike explains aggregates as a way to keep related data consistent in complex systems. He shows how setting clear boundaries helps make sure updates happen together safely. Using the garden example, he demonstrates how picking the right group of data helps keep things reliable, even if other parts of the system aren't perfectly in sync.
Wrapping Up
Section Duration:
- Mike wraps up the course by stressing the value of domain modeling and clear communication with users. Shared language helps developers solve real problems and avoid unnecessary complexity.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops