Corey Schafer
Creator channel

Corey Schafer

15 recent indexed videos · 5 subscribers

Latest videos

Fresh from Corey Schafer

Showing 12 of 15 kept videos

Guide | 5 months ago

Python FastAPI Tutorial: Full Course for Beginners - Build a Full-Stack Web App

In this video, we'll be learning how to build a full-featured web application from the ground up using the FastAPI framework in Python. This is the complete series compiled into one long video, covering everything from creating your first route all the way through deploying a production-ready application with a custom domain. We'll build both a JSON API for programmatic access and HTML pages that users can browse in the browser, so you'll come away knowing how to use FastAPI for either purpose.

Along the way, we'll set up a database with SQLAlchemy, write Pydantic models for request and response validation, and implement complete CRUD operations. We'll add user registration and login with secure password hashing and JWT authentication, protect routes by verifying the current user, and handle file uploads with image processing and validation. We'll convert our app to async, organize our code with routers, build out frontend forms that connect to the API with JavaScript, and add pagination, password reset flows with background email tasks, and database migrations with Alembic. Toward the end, we'll move from SQLite to PostgreSQL, move our file storage from local disk to AWS S3 with Boto3, write tests with Pytest, and finally deploy the application two different ways... first to a VPS with Nginx and SSL, and then with Docker to a serverless container platform.

Whether you're new to FastAPI or have used it for small projects and want to see how a real production application comes together, this video will give you a solid foundation. Let's get started...

Timestamps: (00:00:00) Getting Started - Web App + REST API (00:23:04) HTML Frontend for Your API - Jinja2 Templates (00:59:53) Path Parameters - Validation and Error Handling (01:36:09) Pydantic Schemas - Request and Response Validation (01:59:51) Adding a Database - SQLAlchemy Models and Relationships (03:01:54) Completing CRUD - Update and Delete (PUT, PATCH, DELETE) (03:37:35) Sync vs Async - Converting Your App to Asynchronous (04:08:58) Routers - Organizing Routes into Modules with APIRouter (04:28:18) Frontend Forms - Connecting JavaScript to Your API (04:56:21) Authentication - Registration and Login with JWT (05:52:58) Authorization - Protecting Routes and Verifying Current User (06:30:32) File Uploads - Image Processing, Validation, and Storage (07:04:13) Pagination - Loading More Data with Query Parameters (07:40:06) Password Reset - Email, Tokens, and Background Tasks (08:38:03) PostgreSQL and Alembic - Database Migrations for Production (09:25:04) AWS S3 and Boto3 - Moving File Uploads to the Cloud (10:11:44) Testing the API - Pytest, Fixtures, and Mocking External Services (11:33:16) Deploy to a VPS - Security, Nginx, SSL, and Custom Domain (13:04:21) Deploy with Docker - Serverless Containers and Custom Domain

The code from this video can be found here: https://github.com/CoreyMSchafer/FastAPI-Full-Course

Full FastAPI Course Playlist (Individual Videos): https://www.youtube.com/playlist?list=PL-osiE80TeTsak-c-QsVeg0YYG_0TeyXI

✅ Support My Channel Through Patreon: https://www.patreon.com/coreyms

✅ Become a Channel Member: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal: https://goo.gl/649HFY

✅ Cryptocurrency Donations: Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3 Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33 Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend: https://www.amazon.com/shop/coreyschafer

▶️ You Can Find Me On: My Website - http://coreyms.com/ My Second Channel - https://www.youtube.com/c/coreymschafer Facebook - https://www.facebook.com/CoreyMSchafer Twitter - https://twitter.com/CoreyMSchafer Instagram - https://www.instagram.com/coreymschafer/

#Python #FastAPI

Recent video details

Indexed videos from Corey Schafer

Python FastAPI Tutorial: Full Course for Beginners - Build a Full-Stack Web App

Guide | 5 months ago

In this video, we'll be learning how to build a full-featured web application from the ground up using the FastAPI framework in Python. This is the complete series compiled into one long video, covering everything from creating your first route all the way ...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 19): Deploy with Docker - Serverless Containers and Custom Domain

Guide | 5 months ago

In this video, we'll be learning how to deploy our FastAPI application using Docker and Google Cloud Run. We'll containerize our app by writing a multi-stage Dockerfile, set up a serverless PostgreSQL database with Neon, deploy our container to Cloud Run, a...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 18): Deploy to a VPS - Security, Nginx, SSL, and Custom Domain

Guide | 6 months ago

In this video, we'll be learning how to deploy our FastAPI application to a VPS (Virtual Private Server) so that it's live and accessible on the internet. We'll walk through the entire process, starting with a fresh Ubuntu server and hardening it with SSH k...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 17): Testing the API - Pytest, Fixtures, and Mocking External Services

Guide | 6 months ago

In this Python FastAPI tutorial, we will learn how to test our FastAPI application using Pytest, HTTPX's AsyncClient, and mocking tools like Moto. We'll start by setting up our test structure and fixtures in conftest.py, including a transactional rollback p...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 16): AWS S3 and Boto3 - Moving File Uploads to the Cloud

Guide | 6 months ago

In this video, we'll be learning how to make our file storage production-ready by moving uploaded images from local disk into AWS S3. We'll walk through creating an S3 bucket, configuring the bucket policy and IAM permissions, and integrating boto3 into our...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 15): PostgreSQL and Alembic - Database Migrations for Production

Guide | 6 months ago

In this video, we'll be making our database setup production-ready by moving from SQLite to PostgreSQL and introducing Alembic for database migrations. We'll cover how to install and configure PostgreSQL locally, how to replace SQLite and create_all with a ...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 14): Password Reset - Email, Tokens, and Background Tasks

Guide | 6 months ago

In this video, we'll be implementing a complete password reset flow in our FastAPI application. We'll learn how to send emails asynchronously using aiosmtplib, use FastAPI's BackgroundTasks for non-blocking operations, and create secure reset tokens followi...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 13): Pagination - Loading More Data with Query Parameters

Guide | 7 months ago

In this video, we'll be learning how to add pagination to our FastAPI application. Right now, our app returns all posts at once, which doesn't scale well as data grows. We'll fix that by adding skip and limit query parameters to our API, using SQLAlchemy's ...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 12): File Uploads - Image Processing, Validation, and Storage

Guide | 7 months ago

In this video, we'll be learning how to handle file uploads in FastAPI using UploadFile. We'll allow users to upload profile pictures by building an image processing utility with Pillow, adding proper validation for file type and size, and saving processed ...

Open this video on Corey Schafer

Abandoned Pups after being taken home and given warm bath. Happy and healthy. Will find good homes.

Short | 8 months ago

Somebody dropped off this crate of puppies on the side of the road. Wouldn't have survived the night. They must have been there for a while because they were covered in their own mess. Took them home to bathe them and get them warm. They're happy and playin...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 11): Authorization - Protecting Routes and Verifying Current User

Guide | 8 months ago

In this video, we'll be learning how to protect our FastAPI routes with proper authorization. We'll build a reusable get_current_user dependency that validates tokens and returns the authenticated user, remove the hardcoded user_id from our schemas and fron...

Open this video on Corey Schafer

Python FastAPI Tutorial (Part 10): Authentication - Registration and Login with JWT

Guide | 8 months ago

In this video, we'll be learning how to add authentication to our FastAPI application. We'll implement user registration with secure password hashing using Argon2, build a login system using JWT tokens, and manage configuration with pydantic-settings. We'll...

Open this video on Corey Schafer