
Explore FastAPI fundamentals from basics to advanced concepts with hands-on coding, and build a real-world API project plus two client apps, ReactJS and Android, to connect and display data.
Learn how Udemy's review system affects course visibility in this fastapi masterclass from scratch, and how your feedback can help improve the course toward a five-star experience.
Install libraries, set up the project, and explore FastAPI features, then implement your first code and create and test your first endpoint.
Install and run fast api on windows by creating a virtual environment, installing fast api and uvicorn, and building a hello world endpoint with quick local testing.
Install a mac python environment, create a virtual environment, install fastapi and uvicorn, and run a hello world app with auto reload on port 8000.
Explore FastAPI features, including automatic documentation with swagger UI and doc UI, accessible via docs and re doc, plus security, dependency injection, validation, and robust testing.
Create a simple hello world FastAPI app in Python three, exposing a get operation on the base URL and returning a json object with message 'Hello world'.
Explore how to design get method endpoints in fastapi, including path parameters, predefined values, and query parameters, and learn to retrieve and use them in code.
Capture a blog id with a path parameter and use it to personalize responses. Validate the id as an integer with pydantic, and order routes so specific paths match first.
define a predefined path parameter using a Python enum to restrict values to short, story, or how-to blog; FastAPI validates input and updates docs.
Learn to define query parameters in fast api, combine them with path parameters, and use default values or optional types to control requests and validation.
Explore how to describe FastAPI operations and expose clear documentation to clients. Learn setting status codes, tagging endpoints, and crafting concise summaries, descriptions, and response messages.
Learn to implement HTTP status codes in FastAPI by using the status module, returning 200 or 404, and setting response.status_code to reflect outcomes.
Add tags to FastAPI operations to categorize endpoints into blog and comment, observe how Swagger UI reflects multiple tags, and plan refactoring to reduce repeated tag assignments.
Expose API method summary and description to Swagger UI by using a short string or a function box string, including a mandatory path parameter and optional query parameters.
Describe API responses using the response_description tag, and verify the output by refreshing Swagger UI and inspecting the list of available blogs from the get all blogs endpoint.
Explore routers to structure a FastAPI app into logical components, refactor the project into multiple files, and implement a second router to enable future endpoints.
Discover how routers in FastAPI split an API into modular files, share a prefix and tags, and attach router operations to the main app.
Refactor a growing FastAPI app by organizing operations into routers, creating a blog get router with a /blog prefix and shared tags, and wiring it via include_router.
Refactor your FastAPI app by creating a second blog router for post operations, import it into main, and expose structured get and post endpoints in the documented API.
Explore detailed parameter handling in FastAPI, including request body, path and query parameters, metadata, validators, multiple values, and complex subtypes, with data converted into Python objects.
Define a pedantic base model, send data in the request body with the post method, and let FastAPI convert Json to the model, validate types, and return Json.
Learn how to attach parameter metadata to FastAPI parameters, including query, path, and body, using imports, titles, descriptions, aliases, and deprecation to enhance API documentation.
Explore data validators for parameters, including default values inside body, query, and path; enforce optional versus required parameters with min_length, max_length, and regex.
Learn how to handle multiple values for a single query parameter in FastAPI by declaring an optional list parameter, providing default values, and testing with Try It Out.
Master number validation in FastAPI by applying greater than, greater than or equal to, less than, and less than or equal to constraints on path parameters, ensuring robust integer input.
Learn how to build Pydantic models with complex subtypes, including lists, dicts, tuples, and custom subtypes like a reusable image model, for flexible API data.
Explore integrating databases with FastAPI, including creating tables, performing create/read/update/delete operations, and exposing these through endpoints while leveraging dependencies and relationships for multi-table data.
Discover how FastAPI integrates with relational databases using SQLAlchemy ORM to convert between user requests, database models, and responses, including password hashing considerations.
Install sqlalchemy and set up a database model for a fastapi project, using a requirements.txt and pasteable database.py boilerplate to create the database and tables.
Resolve a common Python environment error by recreating and activating the virtual environment, then reinstalling dependencies from requirements.txt to ensure SQL Alchemy is found.
Create a FastAPI database setup by defining a SQLAlchemy base, a user model with id, username, email, and hashed password, and auto-create the database and tables on startup.
Learn to write user data to a database with FastAPI by defining schemas, hashing passwords with bcrypt, and exposing a create user API that returns a safe display model.
Review the setup from importing libraries and hashing passwords with bcrypt to creating a database, models, and schemas, then expose user operations via a fastapi router and plan CRUD actions.
Create and read data from a database using a session, commit entries, and return results, then read all users or a single user by id with filters via API routes.
Learn to update and delete database entries with SQLAlchemy in a FastAPI app, including filtering by ID, committing changes, and exposing update and delete endpoints.
Define and consume two-way relationships between users and articles in a FastAPI project, enabling a single request to return a user with articles or an article with its creator.
Explore concepts in the others section, including error handling, custom responses, headers, cookies, and form data. Learn how cross-origin resource sharing (CORS) affects your FastAPI code for local host applications.
Learn to manage errors in a FastAPI app by raising http exceptions with status codes like 404 and 400, and implement custom exception handlers for meaningful client messages.
Explore custom responses in FastAPI by returning a response object with HTML or plain text, controlling media types and avoiding automatic data conversion.
Learn to define and use custom request and response headers in FastAPI, including header defaults, single and multiple headers, and the underscore-to-dash mapping in header names.
Learn to set and retrieve cookies in FastAPI using response.set_cookie with a key and value, storing strings, lists, dictionaries, or models in the browser and reading them in endpoints.
Learn how to handle form data in FastAPI by declaring form parameters, installing Python multipart, and building a product endpoint that accepts form-encoded input.
Learn how cross-origin resource sharing blocks local front-end requests to a locally hosted FastAPI backend, and implement CORS middleware to allow localhost origins, methods, and headers.
Explore authentication in FastAPI and learn to secure endpoints with tokens, generate encrypted access tokens, and authenticate users with username and password.
Implement oauth two authentication in fast api using username and password with password hashing, generate expiring tokens, and secure endpoints while keeping user creation open.
Secure the get article endpoint with OAuth2 password bearer in FastAPI, using a token URL and dependency on the OAuth2 schema; keep the create user endpoint open for now.
implement authentication by creating a user, validating credentials with hashed passwords, and using an oauth2 password flow to generate a json web token at a token endpoint.
Implement token verification and current user retrieval using oauth2 and jwt to secure fastapi endpoints and enforce authentication across resources.
Learn to handle files in FastAPI by retrieving files from requests and using upload file for reading and writing. Explore static URL access and download endpoints for images.
Learn how to send a file to a FastAPI backend as bytes via multipart form data, decode it as utf-8, split into lines, and handle in-memory storage for small files.
Explore FastAPI upload file handling, storing uploads in memory and on disk, using a Python file-like object to save, name, and manage files in a local folder.
Make files statically accessible in a FastAPI app by mounting a StaticFiles directory at /files, serving the files from the files folder.
Learn how to expose file downloads via a FastAPI endpoint using a file response, returning the file path, and adding security and logging with authentication.
Your professional FastAPI development course.
FastAPI is one of the fastest growing API development frameworks available. It is easy to use and lightweight. In addition it provides some unique benefits such as automatic Swagger docs generation and modern, open standards of development.
This course will give you a complete understanding of FastAPI features. We will discuss simple and advanced concepts so that you have a clear image of what is possible.
We will also discuss how FastAPI works with SQL databases, and in particular SqlAlchemy. We will see how we can expose endpoints that will allow a client to manipulate and retrieve data from a database.
And best of all, ALL concepts discussed will be implemented in code. This will not only be a theoretical course, but a course that builds both your knowledge and experience. Whenever we introduce a concept, we will implement it in code so that you see how it works in practice.
In this course we will cover:
Installation and setup on both Mac and Windows
Virtual environment and project generation
FastApi features
Path and query parameters
HTTP status, codes and exceptions
Error handling
Tags
Routers and automatic path generation
API responses and response management
Validators
Complex subtypes
SQL, relational database management and ORM
SQLAlchemy
Authentication and authorization
File management
API deployment
Testing and debugging
Templates, middleware, async programming, web socket communication, background tasks and lots more
The final part of the course will be a practical project. We will create an Instagram clone app and build the API that is required to make that work. We will focus on a few key concepts like posting, commenting and user authentication.
We will also develop two clients for our api:
web client in ReactJS
mobile client in Android and Kotlin
That way you will have a complete understanding both web and mobile fullstack development.
This course is meant for fullstack developers who wish to acquire a new skill. That of building APIs quickly and easily.
The course is constantly updated as the API evolves and adds new tools and concepts.
I'm confident you will love this course. So sign up today and let's get started learning to build APIs in FastAPI.