FastAPI Masterclass

Build modern, high-performance APIs and server-side applications with Python + FastAPI. No backend experience required!

  • 0.0 (0 Reviews)
  • 0 Students
  • 181 Lessons
  • Boris Paskhaver

Course Overview

Welcome to FastAPI Masterclass, a comprehensive introduction to backend development in Python with FastAPI.

FastAPI is a Python framework for building fast, modern server-side applications and APIs. It  has exploded in popularity in the last few years. Today, it has more than 100,000 stars on GitHub and more daily downloads than Django and Flask on PyPi. It powers applications in companies like Netflix, Microsoft, Uber, OpenAI, and Amazon.

One of FastAPI’s greatest strengths is its flexibility. Unlike larger frameworks that impose a specific structure, FastAPI gives developers the freedom to choose how their applications are organized. You can customize the folder structure, database, ORM, authentication system, validation rules, testing strategy, and architecture.

No previous backend development experience is required. This course follows a linear progression, beginning with the fundamentals and gradually advancing to topics such as authorization, authentication, testing, architecture, and more.

Topics covered:

  • Clients and servers

  • Routes and HTTP methods

  • Path parameters

  • Query parameters

  • Debugging with Visual Studio Code

  • Cookies and Headers

  • FastAPI Validator Functions (Path, Query, Cookie, Header, and More)

  • Dependencies (Functions, Classes, and Other Callables) and Dependency Injection (DI)

  • Object-Relational Mappers (ORM)

  • Database Queries

  • Database Migrations

  • Codebase Structure

  • Password hashing

  • JSON Web Tokens (JWTs)

  • Authentication

  • Authorization

  • and more!

In addition to FastAPI, the course covers many helpful libraries and tools from the modern Python ecosystem including:

  • uv

  • Pydantic

  • SQLModel

  • SQLAlchemy

  • SQLite 3

  • Alembic

The first part of the course offers a step-by-step walkthrough of a rent-a-room project inspired by home-stay platforms such as Airbnb. We begin from scratch and gradually incorporate all the critical components of a modern FastAPI application.

After the main project, the course explores common backend topics in dedicated sections. These include database migrations, password hashing, JWT-based authentication, authorization, application architecture, and automated testing.

By the end of FastAPI Masterclass, you will not only understand the syntax and features of FastAPI but also understand the fundamental backend principles that apply across programming languages, libraries, or frameworks.

I'm excited to teach you everything I know about this powerful framework, and I look forward to seeing you in the course!

See more

FAQ

FAQ area empty

Course curriculum

15 chương 181 bài học 28 giờ 57 phút 7 bài học thử miễn phí
Chương 1 Getting Started
Chương 2 Servers and Routes
Chương 3 Path Parameters, Static Files, and Debugging
  • Define an Index Route for Rooms 5:35
  • Path Parameters 8:57
  • Error Responses 8:05
  • The 404 Not Found Status Code 5:54
  • Route Order 4:08
  • Serving Static Files from Endpoints 7:10
  • FastAPI VSCode Extension 2:10
  • Setting Up VSCode Debugger 2:40
  • Using VSCode Debugger 13:18
  • Section Review 9:04
Chương 4 Query Parameters and Validation
  • Query Parameters 5:30
  • Adding a Query Parameter 11:23
  • Optional Query Parameters 10:37
  • The Annotated Type 12:44
  • The Query Type 6:19
  • Add Query Validations for Price 2:45
  • The AfterValidator Function 8:22
  • The title and description Parameters 1:33
  • Extracting Types to Variables 9:02
  • Use Pydantic Model for Query Parameters 18:40
  • One More Optimization 4:51
  • The examples Parameter 1:10
  • Using Tags to Group Routes 4:59
  • Route Decorator Options 3:30
  • Section Review 12:45
Chương 5 Cookies and Headers
  • Cookies and Headers 8:49
  • Set Cookies 10:16
  • Read Cookies on the Server 9:09
  • Use Pydantic Model for Cookies 8:14
  • Header Parameters 6:10
  • Use Pydantic Model for Headers 2:36
  • Section Review 6:24
Chương 6 Databases and ORMs
  • What is an ORM? 13:04
  • Create Room Model 4:20
  • Define Room Model Fields 10:44
  • Create Database Engine 9:24
  • Create Database 4:55
  • Initialize Database at App Startup 9:12
  • Launch App and View Database 2:58
  • Dependency Injection and the Depends Function 12:37
  • Create SessionDep Type 7:20
  • Executing Sample SQL Query 5:11
  • Section Review 17:55
Chương 7 Database Operations
  • Add POST Request to Create a Room 11:56
  • Test the Rooms Creation Endpoint 10:21
  • Get All Rooms 7:08
  • Filtering with where Method 11:48
  • Optimizing the Get Rooms Queries 8:37
  • Limiting and Offsetting Results 13:01
  • Get Room by Id 8:12
  • Update Room with PATCH Request 10:15
  • Issues with our Room Model 13:51
  • Delete a Room 9:35
  • Creating Multiple Pydantic Models for a Room 13:59
  • Updating Room Creation Route with New Models 19:36
  • Updating Get Room Routes with New Models 5:09
  • The model_dump Method and exclude_unset Parameter 20:48
  • Updating Delete Room Route with New Models 3:23
  • Reusable Dependencies with Depends Function 9:33
  • Dependency Caching 2:54
  • Section Review 30:59
Chương 8 App Organization
  • Starting to Breaking Up Logic across Files and Folders 9:44
  • The APIRouter Class 14:35
  • Including the APIRouters 2:31
  • Configuring the APIRouter with Path Prefix and Tags 5:02
  • Global Dependencies 7:53
  • Dependencies in Route Decorator Methods 11:22
  • Organizing Code by Technical Layer 24:51
  • Organizing Code by Feature 12:33
  • Section Review 10:40
Chương 9 Async Operations
  • Asynchronous Code 15:55
  • Updating the Database Layer to Async 10:28
  • Updating the Lifespan Function to Async 1:21
  • Updating the Routes to Async 15:21
  • Section Review 9:29
Chương 10 Database Relationships
  • Intro to Database Relationships 6:04
  • Create Booking Model 14:02
  • The Relationship Function 11:25
  • The back_populates Parameter 10:12
  • Create Bookings Router 12:33
  • Testing Booking Routes 6:02
  • Join Table 3:30
  • Create User Model 13:14
  • Extracting Dependencies 7:30
  • Create Users Router 8:57
  • Testing Creating a Booking with User and Room 7:47
  • Eager Loading with selectinload 14:26
  • Query Options 16:23
  • Eager Loading with joinedload Function 9:31
  • Extracting Errors 6:13
  • Cascade Delete 12:56
  • SET NULL on Delete 14:52
  • Querying Booked Rooms with the exists Function 13:33
  • Querying Unbooked Rooms (and the Tilde Symbol) 2:30
  • Querying for a User's Unique Rooms 15:04
  • Counting Bookings per Room 15:30
  • Filtering Booked Rooms by Date Range 11:04
  • Section Review 19:40
Chương 11 Database Management
  • Database Migrations 8:12
  • Project Setup 6:40
  • Initializing Alembic 8:57
  • Generating the First Migration 8:12
  • Applying the Migration 4:17
  • Evolving the Database Schema 11:14
  • Modifying the Migration Template 2:23
  • Rolling Back Migrations and Viewing Migration History 7:02
  • Transactions I 16:57
  • Transactions II 4:48
  • Database Indexes 7:21
  • Section Review 11:07
Chương 12 Authentication
  • What is authentication? 12:29
  • Project Setup 2:55
  • Password Hashing I 12:52
  • Password Hashing II 13:14
  • The User Model 7:16
  • User Registration 10:13
  • The Login Endpoint 27:20
  • JWT Tokens 14:07
  • How JWT Security Works 13:35
  • Secret Keys and Environment Variables 11:55
  • Creating the JWT 13:34
  • Testing JWT Creation 5:06
  • Returning JWT on Login 3:14
  • Token Expiration 7:28
  • Decoding JWT Tokens 6:00
  • The OAuth2PasswordBearer Class 10:50
  • The get_current_user Dependency 10:44
  • Protecting Routes 11:58
  • Using Routers for Authenticated Routes 8:23
  • Refresh Tokens 15:05
  • The Refresh Token Endpoint 20:16
  • JWT Invalidation 8:57
  • Password Reset - Requesting a Reset 24:10
  • Password Reset - Confirming a Reset 11:53
  • Testing the Password Reset 6:32
  • Section Review 27:42
Chương 13 Authorization
  • Role-Based Access Control 12:18
  • Creating Admin Routes 14:38
  • OAuth2 Scopes 9:15
  • Scope-Based Route Protection 17:16
  • Testing Scopes 7:35
  • Section Review 8:34
Chương 14 Testing [IN PROGRESS]
  • Project Setup and Walkthrough 19:37
  • The TestClient Class 19:05
  • The Session Fixture 11:57
  • The Client Fixture 9:22
  • Using the Client Fixture 3:49
  • Testing POST Endpoints 12:17
  • Testing GET Endpoints 14:05
  • Testing Query Parameters 10:54
  • Testing PATCH Endpoints 5:13
  • Testing DELETE Endpoints 3:24
  • Database Fixtures 16:54
  • Adding Cookie Endpoints 3:07
  • Testing Cookies 6:56
  • Testing User Registration, Login and Protected Endpoints 14:04
  • Testing Role-Based Access 5:02
  • Organizing Tests into Folders + Multiple Conftest Files 5:17
  • Adding an External API Call 11:47
  • Overriding Dependencies 9:13
  • Mocking the HTTP Client 30:45
Chương 15 Congratulations
  • Complete Slide Decks

Requirment

  • Intermediate knowledge of Python (control flow, data types, functions/methods, classes, imports, etc)

  • Terminal experience

  • Text editor (we use Visual Studio Code in the course)

Outcomes

  • Build and run FastAPI applications with endpoints that accept requests and return responses

  • Use SQLModel and SQLAlchemy to define domain models and map them to database tables

  • Use an object-relational mapper (ORM) to perform CRUD (create, read, update, delete) operations with a database

  • Utilize Pydantic to validate and control the shape of data entering and leaving an API

  • Build an authentication and authorization system from scratch with password hashing, JWTs, roles, and scopes

Instructor

...
Boris Paskhaver

0.0

  • ... 0 Student
  • ... 5 Courses
  • ... 0 review

View Details

Reviews

Rate this course :

Remove all