Skip to content

Python & FastAPI — learning path ​

Python tooling with uv and Ruff, typing and Pydantic v2, asyncio; FastAPI routing, validation, dependency injection, routers and project structure, exceptions and streaming responses; SQLAlchemy 2 / SQLModel, queries, Alembic migrations, MongoDB; authentication with JWT and OAuth2 scopes, testing with pytest, production with Uvicorn; two end-to-end projects (rooms and bookings, AI-powered services). Built from two course outlines the owner supplied.

Legend ​

BadgeMeaning
Must-knowasked in almost every interview; you meet it at work constantly
Importantfrequent; expected at senior level
Good to knowextra depth that sets you apart
WIP / Todoshown next to a chapter only while it is still being written

How to read this page. Groups are in reading order and each one builds on the previous; short on time, take the Must-know chapters of every group first. The last column says in one line what the chapter gives you. Every chapter ends with a Self-check: questions & answers block (open/close all, filter by level); all questions are collected in the Interview Q&A hub.

Chapters ​

19 chapters · 10 complete · 5 in progress · 4 not written yet

Python for Backend ​

ChapterLevelWhat you learn
Python Project ToolingMust-knowA Python project is four decisions made once: which interpreter (CPython from python.org, a distro, pyenv or a uv-managed build), which isolated environment holds its packages (a virtual environment, .venv)…
Typing & Pydantic v2Must-knowPython's type hints are metadata that the interpreter stores and ignores; static checkers (mypy, pyright) read them before the code runs, and Pydantic reads them at runtime to build a validator in Rust…
Async PythonMust-knowasyncio runs many coroutines on ONE thread: an async def function returns a coroutine object, a Task wraps it and puts it on the event loop, and an await on something that is not ready yet (a socket read…

FastAPI Core ​

ChapterLevelWhat you learn
FastAPI FundamentalsMust-knowFastAPI is a Starlette application (an ASGI app) that turns ordinary type-annotated Python functions into HTTP endpoints: the decorator (@app.get, @app.post …) registers a path operation…
Request ValidationMust-knowEvery value a FastAPI endpoint receives comes from one of four places in the HTTP request: the path, the query string, the header block (cookies included) or the body (JSON…
Dependency Injection with DependsMust-knowFastAPI's dependency injection is a request-scoped resolver built into the router.
APIRouter & Project StructureMust-knowA FastAPI service outgrows one main.py quickly.
Exceptions & ResponsesImportantEvery FastAPI response is produced in one of two ways: your path operation returns a value (or a Response object), or something raises.

Data Layer ​

ChapterLevelWhat you learn
SQLAlchemy 2 & SQLModelMust-knowSQLAlchemy is Python's SQL toolkit and object-relational mapper.
Queries in Practice WIPImportantA list endpoint is a filter, a sort, a page and a count.
Alembic Migrations, Transactions & Indexes fr…Must-knowAlembic is the migration tool of SQLAlchemy.
MongoDB with FastAPI TodoGood to knowto be written.

Auth, Testing & Production ​

ChapterLevelWhat you learn
Authentication in FastAPI WIPMust-knowAuthentication in FastAPI is a handful of dependencies around three stores of secrets.
Authorization TodoImportantto be written.
Testing FastAPI WIPMust-knowA FastAPI test suite is pytest plus three FastAPI-specific seams.
FastAPI in Production WIPMust-knowA FastAPI app is an ASGI callable; in production something has to run it, and that something decides most of how the service behaves under load and during a deploy.
Background Tasks, Caching & External APIs WIPImportantA FastAPI endpoint rarely works alone: it sends an e-mail, calls a payment provider, reads exchange rates from someone else's API, caches the answer and receives webhooks back.

Projects ​

ChapterLevelWhat you learn
Project TodoMust-knowto be written.
Project TodoImportantto be written.

Built by Morteza Negahi