gourses

← Volver a la búsqueda

Clean Architecture & Domain-Driven Design in NestJS

udemy · Desarrollo · ⭐ 4.96 (19 reseñas) · Intermediate · en · ⏱ 12,5 h

Impartido por Michael Guay · 285 alumnos

49.99 USD

Entra en tu cuenta para guardar este curso y volver a él cuando quieras.

Comparar este curso
Ver curso en udemy

Enlace de afiliado: podemos cobrar comisión, sin coste extra para ti. Más información

Descripción

Most NestJS tutorials stop at controllers calling services calling a database. This course is about what comes after that: how to structure a real backend so business logic lives in one place, is fully unit-testable, and doesn't fall apart when requirements change. Together we build a complete e-commerce system from scratch - products, customers, orders, and payments - as four autonomous bounded contexts, applying Domain-Driven Design and Clean Architecture patterns to every layer. What you'll learn to build: • Rich domain models with aggregates, entities, and value objects — where invalid state is unrepresentable, and every state change goes through behavior methods • CQRS with commands, queries, and handlers using @nestjs/cqrs • Domain events emitted from business logic — and sagas that orchestrate workflows across bounded contexts (order placed → payment created → order confirmed) • Ports and adapters: swap PostgreSQL (Drizzle) for MongoDB, or console notifications for real email notifications via Mailtrap, by changing a single line • Child entities with their own state machines whose status drives the parent aggregate • Real integrations: Stripe payments with webhook handling & Mailtrap email notifications • A clean REST API layer with DTOs and validation that dispatches commands and never touches domain objects directly Every concept is introduced in order: value objects first, then entities, aggregates, collection invariants, and finally cross-context orchestration. You never see a pattern before you have the foundation for it.

Lo que aprenderás

  • Structure a NestJS backend into bounded contexts with clean domain, application, infrastructure, and presentation layers
  • Design rich domain models with aggregates, entities, and value objects that make invalid state unrepresentable
  • Implement CQRS with commands, queries, and handlers using @nestjs/cqrs
  • Emit domain events from business logic and orchestrate workflows across bounded contexts with sagas
  • Apply ports and adapters to swap PostgreSQL for MongoDB — or one notification provider for another — without touching business logic
  • Enforce business invariants and state machines inside aggregates instead of scattering rules across services
  • Integrate Stripe payments and webhooks behind clean architecture boundaries
  • Implement real world email notifications with Mailtrap

Requisitos

  • Comfortable with TypeScript — classes, interfaces, and async/await
  • Basic NestJS familiarity: modules, controllers, and providers
  • Node.js installed and a running PostgreSQL instance (a free local install or Docker container is fine)
  • No prior DDD or Clean Architecture experience needed — every pattern is taught from first principles