A template backend project with FastAPI and Flask APIs, Nginx, Redis, and PostgreSQL in Docker.
This project provides a template backend with two APIs built using FastAPI and Flask frameworks. It includes an Nginx server as the API gateway, Redis for caching, and PostgreSQL as the database. The Docker environment ensures easy setup and deployment, making it convenient for developers to use this template as a starting point for their backend projects.
To use this template backend, you need to have Docker installed on your system. Follow the steps below to set up and run the project:
-
Clone this repository to your local machine:
git clone https://github.com/S3L1M/Backend-System.git
-
Navigate to the project directory:
cd Backend-System
-
Build the Docker images and start containers:
./run.sh
The APIs will be accessible through API gateway (Ngnix) at https://localhost:8000/inventory
(FastAPI) and https://localhost:8000/accounts
(Flask) once the containers are up and running.
This template backend provides two different APIs using FastAPI and Flask frameworks. You can use any of these APIs based on your preference and requirements. The API endpoints are detailed in endpoints section.
By defualt, inventory database will be populated with dummy data with the following code in inventory-service/app.py
file.
# Add dummy product data
db = SessionLocal()
for i in range(1, 101):
name = f'Product_{i}