FastAPI ASGI پر چلتا ہے، اس لیے ایک request ایک async pipeline سے گزرتی ہے: ASGI server اسے قبول کرتا ہے، middleware اسے لپیٹتا ہے، router ایک path کو میچ کرتا ہے، dependencies حل ہوتی ہیں، آپ کا path operation چلتا ہے، اور return ہونے والی value کو response میں serialize کیا جاتا ہے۔
مراحل
uvicorn (ASGI server)
│ scope + receive/send
▼
ASGI / Starlette middleware ── (CORS, GZip, custom)
▼
Routing ── method + میچ کریں → operation
▼
Dependencies (Depends) ── -deps, security, -setup حل کریں
▼
Path operation 