One application, three architectures
The same small shop, organized three different ways. Switch between them and watch the components move. An architecture is nothing more than a way of grouping code, plus a rule about which group may depend on which.
Play a scenario
A request enters at the top and travels straight down: the controller parses it, the service decides, the repository stores. Each step only knows the next one.
Or test a dependency
Click a component in the diagram, then a second one. You will see whether that import is allowed in this architecture, and why.
An arrow means "depends on" (imports).
The rule: Dependencies point down. A layer may use the layer directly below it and nothing above it.
Full lessonThe lessons
Each pattern on its own page: the rule, what it buys you, what it costs.
Layered Architecture
Stack the code by technical role. Every layer only talks to the one below it.
Start lessonVertical Slice Architecture
Cut the code by feature. Everything a feature needs lives together, and slices leave each other alone.
Start lessonClean Architecture
Put the business rules in the center. Every dependency points inward.
Start lessonProtect your codebase now
Two minutes to set up: the CLI, the hook for your agent, and the GitHub Action for every pull request. It runs locally, so your code never leaves your machine.
