Build Your First FastAPI Web Application

Jordan P. Raychev
Geek Culture
Published in
6 min readAug 19, 2023

--

Hi folks, in this article I would like to go over the necessary steps in order to build simple three tier web applications using FastAPI.

Photo by Alex Chumak on Unsplash

If you are reading this article I would assume that you are already familiar with 3 layers architectures and what FastAPI could be used for so I will not focus on that. Instead, I would focus on the practical part of things. Feel free to ask ChatGPT what is what :)

Ask ChatGTP:

What is a three layer web architecture?

What is FastAPI?

Database layer

The first layer that I would like to start with is the database layer. It is also know as data layer or persistence layer. It is responsible for storing and retrieving data from a database. It also communicates with the application layer to retrieve or update data in response to requests.

When creating a database layer, I like to think about models. Simply said, the models will be the representation of your objects and its structure. For example, lets say we need to store information about a Person. The structure or fields that the person will consist of may be name, email, address, phone, gender, etc. These fields can be viewed simple as the name of the columns that we will be using for our database (we will be using a MySQL DB).

--

--

Jordan P. Raychev
Geek Culture

Network, system and software engineer with true passion about technology. Love to read and spend time in nature.