Module 02 Summary
What this module established
Routers handle HTTP, services hold the logic, and services import no FastAPI - that single constraint is what makes the logic callable from a worker, a job or a test without a request object.
Carry forward
- Declare settings as a typed class read once at startup, with safe defaults. Configuration errors then fail at boot rather than on a request at 3am.
- Never use
--reloadin production, and remember that multiple workers mean multiple copies of anything held in memory. - Pin exactly, including transitive dependencies. Otherwise the build that passed CI is not the build that deployed.
Before moving on
Move on when a fresh clone with an empty environment installs and passes its tests.
