How I Used Claude to Design a Clean Architecture

When I started this project, I knew I wanted to showcase Event Sourcing, CQRS, Clean Architecture, TDD, and DDD. But knowing the concepts and actually putting them together in a real project are two very different things.

The Problem: From Theory to Real Life

I understood each concept on its own. But when I tried to design the full architecture, I quickly ran into big questions:

  • Should budget items belong inside the Project aggregate or in a separate bounded context?
  • Do I need multi-tenancy everywhere with a workspaceId?
  • How do you actually implement saga choreography—not just explain it?

I needed guidance from someone with experience… so I asked Claude.

The Collaboration

Instead of asking it to “build everything,” I used Claude as a thinking partner.

The conversation went a bit like this:

Claude: “What is a Project Plan in your domain?” Me: “It’s a video planning with a timeline and status…”

Claude: “Can participants exist without a project?” Me: “No.”

Claude: “Does the workspace have business rules?” Me: “Yes! Free users get 2 projects max; premium users get unlimited.”

Step by step, we uncovered the real domain and its implications.

For example:

  • Budget items stayed inside the Project aggregate because changing them affects project invariants.
  • Participants stayed inside too, because their acceptance/decline changes the project state.
  • Workspace became its own bounded context with subscription rules, enforced with a saga.

The Final Architecture

What came out of this process was a real, well-defined architecture:

  • 4 bounded contexts
  • 3 sagas
  • Clear aggregate boundaries

You can see the full details in PLAN.md.

The system includes:

  • Workspace Context: Multi-tenancy + subscription limits
  • Ideation Context: Workspace-level brainstorming
  • Project Planning (Core): Video planning + budget handling
  • Notification Context: Email/SMS when a project is ready

Each context has:

  • Clear aggregates and invariants
  • Event schemas
  • CQRS with projections
  • TDD examples

Why Share This?

Because architecture is learned by doing, not just by reading. If you’re learning DDD or Clean Architecture and feel overwhelmed, trust me—you’re not alone. Using AI as a guide (not just a code generator) can really help you think through the hard parts.