CourseAI Engineering: The Complete Course · Module 10: Backend Engineering · part 80 of 105
Part 80 · Module 10: Backend Engineering

Lab: Build BrightCart's callable returns service

21 min read·13 Oct 2026
Module 10 · Lab · About 75 minutes · Needs: lessons 1 to 5 of this module (FastAPI fundamentals, advanced FastAPI, auth, architecture, testing)

What you are building

MODULE 10'S PIECE: ONE SERVICE, MANY CALLERS chat widget Dev's tickets Priya's agents request-id middleware, then login and role checks /orders /eligibility /returns /answers ReturnService the 30-day rule, once model fake, then real SQLite repository 11 tests
The finished piece: every caller passes the same middleware and auth (blue = BrightCart's code) into one ReturnService; only /answers calls the model (amber), and a green suite guards it all.

This lab joins the five lessons into Module 10's piece of BrightCart: a web service other systems can call. Dev's ticket system, the chat widget and Priya's agents reach the same returns rules over HTTP. The service is a package on disk: checked settings, a ReturnService over SQLite, JWT login with two roles, four routes, a request-id middleware, health checks and a pytest suite. The running example is Aisha Rahman's order 6150, GlowLine bulbs delivered on 4 October 2026, five days before the course date. The model is a fake until the last step.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.