Skip to content

Ihebdhouibi/Microservices-with-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices with FastAPI

A simple use case of fastapi microservices project


GitHub Repo stars GitHub language count Twitter Follow

LinkedIn


Table of content

About the project

Microservice is the approach of breaking down large monolith application into individual applications specializing in a specific service/functionality.
This approach is often known as Service-Oriented Architecture or SOA.
In a microservice architecture, the application is broken down into several separate services that run in separate processes. There is a different database for different functionality of the application and the services communicate with each other using the HTTP, AMQP, or a binary protocol like TCP, depending on the nature of each service.

This is a simple e-shop app that uses microservices, the aim of this project is to gain hands-on-experience developing microservices using python FastAPI, communicate with a JS frontend and deploy docker images to a registry.

Tech Stack

Client : React, Bootstrcloudap
Server : Fastapi, Redis
CI/CD: Docker, Dockerhub

To run this project follow the instructions below :

Clone this repo

    cd Destination_folder
    git clone https://github.com/Ihebdhouibi/Microservices-with-fastapi.git

Run the following command

    cd Microservices-with-fastapi
    pip install -r requirements.txt
    cd Microservices-with-fastapi/inventory-frontend
    npm install

To run this project execute the following commands

    cd Microservices-with-fastapi/inventory
    uvicorn main:app --reload
    python consumer.py
    cd Microservices-with-fastapi/payment
    uvicorn main:app --reload --port=8001
    python consumer.py
    cd Microservices-with-fastapi/inventory-frontend
    npm start

You can also run demo version of this project by pulling the Docker images from DockerHub

    docker pull houb94/frontend:1.0
    docker pull houb94/inventory:1.0
    docker pull houb94/payment:1.0

After pulling the images run the following command to build containers

    docker compose build

Now that the containers are built, run the following command

    docker compose up

All you need to do now is to go to localhost:3000

Distributed under the MIT License. See LICENSE.txt for more information.

Email me 📧 [email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published