This project demonstrates a simple microservices architecture with Golang, FastAPI, Flask, and Node.js.
Each service handles different aspects of an e-commerce system and communicates via REST APIs.
The entire system runs with Docker Compose.
| Service | Technology | Port | Description |
|---|---|---|---|
| API Gateway | Golang (Gin) | 5000 |
Routes requests & aggregates data |
| User Service | Golang (Gin) | 5001 |
Handles user details |
| Order Service | FastAPI | 5002 |
Handles order details |
| Payment Service | Flask | 5003 |
Handles payment details |
| Product Service | Node.js (Express) | 5004 |
Handles product details |
git clone https://github.com/sajosam/ecommerce-microservices.git
cd ecommerce-microservicesdocker-compose up --buildGET /users/{id}β Get user details
GET /orders/{user_id}β Get user orders
GET /payments/{user_id}β Get user payments
GET /products/{user_id}β Get user products
GET /all-details/{user_id}β Fetch all details in a single response
curl http://localhost:5000/users/1curl http://localhost:5000/orders/1curl http://localhost:5000/payments/1curl http://localhost:5000/products/1curl http://localhost:5000/all-details/1Each microservice has a Dockerfile and is managed using Docker Compose.
To stop all services, run:
docker-compose downβ
Golang (Gin) - API Gateway & User Service
β
FastAPI - Order Service
β
Flask - Payment Service
β
Node.js (Express) - Product Service
β
Docker & Docker Compose
π Happy Coding! π₯