يعمل FastAPI على ASGI، لذا يمر الطلب عبر خط معالجة غير متزامن (async): يستقبله خادم ASGI، ويلفّه الـ middleware، ويطابق الـ router المسار، وتُحَلّ الاعتماديات (dependencies)، ثم تُنفَّذ عملية المسار (path operation) الخاصة بك، وتُسَلسَل القيمة المُعادة إلى الاستجابة.
المراحل
uvicorn (ASGI server)
│ scope + receive/send
▼
ASGI / Starlette middleware ── (CORS, GZip, custom)
▼
Routing ── مطابقة method + → operation
▼
Dependencies (Depends) ── حل -deps والأمان و -setup
▼
Path operation 