Skip to main content

Command Palette

Search for a command to run...

FastAPI_learn_with_ANIK

Updated
•3 min read•View as Markdown

FastAPI is a Python framework used to build APIs quickly and easily. It helps connect different apps like mobile, web, AI services, and databases through HTTP requests.

In the diagram, the server is the main backend system. The mobile app and web app send requests to it, and the server communicates with other services like AI servers and databases.

The most common request types are:

  • GET → read data

  • POST → create data

  • PUT/PATCH → update data

  • DELETE → remove data

FastAPI makes this simple by writing route functions like:

@app.get("/orders")
def get_orders():
    return {"message": "Orders fetched"}

It is popular because it is:

  • fast

  • easy to learn

  • supports async programming

  • generates automatic API documentation

So, in short: FastAPI is a tool to build backend APIs that connect apps with data and services.

Web Request Client

A web request client is a tool or program that sends a request to a server and receives a response

This backend diagram shows how a web application works. The mobile app and web app send requests to the backend server, which processes them and communicates with databases or AI services. The server handles different request types such as GET, POST, PUT/PATCH, and DELETE to read, create, update, or delete data. Tools like Postman and web request kits are used by developers to test these requests before connecting everything together. In short, the backend is the central part of the system that receives requests and returns responses.

Flask is sync

It handles requests one at a time in a traditional blocking way.

When a Flask app receives a request, it does the work in a normal single flow. It waits for each task to finish before moving to the next request.

Example

If one user sends a request that takes 5 seconds, Flask may wait during that 5 seconds before handling another request.

Flask does not have built-in request validation like FastAPI. In Flask, if you want validation, you usually need to write manual checks yourself or use extra libraries like:

  • Flask-WTF

  • Marshmallow

  • Pydantic + Flask integration

Flask does not provide built-in interactive API docs like FastAPI.

Web Framework

WSGI ASGI
Web Server Gateway Interface Async Server Gateway Interface
One request at a time per worker Many Request per worker
One Delivery Partner (DP) per order One delivery partner picks up multiple order