You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A polyglot microservices architecture demo with an API Gateway, built using FastAPI (Python), Django REST Framework (Python), ASP.NET Core (C#), and Express.js (Node.js).
(Optional for local dev) Node.js, Python 3.11+, .NET 8 SDK
Run All Services with Docker Compose
# Clone the repository
git clone https://github.com/chamithusithmaka/microservices-lab.git
cd microservices-lab
# Build and start all services
docker-compose up --build
# Stop all services
docker-compose down
All services will start automatically. The API Gateway will be available at http://localhost:8080.
Note: When running locally, update the proxy targets in api-gateway/index.js from Docker service names (e.g., http://item-service:8081) to http://localhost:8081, etc.
Get all payments:GET http://localhost:8080/payments
Docker Images
All services use optimized Docker images:
Service
Base Image
Optimizations
API Gateway
node:20-alpine
Alpine Linux, production-only deps
Item Service
python:3.11-slim
Slim image, no-cache pip install
Order Service
python:3.11-slim
Slim image, no-cache pip install
Payment Service
mcr.microsoft.com/dotnet/aspnet:8.0
Multi-stage build, SDK not in final image
Useful Docker Commands
# Build and start all services
docker-compose up --build
# Start in detached mode (background)
docker-compose up --build -d
# View running containers
docker ps
# View logs for a specific service
docker-compose logs item-service
docker-compose logs order-service
docker-compose logs payment-service
docker-compose logs api-gateway
# Stop all services
docker-compose down
# Rebuild a single service
docker-compose build payment-service