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! 🔥