This project consists of four microservices:
- GraphQL Gateway - Unified API for all microservices.
- User Service - Manages authentication, user registration, and login.
- Order Service - Handles order creation, processing, and Kafka events.
- Product Service - Manages products and stock updates.
- Node.js - Backend framework for each microservice.
- GraphQL - API gateway to communicate with all services.
- Kafka - Message broker for event-driven communication.
- Redis - Caching layer for performance optimization.
- MongoDB - NoSQL database for storing users, orders, and products.
- Docker & Docker Compose - Containerized environment.
Service | Port | Functionality |
---|---|---|
GraphQL Gateway | 7000 |
Unifies all APIs for communication. |
User Service | 8000 |
Manages authentication and user data. |
Order Service | 8001 |
Handles order processing and stock validation via Kafka. |
Product Service | 8002 |
Manages product inventory, integrates with Kafka for stock updates. |
Kafka | 9092 |
Message broker for inter-service communication. |
Redis | 6379 |
Caching layer for faster performance. |
MongoDB | 27017 |
Database for all microservices. |
git clone https://github.com/your-repo/microservices-app.git
cd microservices-app
docker compose up --build