Ssali Jonathan
Ssali Jonathan
  • 352
  • 990 582
FastAPI Beyond CRUD Full Course - A FastAPI Course
In the "FastAPI Beyond CRUD" course, you'll move beyond the basics and dive into advanced API development with FastAPI. This course is perfect for developers who are already comfortable with CRUD operations and are eager to explore the powerful features that FastAPI has to offer. You'll start by learning how to set up a FastAPI project and run a simple web server, before quickly progressing to more advanced topics like building REST APIs, managing path and query parameters, and working with databases using SQLModel. Additionally, you'll learn how to manage settings with Pydantic, organize your API with routers, and implement asynchronous SQLModel connections.
As the course progresses, you'll learn about key topics in user authentication and application security, including role-based access control, JWT authentication, and hashing passwords. The intricacies of middleware, dependency injection, and error handling-including the development of unique exceptions and handlers-will also be covered in detail. The course goes one step further and explains how to utilize Celery and Redis to manage background processes, add email support for user authentication, and use Flower to monitor Celery Workers.
The series includes parts on API documentation with SwaggerUI and ReDoc and thorough testing methodologies to help you ensure your APIs are suitable for production. With tools like Unittest Mock and Pytest, you'll become an expert at unit testing, while Schemathesis will let you investigate document-driven testing. Lastly, you will discover how to publish your FastAPI program on websites like Render.com.
You will have a thorough understanding of advanced FastAPI features by the end of the course, empowering you to create high-performance, scalable, and secure APIs that do much more than basic CRUD tasks.
SOURCE CODE:
github.com/jod35/fastapi-beyond-CRUD
CONTRIBUTE TO THE DOCS:
github.com/jod35jon/fastapi-beyond-crud-docs
COURSE WEBSITE:
jod35.github.io/fastapi-beyond-crud-docs/site/
PLEASE DONATE TO THE CHANNEL THROUGH:
BUY ME A COFFEE:
buymeacoffee.com/jod35
PATREON:
www.patreon.com/jod35
You can also consider Becoming a member of this channel.
FOLLOW ME:
X:
x.com/jod35_
GITHUB:
github.com/jod35
Timestamps:
(00:00:00) Introduction
(00:01:00) Project set up
(00:07:30) Build a simple web server
(00:10:45) Run the server with FastAPI CLI
(00:14:11) Path parameters
(00:17:23) Choosing an HTTP client
(00:20:58) Query Parameters
(00:24:40) Using Path and Query parameters
(00:26:51) Optional Query parameters
(00:31:48) Request Body
(00:39:11) Reading and setting headers
(00:49:43) Build a REST API on a Python List
(01:23:37) Organizing API Paths with Routers
(01:38:22) Databases With SQLModel
(01:42:33) Setting up a database
(01:44:13) Settings management with Pydantic settings
(01:53:38) Async SQLModel set up
(01:58:38) Database connection with lifespan events
(02:10:02) Creating a database model with SQLModel
(02:20:00) Creating database tables
(02:27:08) CRUD With SQLModel
(02:29:48) Separate CRUD logic using service classes
(02:55:53) Intro to Dependency Injection
(03:01:20) Use service methods in API path handlers
(03:33:35) Create the user auth model
(03:42:09) Database Migrations With Alembic
(03:59:57) User Account Creation
(04:18:55) Password hashing with passlib
(04:25:42) User Account Creation endpoint
(04:42:57) Intro to JWT Authentication
(04:48:29) PyJWT Set Up
(05:01:13) User Login Endpoint
(05:13:59) HTTP Bearer Authentication
(05:33:14) Regaining Access with refresh tokens
(05:50:04) Revoking Tokens using Redis
(06:07:39) Role-Based Access Control
(06:09:45) Get the currently authenticated user
(06:20:25) Adding roles to the user model
(06:26:55) Creating the Role Checker dependency
(06:39:24) Handling Model And Schema Relationships
(07:05:53) More Model And Schema Relationships
(07:59:58) Error Handling
(08:04:06) Create custom API Exceptions
(08:18:14) Creating exception handlers for those exceptions
(08:23:26) Register Error handlers on the app
(08:33:25) Intro to Middleware
(08:36:54) Creating a custom logging middleware
(08:53:28) Another middleware example
(08:59:36) Using Custom ASGI middleware with FastAPI
(09:00:21) Adding CORS Middleware
(09:03:34) Adding Trusted Hosts
(09:05:04) Adding Email support
(09:06:39) Setting Up FastAPI-Mail
(09:21:46) Sending your first email
(09:31:21) User account verification
(10:07:51) Password Resets
(10:40:38) Background Tasks
(10:43:00) FastAPI Background Tasks
(10:45:44) Background Tasks with Celery and Redis
(11:16:17) Celery Monitoring With Flower
(11:23:48) API Documentation with SwaggerUI And Redoc
(11:36:02) API Testing
(11:37:10) Unit testing with Unittest Mock And Pytest
(12:01:27) Document-driven Testing with Schemathesis
(12:09:17) Deployment On Render.com
Переглядів: 5 273

Відео

Deploying FastAPI, PostgreSQL, Celery & Redis on Render - FastAPI Beyond CRUD (Part 23)
Переглядів 39214 днів тому
In this video, we’ll walk through deploying a FastAPI application on Render: This application comprises FastAPI, PostgreSQL, Celery, and Redis. You’ll learn how to set up FastAPI , PostgreSQL for reliable database management, and Redis to enhance Celery as an efficient task queue for background processing. We’ll cover configuration tips, deployment steps, and best practices to ensure a smooth a...
Get Ready For Pycon Uganda 2024 feat @pyconuganda
Переглядів 37214 днів тому
PyCon Uganda is an annual tech conference that celebrates and promotes the use of the Python programming Language within Uganda and Beyond! #pyconuganda2024 Pycon website: ug.pycon.org/2024 Follow Pycon Uganda On X: x.com/pyconuganda Subscribe To Pycon Uganda UA-cam www.youtube.com/@pyconuganda
API Testing With Unittest Mock, Pytest & Schemathesis - FastAPI Beyond CRUD (Part 22)
Переглядів 33821 день тому
In this video, we'll cover how to test your API using Unittest Mock, Pytest, and Schemathesis. We'll start with Unittest Mock, which helps you create fake API responses for testing. Next, we’ll use Pytest, a user-friendly framework for writing and running tests. Finally, we’ll explore Schemathesis, which automatically generates and runs tests based on your API's specification to ensure everythi...
API Documentation With Swagger And Redoc - FastAPI Beyond CRUD (Part 21)
Переглядів 30521 день тому
In this video, we explore API documentation with FastAPI, we look at how it automatically generates detailed API docs using Swagger UI and ReDoc. FastAPI leverages Python type hints and Pydantic models to produce an OpenAPI specification, which forms the backbone of the documentation. We’ll explore how Swagger UI offers an interactive interface for your API endpoints directly in the browser, wh...
Background Tasks with FastAPI Background Tasks and Celery + Redis - FastAPI Beyond CRUD (Part 20)
Переглядів 72221 день тому
In this video, we dive deep into boosting your FastAPI application by offloading time-consuming tasks to the background. We'll start by exploring FastAPI's built-in background tasks, demonstrating how to execute functions asynchronously without blocking the main thread. Next, we'll introduce Celery, a powerful task queue system, to handle more complex background jobs. You'll learn how to integr...
Handling Password Resets - FastAPI Beyond CRUD (Part 19)
Переглядів 237Місяць тому
In this video, we configure password resets for our FastAPI application using email verification. Additionally, we enforce access restrictions to ensure only users with verified accounts can log in. #python #fastapi #apidevelopment SOURCE CODE: github.com/jod35/fastapi-beyond-CRUD COURSE WEBSITE: jod35.github.io/fastapi-beyond-crud-docs/site/chapter14/ PLEASE DONATE TO THE CHANNEL THROUGH: BUY ...
User Account Verification Via Email - FastAPI Beyond CRUD (Part 18)
Переглядів 479Місяць тому
In this video, we explore integrating email support into our application using FastAPI-Mail. We start by implementing email-sending capabilities and proceed to verify user accounts. We also look at how we can securely pass data in URLs using the itsdangerous Python library. #python #fastapi #apidevelopment SOURCE CODE: github.com/jod35/fastapi-beyond-CRUD COURSE WEBSITE: jod35.github.io/fastapi...
Middleware, Setting Up Custom Logging And CORS - FastAPI Beyond CRUD (Part 17)
Переглядів 748Місяць тому
In this video, we explore the important concept of middleware in FastAPI. Middleware acts as a bridge between incoming requests and application logic, allowing for custom processing at various stages of request handling. Throughout the tutorial, we not only establish a custom logger for our application but also implement middleware to enhance functionality. Additionally, we configure CORS (Cros...
Error Handling (How to create Custom Error Handlers and Exceptions) - FastAPI Beyond CRUD (Part 16)
Переглядів 512Місяць тому
Error Handling (How to create Custom Error Handlers and Exceptions) This video explores error handling in FastAPI, focusing on customizing exception raising and tailoring error responses to meet our application's specific requirements. We cover creating custom exception classes and utilizing them effectively to manage errors and personalize their presentation according to the application's need...
More Database And Schema Relationships - FastAPI Beyond CRUD (Part 15)
Переглядів 370Місяць тому
More Database And Schema Relationships In this video, we enhance our SQLModel models by establishing additional database relationships within our application. We demonstrate how to efficiently retrieve data leveraging these relationships, with a specific focus on user reviews. SOURCE CODE: github.com/jod35/fastapi-beyond-CRUD COURSE WEBSITE: jod35.github.io/fastapi-beyond-crud-docs/site/chapter...
Model And Schema Relationships (One To Many SQLModel) - FastAPI Beyond CRUD (Part 14)
Переглядів 496Місяць тому
Model And Schema Relationships (One To Many SQLModel) - FastAPI Beyond CRUD (Part 14)
Role-Based Access Control Using Dependency Injection (Add User Roles) - FastAPI Beyond CRUD Part 13
Переглядів 745Місяць тому
Role-Based Access Control Using Dependency Injection (Add User Roles) - FastAPI Beyond CRUD Part 13
JWT Authentication (Revoke Access Tokens Using Redis) - FastAPI Beyond CRUD Part 12
Переглядів 565Місяць тому
JWT Authentication (Revoke Access Tokens Using Redis) - FastAPI Beyond CRUD Part 12
JWT Authentication (Renew User Access Using Refresh Tokens) - FastAPI Beyond CRUD (Part 11)
Переглядів 4232 місяці тому
JWT Authentication (Renew User Access Using Refresh Tokens) - FastAPI Beyond CRUD (Part 11)
JWT Authentication (Protect Endpoints with HTTP Bearer Auth) - FastAPI Beyond CRUD (Part 10)
Переглядів 5842 місяці тому
JWT Authentication (Protect Endpoints with HTTP Bearer Auth) - FastAPI Beyond CRUD (Part 10)
JWT Authentication (Create Access And Refresh Tokens) - FastAPI Beyond CRUD (Part 9)
Переглядів 8282 місяці тому
JWT Authentication (Create Access And Refresh Tokens) - FastAPI Beyond CRUD (Part 9)
User Account Creation (Email & Password) - FastAPI Beyond CRUD (Part 8)
Переглядів 4492 місяці тому
User Account Creation (Email & Password) - FastAPI Beyond CRUD (Part 8)
Create a User Authentication Model (Database Migrations With Alembic) - FastAPI Beyond CRUD (Part 7)
Переглядів 5822 місяці тому
Create a User Authentication Model (Database Migrations With Alembic) - FastAPI Beyond CRUD (Part 7)
CRUD With Async SQLModel (An Introduction to Dependency Injection) - FastAPI Beyond CRUD (Part 6)
Переглядів 8072 місяці тому
CRUD With Async SQLModel (An Introduction to Dependency Injection) - FastAPI Beyond CRUD (Part 6)
Databases With SQLModel (Connection, Lifespan Events, And Models) - FastAPI Beyond CRUD (Part 5)
Переглядів 1 тис.2 місяці тому
Databases With SQLModel (Connection, Lifespan Events, And Models) - FastAPI Beyond CRUD (Part 5)
Modular Project Structure With FastAPI Routers - FastAPI Beyond CRUD (Part 4)
Переглядів 7392 місяці тому
Modular Project Structure With FastAPI Routers - FastAPI Beyond CRUD (Part 4)
Build a CRUD REST API (Response Models, Validation, And Exceptions) - FastAPI Beyond CRUD (Part 3)
Переглядів 7732 місяці тому
Build a CRUD REST API (Response Models, Validation, And Exceptions) - FastAPI Beyond CRUD (Part 3)
Web Server Basics (Path & Query Params, Request Body, Headers) - FastAPI Beyond CRUD (Part 2)
Переглядів 1,2 тис.2 місяці тому
Web Server Basics (Path & Query Params, Request Body, Headers) - FastAPI Beyond CRUD (Part 2)
Introduction And Project Set Up - FastAPI Beyond CRUD (Part 1)
Переглядів 1,9 тис.2 місяці тому
Introduction And Project Set Up - FastAPI Beyond CRUD (Part 1)
Communication About FastAPI Course And Channel Donations
Переглядів 2682 місяці тому
Communication About FastAPI Course And Channel Donations
Advanced Django ORM Features (Q-Objects, F-Expressions, Aggregations and Annotations)
Переглядів 4783 місяці тому
Advanced Django ORM Features (Q-Objects, F-Expressions, Aggregations and Annotations)
Easily Turn Your Markdown Into Static Sites Using MKDocs
Переглядів 4533 місяці тому
Easily Turn Your Markdown Into Static Sites Using MKDocs
FastAPI now has a CLI (FastAPI-CLI)
Переглядів 5673 місяці тому
FastAPI now has a CLI (FastAPI-CLI)
Be Careful when Listening to To Youtube Software Engineers @SidTheITGuy
Переглядів 2,9 тис.3 місяці тому
Be Careful when Listening to To UA-cam Software Engineers @SidTheITGuy

КОМЕНТАРІ

  • @justcoder2868
    @justcoder2868 7 годин тому

    Thanks so much for this video it was extremely helpful to me. I interested to learn where you learnt your your approach and structure of the application from? thanks again

    • @SsaliJonathan
      @SsaliJonathan 5 годин тому

      Hey there! I appreciate your kind comment. The project structure wasn’t inspired by any project. It’s something I built as I went on in the series. In fact, I changed it many times

  • @teogf
    @teogf 3 дні тому

    Have you tried FastApi + Jinja + Htmx? Interesting as a front-end for those who don't want to mess with other front-end languages or frameworks.

    • @SsaliJonathan
      @SsaliJonathan 3 дні тому

      HTMX is really a life saver. Used it once and I loved it

  • @realcontentfun
    @realcontentfun 3 дні тому

    Interesting course however nowadays for more readability and working in a team type hinting is really helpful so please in your next video add type hinting and doc strings thanks

    • @SsaliJonathan
      @SsaliJonathan 3 дні тому

      Thanks for the feedback. Highly appreciated

  • @imadepeter2421
    @imadepeter2421 3 дні тому

    This is a gem! Thank you for the hard work and time you have put into creating this profound course. God bless you. Please kindly create a FastAPI Microservices course. Thank you once again.

    • @SsaliJonathan
      @SsaliJonathan 3 дні тому

      I’m glad you found value in this course. I’m working on creating a micro services playlist.

    • @imadepeter2421
      @imadepeter2421 3 дні тому

      @@SsaliJonathan Thank you. Looking forward to it.

  • @jyotiranjanjena4424
    @jyotiranjanjena4424 4 дні тому

    Nice video bro.i am from india

  • @EmreEkmekcioglu
    @EmreEkmekcioglu 4 дні тому

    Project website is down :((

    • @SsaliJonathan
      @SsaliJonathan 4 дні тому

      It’s not actually down. The website was relocated to jod35.github.io/fastapi-beyond-crud-docs/site/

  • @joelnabimanya
    @joelnabimanya 5 днів тому

    Nicee😍

  • @UnpluggedPerformance
    @UnpluggedPerformance 6 днів тому

    nice man! keep on going!

  • @judevector
    @judevector 7 днів тому

    Please how did you build that documentation can we see the code

    • @SsaliJonathan
      @SsaliJonathan 7 днів тому

      Here is the repository that is containing the docs, github.com/jod35jon/fastapi-beyond-crud-docs

  • @judevector
    @judevector 7 днів тому

    Damn this is what I have prayed for a long time , glad my prayers was answered here ❤

  • @allanbakwanamaha2998
    @allanbakwanamaha2998 7 днів тому

    Sincerely speaking, the course was mind blowing. I request to have a physical chat with you anytime your available. Thanks and much Love from Kasana Luweero

    • @SsaliJonathan
      @SsaliJonathan 7 днів тому

      I actually ive in Bombo. We can meet at this year's Pycon Uganda.

  • @Mawuko-SenyoHayibor
    @Mawuko-SenyoHayibor 7 днів тому

    👏👏👏

  • @DavidOkwii
    @DavidOkwii 7 днів тому

    Great in-depth course here🎉 💯

    • @SsaliJonathan
      @SsaliJonathan 7 днів тому

      Thanks David. I appreciate the feedback 🙏

  • @codingcrashcourses8533
    @codingcrashcourses8533 7 днів тому

    The timestamps do not work. You need to remove the brackets :). Great effort btw :)

    • @SsaliJonathan
      @SsaliJonathan 7 днів тому

      Thanks for the tip! Let me remove them.

  • @Matthew-n8y
    @Matthew-n8y 7 днів тому

    What is the API test tool used in this project?

  • @elpapachelegendario8330
    @elpapachelegendario8330 8 днів тому

    Un excelente curso, muchas felicitaciones

  • @alsaamit
    @alsaamit 8 днів тому

    I appreciate your efforts.. thanks

  • @waelfathy2199
    @waelfathy2199 8 днів тому

    Great tutorial ❤❤❤

  • @MohamedAli-dk6cb
    @MohamedAli-dk6cb 8 днів тому

    This is a hidden gem. Thank you very much brother for this wonderful explanation.

  • @psjuniverse
    @psjuniverse 8 днів тому

    This is very interesting but you didn't cover alot in Rest APIs like this fast. Can you create a video on Rest APIs for third party authenticator

    • @SsaliJonathan
      @SsaliJonathan 8 днів тому

      Hey, thanks for watching. I am planning on creating these for later updates to this course. I got to the point where the course was getting a lot longer than I expected. Given that I do most of the work alone, I decided to end it at the length of this. I am planning on adding these topics

    • @psjuniverse
      @psjuniverse 2 дні тому

      ​@@SsaliJonathan I really appreciate your rest API course but please if you can work on more advanced tutorial even if it's a live would really appreciate 🙏

  • @Mawuko-SenyoHayibor
    @Mawuko-SenyoHayibor 9 днів тому

    Great video, I was following soo much I didn't even realize when it ended😂😂 , very captivating and informative

    • @SsaliJonathan
      @SsaliJonathan 9 днів тому

      Thanks bro. Check out the updated version

    • @SsaliJonathan
      @SsaliJonathan 9 днів тому

      ua-cam.com/play/PLEt8Tae2spYlosWRH9JDpKNxzb3bSOJGx.html&si=vOLECUdn0DaYwz7e

  • @user-ed6pw4hh6q
    @user-ed6pw4hh6q 9 днів тому

    This is really good tutorial

  • @pyloon
    @pyloon 9 днів тому

    شكرًا

  • @kira23j
    @kira23j 9 днів тому

    Great , Thanks ,Keep it coming!!!

  • @gannonk08
    @gannonk08 9 днів тому

    Thanks!

  • @marioyordanov20
    @marioyordanov20 9 днів тому

    this is gold, thank you!

  • @user-xz2hg3rq6o
    @user-xz2hg3rq6o 9 днів тому

    hello, thank you for video

  • @bayanhoms8532
    @bayanhoms8532 9 днів тому

    it's really significant 💡 thanks for helpful content

  • @salimkachemela
    @salimkachemela 9 днів тому

    Awesome course bro. Kindly please, could you make a video on Microservies with Django and FastAPI.

  • @olorundaremicheal8015
    @olorundaremicheal8015 9 днів тому

    🎉you've done a great job so far brother though I've not been able to complete the videos up till now 😅😅. But really brother, this cause is a life saver. Thanks for it and I hope we get more cool courses like often. Please don't forget my request as well boss

    • @SsaliJonathan
      @SsaliJonathan 9 днів тому

      I am glad you like it, You will get the courses.

  • @SsaliJonathan
    @SsaliJonathan 9 днів тому

    Hi everyone, I hope you enjoyed this course as much as I enjoyed creating it! This experience has been a great learning journey for me, both in diving deeper into FastAPI and in refining how I teach technical topics like this. If you found the course valuable, please like and share it with anyone who’s interested in learning FastAPI. You can find all the course details here jod35.github.io/fastapi-beyond-crud-docs/site/. Thanks for watching!

  • @SsaliJonathan
    @SsaliJonathan 9 днів тому

    Just in case it is hard to go through the timeline, (00:00:00) Introduction (00:01:00) Project set up (00:07:30) Build a simple web server (00:10:45) Run the server with FastAPI CLI (00:14:11) Path parameters (00:17:23) Choosing an HTTP client (00:20:58) Query Parameters (00:24:40) Using Path and Query parameters (00:26:51) Optional Query parameters (00:31:48) Request Body (00:39:11) Reading and setting headers (00:49:43) Build a REST API on a Python List (01:23:37) Organizing API Paths with Routers (01:38:22) Databases With SQLModel (01:42:33) Setting up a database (01:44:13) Settings management with Pydantic settings (01:53:38) Async SQLModel set up (01:58:38) Database connection with lifespan events (02:10:02) Creating a database model with SQLModel (02:20:00) Creating database tables (02:27:08) CRUD With SQLModel (02:29:48) Separate CRUD logic using service classes (02:55:53) Intro to Dependency Injection (03:01:20) Use service methods in API path handlers (03:33:35) Create the user auth model (03:42:09) Database Migrations With Alembic (03:59:57) User Account Creation (04:18:55) Password hashing with passlib (04:25:42) User Account Creation endpoint (04:42:57) Intro to JWT Authentication (04:48:29) PyJWT Set Up (05:01:13) User Login Endpoint (05:13:59) HTTP Bearer Authentication (05:33:14) Regaining Access with refresh tokens (05:50:04) Revoking Tokens using Redis (06:07:39) Role-Based Access Control (06:09:45) Get the currently authenticated user (06:20:25) Adding roles to the user model (06:26:55) Creating the Role Checker dependency (06:39:24) Handling Model And Schema Relationships (07:05:53) More Model And Schema Relationships (07:59:58) Error Handling (08:04:06) Create custom API Exceptions (08:18:14) Creating exception handlers for those exceptions (08:23:26) Register Error handlers on the app (08:33:25) Intro to Middleware (08:36:54) Creating a custom logging middleware (08:53:28) Another middleware example (08:59:36) Using Custom ASGI middleware with FastAPI (09:00:21) Adding CORS Middleware (09:03:34) Adding Trusted Hosts (09:05:04) Adding Email support (09:06:39) Setting Up FastAPI-Mail (09:21:46) Sending your first email (09:31:21) User account verification (10:07:51) Password Resets (10:40:38) Background Tasks (10:43:00) FastAPI Background Tasks (10:45:44) Background Tasks with Celery and Redis (11:16:17) Celery Monitoring With Flower (11:23:48) API Documentation with SwaggerUI And Redoc (11:36:02) API Testing (11:37:10) Unit testing with Unittest Mock And Pytest (12:01:27) Document-driven Testing with Schemathesis (12:09:17) Deployment On Render.com

  • @SsaliJonathan
    @SsaliJonathan 9 днів тому

    Hi everyone! I apologize for the slight drop in video quality-I had to compress it to ensure it could be uploaded without any issues before UA-cam rejected it.

  • @user-fi4xg5do9k
    @user-fi4xg5do9k 9 днів тому

    Thank you very much It was what I needed

    • @SsaliJonathan
      @SsaliJonathan 9 днів тому

      Glad it helped. Thanks for watching

  • @danielochoja8507
    @danielochoja8507 11 днів тому

    Do you save your tokens in cookies, or local storage

    • @SsaliJonathan
      @SsaliJonathan 11 днів тому

      The best practice is to store them as HTTP only cookies. For more information, you can read the article below.

  • @adjeteyoctavius4682
    @adjeteyoctavius4682 12 днів тому

    Thank you very much... You inspire me alot

    • @SsaliJonathan
      @SsaliJonathan 11 днів тому

      I’m really glad that I do. Thanks for watching

  • @entertainmentcenter4737
    @entertainmentcenter4737 12 днів тому

    Appreciate your teaching skill. Very straightforward and understandable

    • @SsaliJonathan
      @SsaliJonathan 11 днів тому

      You are welcome! Thanks for watching