The project layout we will use

The tour showed you a small main.py that delegates to a router. That split is the start of a pattern we will use for the whole course. Let me show you the full layout so every code example has a home.

The layout of a real FastAPI service

Each file has one job. Changes stay local.

The split matters because when a bug lands, you know which file to open. A validation bug lives in models. A wiring bug lives in the router. A business logic bug lives in the service. And the entry point stays small enough that you can read it in one screen.

Ordering exercise: Order the request through the layout

Loading practice…

AI prompt: Try it: explain the layout

Loading practice…