inflearn logo

Mastering FastAPI Backend Development from Start to Finish - Pydantic v2, OAuth 2.0, SQLAlchemy

This course consists of 41 lessons and approximately 22 hours of training on designing and implementing backend APIs with FastAPI. FastAPI is a framework that is easy to get started with. Skim the documentation, write a few lines, and your API is up and running. The problem comes afterward. If you don’t know how a request travels to reach a function parameter, when dependencies are cleaned up, or where exceptions are caught, you can quickly get stuck as soon as things become even slightly more complex. This course spends time tracing how things work internally. We begin with the development environment. You’ll learn both conda and venv, send requests using the VS Code REST Client and Swagger UI, and become familiar with the structure of HTTP requests and responses. Next, we cover the difference between path parameters and query parameters, explaining why 422 errors occur in connection with type checking. Pydantic is the area explored most deeply in this course. After covering everything from scalar types to dates, UUIDs, Decimal, Enum, and Literal, we move on to BaseModel. We use Field() to define constraints, validate single and multiple fields with @field_validator, and examine the differences between the before and after behaviors of @model_validator. Since the course is based on Pydantic v2, you can apply the latest syntax directly in real-world projects. The middle section focuses on structure and dependency injection. We cover how to split files using APIRouter, how to use functions and classes as dependencies, Sub-dependencies, and decorator-level dependencies in sequence. Four lessons are dedicated to yield. We delve into how generators work, how exceptions are passed back up the call stack with raise, and how exceptions can be injected at the yield point using throw(). Understanding how resource cleanup works in dependencies that include yield makes DB session management much clearer. The latter part covers authentication and databases. We organize the concepts of OAuth 2.0 and its four Grant Types, then implement JWT issuance and verification, the internal execution logic of OAuth2PasswordBearer, and authorization control using Security() and scopes. We then configure Google, Kakao, and Naver clients ourselves and add social login using the Authorization Code Grant flow. Finally, we cover the SQLAlchemy ORM, including the URL structure of create_engine, the roles of the Dialect and DBAPI, transactions, sessions, and model and table creation. This course is suitable for anyone who wants to understand not only "working code" but also "why it works that way.&quot

1 learners are taking this course

Level Basic

Course period Unlimited

FastAPI
FastAPI
Python
Python
REST API
REST API
pydantic
pydantic
SQLAlchemy
SQLAlchemy
FastAPI
FastAPI
Python
Python
REST API
REST API
pydantic
pydantic
SQLAlchemy
SQLAlchemy
No questions have been posted yet.
Post the first question and grow with Inflearn!

Limited time deal

$42.90

13%

$49.50