Skip to course content
Free FastAPI backend course

FastAPI for AI Backend Development

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

  1. Create the directory layout with routers, services, clients, models and settings. Write down the rule that services import no FastAPI.
  2. Move all configuration into one typed settings class with safe defaults, including a fake model as the default.
  3. Prove a bad value is rejected at startup rather than at first use.
  4. Pin every dependency exactly, including transitive ones via a lock file.
  5. Document the four commands, and make the test command work with nothing configured.
  6. Verify by cloning into a fresh directory with an empty environment.

Evidence to hand in

Review checklist