FastAPI
This folder has no README. Everything inside it is listed below.
Notes
- FastAPI 5 An ASGI framework whose one idea is that the type hints are the contract.
- FastAPI Basics and Setup - Interview Questions 4 FastAPI is a modern, fast web framework for building APIs with Python 3.7+ based on standard Python type hints.
- Pydantic models in FastAPI 6 Pydantic itself is ../pydantic/ — validation modes, settings, the model config.
- Dependencies and injection 5 Depends is FastAPI's defining feature. It resolves a graph per request, caches within it, guarantees teardown, and it is the seam that makes the application…
- Async and performance 6 The event-loop model is 10_fastapi_async.md and the process model is 18_deployment.md.
- Security and authentication 6 The general material — how JWTs fail, what CORS actually protects, password hashing — lives in ../../25_security/ and ../../11_authentication/.
- Testing a FastAPI app 6 The framework is unusually testable, and the reason is dependency injection: every external thing a handler touches arrives through Depends, so every…
- Middleware 5 Code that runs around every request. FastAPI inherits Starlette's model, and the interview question is almost always about ordering or about the one…
- FastAPI project structure 5 If you are asked "what are the two types of FastAPI project structure", the honest answer is that the official documentation does not define two types.
- FastAPI — Common Interview Questions and Answers 4 FastAPI is a modern, high-performance web framework for building APIs with Python 3.7+, based on standard type hints.
- FastAPI and the event loop 6 FastAPI is an ASGI application. It does not own the event loop — Uvicorn does — and your handlers are coroutines scheduled on it.
- Outbound auth, logging and caching 5 The three cross-cutting concerns of calling someone else's API.
- Exception handling 5 The default behaviour is good enough that people never look at it, and then every error in production is a bare 500 with a stack trace in the logs and…
- Writing a client for an external API 7 One class per provider, constructed once, injected.
- FastAPI: sync code in an async route, run_in_threadpool 6 The single most common production gotcha with FastAPI: calling sync code (DB driver, requests, computation) inside an async def route blocks the event loop,…
- BackgroundTasks vs Celery — Decision Matrix 6 FastAPI's BackgroundTasks and Celery both let you run work "after the response is sent".
- response_model — Advanced Patterns 6 FastAPI's response_model does more than schema docs.
- OpenAPI and the generated docs 6 The schema is generated from your type hints, which is FastAPI's headline feature and also why a sloppy signature produces a sloppy public contract.
- Deployment 6 Containers, CI and reverse proxies are covered generally in ../../16_docker/, ../../27_cicd/ and ../../12_protocols/nginx/.