01. Introduction
Project objectives
Project objectives
In this project we'll build a complete API to manage a movie catalog, from scratch and step by step.
This will be your first professional approach to backend development with FastAPI, one of the most widely used modern frameworks for building APIs in Python.
Throughout the project you'll learn to think about, structure, and deploy an API just as a developer would in a real-world environment.
Let's talk about our objectives next.
Understand what an API is and how FastAPI works
You'll start by understanding what it means to build a REST API and what role FastAPI plays in the Python ecosystem.
You'll learn that an API has no visual interface; instead, it communicates through endpoints that respond with structured data (JSON).
You'll use Uvicorn, a server that will let you run your application locally and test it from the browser or from the interactive documentation that FastAPI generates automatically.
Set up your professional development environment
You'll configure your computer with certain considerations in mind.
You'll install Python, use Visual Studio Code as your editor, create a virtual environment (venv) for your libraries, and learn to manage dependencies with pip and a requirements.txt file.
With that, your project will be reproducible on any machine.
Create your first application with FastAPI
We'll see how to start a server, how FastAPI's automatic documentation works, and how to test endpoints in the browser.
Model data with Pydantic
You'll learn to define and validate data using Pydantic models, a tool that ensures the data your API receives or sends has the correct format.
You'll use these models to represent a movie, with attributes such as title, year, genre, director, price, and stock.
Each model will have its own purpose: creation, update, or response.
Build a complete CRUD
Your core objective will be to implement the full cycle of CRUD operations:
- Create new movies (POST)
- List all movies (GET)
- Get a specific movie (GET)
- Update its information (PUT/PATCH)
- Delete movies (DELETE)
With this, your API will behave like a real application, ready to interact with any frontend.
Store data persistently
The data your API handles won't be lost when you close the program.
You'll use a JSON file as a local database, to read and write the movie records.
You'll learn to handle this file carefully, using classes and functions that ensure the integrity of the information.
Add validations, filters, and search
Your application won't just store and read data; it will also let you search for movies, filter by genre or year, and validate common errors (for example, negative prices or duplicate IDs).
Improve code quality and structure
Throughout the project, you'll organize your code across several files (modules):
main.py, models.py, database.py, config.py, errors.py, among others.
This will teach you modularization, a fundamental step before building larger projects.
Document and test your API
FastAPI automatically generates visual documentation (Swagger), but you'll add descriptions, examples, and categories so that your API is easy to understand and use.
In addition, you'll write automated tests to confirm that the main endpoints work correctly.
Get ready for production
At the end of the project, you'll connect your code with Git and GitHub, and learn to deploy it on Vercel, a free service that lets you put your API online.
This way, you'll be able to share your project's link and test it from anywhere in the world.