01. Introduction
Technologies we will use
In this project we'll use a set of modern, lightweight tools from the Python ecosystem, ideal for developing and deploying a professional API from scratch.
Each one plays a specific role in the workflow: from writing the code, to running it locally, to the final deployment.
Python
It's the project's base language.
Python is known for its clear syntax, its enormous ecosystem of libraries, and its compatibility with modern frameworks like FastAPI.
In this project we'll use version 3.
FastAPI
It's the project's main framework.
FastAPI lets you create modern, fast, and secure APIs with a simple syntax and automatic support for data validation, interactive documentation, and static typing.
It's built on top of Starlette (for the server side) and Pydantic (for data validation), which makes it an efficient and robust tool.
Key features:
- Support for data types (type hints) that make autocompletion and validations easier.
- Automatic documentation generation with Swagger and ReDoc. In our case, we'll use Scalar.
- Performance comparable to high-level frameworks like Node.js (thanks to ASGI and Uvicorn).
Uvicorn
Uvicorn is the ASGI (Asynchronous Server Gateway Interface) server that will run the FastAPI application.
It's in charge of receiving HTTP requests, processing them, and returning the responses.
It lets you run the application locally during development and on lightweight production servers.
Pydantic
Pydantic is used to define the data models (for example, a movie).
It automatically validates that the data sent or received has the correct format (types, required fields, limits, etc.).
Pydantic converts and validates the input information before it reaches the API's main logic.
Virtual environment (venv) and pip
A virtual environment (.venv) will be used to install dependencies in isolation from the system.
This ensures that the library versions are reproducible on any machine.
JSON (JavaScript Object Notation)
The catalog data will be stored in JSON files.
This format is used because it's lightweight, readable, and compatible with practically any programming language.
FastAPI works naturally with JSON: everything an endpoint returns (dictionaries, lists, etc.) is automatically converted to this format.
Visual Studio Code
It will be the project's main editor.
It will be used with extensions that make Python development easier, such as:
- Python (Microsoft)
- Pylance
- Black Formatter
- Jupyter (optional, for quick tests)
VS Code lets you integrate the virtual environment (.venv), run the app from the terminal, and keep a clean, modular project structure.
Git and GitHub
These tools will allow version control and code backup.
Git is used locally to record changes.
GitHub lets you host the project's repository and connect it with Vercel for the final deployment.
Vercel
It will be the platform used to deploy the API once it's finished.
Vercel offers direct integration with GitHub, allowing the project to be deployed automatically every time a push is made.
Advantages:
- Minimal configuration.
- Automatic HTTPS certificates.
- Instant URLs to share and test.