This project demonstrates a production-style microservices system design using Spring Boot, API Gateway, JWT security, Kafka, Resilience patterns, and Analytics.
All external traffic flows through the API Gateway, which handles:
- Authentication (JWT)
- Rate limiting
- Request routing
- Security enforcement
Services involved:
- API Gateway (8080)
- Auth Service (8086)
- Catalog Service (8081)
- Order Service (8082)
- Payment Service (8084)
- Analytics Service (8085)
Key design patterns implemented:
- API Gateway
- JWT Authentication
- Saga (event-driven)
- Circuit Breaker
- Rate Limiting
- Idempotency
- Event-driven analytics
Endpoint
POST /auth/login
URL
http://localhost:8080/auth/login
Request Body
{
"username": "chiranjib",
"password": "password"
}Response
{
"token": "<JWT_TOKEN>"
}Use this token in the Authorization header for all secured APIs:
Authorization: Bearer <JWT_TOKEN>
GET /catalog/api/products/{id}
Example:
http://localhost:8080/catalog/api/products/1
Headers:
Authorization: Bearer <JWT_TOKEN>
POST /catalog/api/products
Body:
{
"name": "iPhone 15",
"category": "Mobile",
"price": 80000
}POST /orders/api/orders?userId=2&amount=102
Headers:
Authorization: Bearer <JWT_TOKEN>
Idempotency-Key: user-138
POST /orders/api/orders/{orderId}
POST /payments/api/payments?orderId=2&amount=1200.0
GET /analytics/api/analytics/orders
GET /analytics/api/analytics/payments
- Microservices Architecture
- API Gateway Pattern
- JWT Authentication & Authorization
- Rate Limiting (Redis)
- Idempotency
- Saga Pattern
- Circuit Breaker (Resilience4j)
- Retry & Timeout
- Event-driven Analytics
docker compose build
docker compose up