Lesson 2: The parts a real FastAPI service needs
18 min read·13 Oct 2026
Module 10 · Lesson 2 · About 50 minutes · Needs: Lesson 1 (routes, Pydantic models, TestClient); Module 1 (async and await)The situation
Lesson 1 gave BrightCart's answer engine a front door. Dev now lists what the door still lacks. The chat widget wants the answer word by word, not after a pause. Support wants a request id on every error. The platform team wants health URLs. Priya wants customers to upload a photo of damaged goods. And one heavy client could flood the service.
This lesson adds each piece to one small app and tests it with TestClient, with no server. The running example is Aisha Rahman asking about order 5521: "Can I still return my robot vacuum?" A fake streaming model answers, so nothing here calls a hosted model.