This project demonstrates a simple microservices architecture using NestJS for a Zomato-style system with an API Gateway, a Restaurant Service, and a Menu Service. Built using Domain-Driven Design principles and MongoDB as the database.
- Acts as a single entry point for all external requests.
- Explicitly routes requests to either
restaurant-service
ormenu-service
. - Handles all communication via
HttpService
. - Includes correlation ID support and Winston logger for traceable logs.
- Manages restaurant-related operations.
- Exposes endpoints:
GET /restaurants
POST /restaurants
- Manages menu items linked to restaurants.
- Exposes endpoints:
GET /menus
POST /menus
git clone https://github.com/simerdev/api-gatway-example.git
cd zomato-microservices
cd api-gateway && npm install
cd ../restaurant-service && npm install
cd ../menu-service && npm install
cd restaurant-service && npm run start:dev
cd ../menu-service && npm run start:dev
cd ../api-gateway && npm run start:dev
Technolgies Used
NestJS MongoDB (via Mongoose) Winston Logger Axios (HttpService) Domain-Driven Design (DDD)