Unknown: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home/skilramit/htdocs/www.skilr.com/public/catalog/controller/product/product.php on line 502REST API Development using FastAPI Online Course | Skilr
This course guides you through mastering FastAPI, a high-performance framework for building APIs. You’ll start with API fundamentals and REST architecture, then create your first FastAPI application. Learn to structure projects for scalability, implement social media features, handle routing, and manage posts and comments. The course covers pytest for testing, async database integration, Pydantic configuration, logging, JWT-based authentication, and email verification. Advanced topics include file uploads, background tasks, deployment on platforms like Render, error monitoring with Sentry, and continuous integration with GitHub Actions. By the end, you’ll be equipped to build, test, and deploy robust FastAPI applications.
Who should take this Course?
This course is ideal for Python developers, backend engineers, and full-stack developers seeking to build efficient and scalable APIs. Beginners with basic Python knowledge can learn FastAPI fundamentals and hands-on project development. It also suits developers looking to implement testing, authentication, async databases, and advanced features in production-ready applications. Professionals aiming to streamline development workflows through deployment strategies, CI/CD, and error monitoring will find this course highly valuable.
What you will learn
Build and deploy scalable FastAPI applications
Implement robust testing strategies with pytest
Integrate async databases and manage configurations
Enhance applications with advanced logging and authentication
Execute background tasks and manage file uploads
Deploy applications to cloud platforms and implement CI/CD
Course Outline
Course Introduction
Community
Welcome to this course!
What is an API?
What is REST?
Working with FastAPI
Introduction to this section
Your First FastAPI App
Initial App Setup
Linting, formatting and sorting imports
Our social media API: adding posts
Splitting our API into files with APIRouter
Adding comments to the social media API
Introduction to pytest
Introduction to the pytest section
The basics of pytest
Getting started with FastAPI tests
Creating posts in our tests
Adding tests for posts
Adding comments tests
Working with async databases
Introduction to working with databases
Installing requirements for async databases in FastAPI
Creating a config file using Pydantic
Different configurations per environment
Config caching and how to get the config object
Async database setup with FastAPI
Database connection with lifespan events in FastAPI
Run your FastAPI test in 'test' mode
Using a database in our FastAPI router
Logging in FastAPI applications
Introduction to logging
Python logging: loggers, handlers, and formatters
Logger hierarchies and name
Adding Logging Configuration for FastAPI Applications
How to configure multiple loggers in the logging module
Adding File Handlers for Saving Logs
Add logging to your FastAPI endpoints
Python logging: filters and custom filters
Logging HTTPExceptions with an Exception Handler
Identifying logs from the same request: Correlation ID
Adding JSON-formatted log files
Obfuscating email addresses in logs using a custom filter
Adding Logtail for Cloud Logging in FastAPI
Enabling Logtail only in production
User authentication with FastAPI
Introduction to user authentication
Installing requirements and, what are JWTs?
Adding a users table and retrieving users by email
Adding user registration and tests
Adding tests for the user registration endpoint
How to hash passwords with passlib
Generate the access token
Retrieve the current user with their token
Use the current user in the API router
Dependency injection: getting the user
Adding user relationships to other tables
(Optional) OAuth Password Bearer and Swagger Auth
Many-to-many relationships
Adding a table for post likes
Adding an API route to like posts
Extracting reusable queries with SQLAlchemy
Query string arguments and data sorting with Enum
User email confirmation
Creating the confirmation token
Decoding the confirmation token
Adding a user confirmation endpoint
Requiring user confirmation for authenticated requests
Mailgun set-up and configuration
Sending emails and testing with Python
Sending a confirmation email on registration
Sending emails with background tasks
File Uploads with FastAPI
Our configuration for Backblaze B2
Internal library for Backblaze B2
Writing our file upload endpoint
Writing tests for file upload
Background Tasks for Image Generation
Model and database changes for image generation
Configuration for DeepAI, our third-party service
Generating images using background tasks
Executing image generation in our FastAPI endpoint
FastAPI Deployments and Application Management
Updating our project to Pydantic v2
Deploy a FastAPI app to Render
Add a free PostgreSQL database to your FastAPI app
Error management with Sentry for FastAPI apps
Continuous Integration with GitHub Actions for Python apps