Module 02 Activity
Scenario
Set the project up so a new developer can clone it and run the tests within a minute.
What you build
A project skeleton with layered directories, typed settings and a suite that passes on a fresh clone with no environment.
Steps
- Create the directory layout with routers, services, clients, models and settings. Write down the rule that services import no FastAPI.
- Move all configuration into one typed settings class with safe defaults, including a fake model as the default.
- Prove a bad value is rejected at startup rather than at first use.
- Pin every dependency exactly, including transitive ones via a lock file.
- Document the four commands, and make the test command work with nothing configured.
- Verify by cloning into a fresh directory with an empty environment.
Evidence to hand in
- The directory layout with the import rule stated.
- The typed settings class.
- The startup rejection of a bad value.
- The lock file.
- The four commands and the fresh-clone verification.
Review checklist
- Services import no FastAPI.
- Configuration is read once into a typed class, not with scattered environment lookups.
- A bad configuration value fails at startup.
- Transitive dependencies are pinned, not just direct ones.
- The tests pass on a genuinely fresh clone with no environment set.
