A production‑style Microservices Architecture built using Spring Boot + Angular, demonstrating real‑world backend design including API Gateway security, Keycloak authentication, Kafka event‑driven communication, Resilience4j fault tolerance, and polyglot persistence with MySQL & MongoDB.
This project simulates a scalable e‑commerce backend where multiple independent services communicate through both synchronous and asynchronous mechanisms.
It was built to gain hands‑on experience with distributed systems, secure microservices, and containerized deployment.
Angular Frontend
↓
API Gateway
↓
┌──────────────┬──────────────┬──────────────┐
| Product | Inventory | Order |
| Service | Service | Service |
| (MongoDB) | (MySQL) | (MySQL) |
└──────────────┴──────────────┴──────────────┘
↓
Kafka
↓
Notification Service
- Java Spring Boot – Microservices development
- Spring Cloud Gateway – API Gateway & routing
- Keycloak – Authentication & Authorization (OAuth2 / OpenID Connect)
- Resilience4j – Circuit Breaker, Retry, Fault tolerance
- Apache Kafka – Event‑driven asynchronous communication
- Angular – UI and client‑side interaction
- MySQL – Order & Inventory Services (transactional data)
- MongoDB – Product Service (flexible catalog data)
- Docker & Docker Compose – Multi‑container deployment
- Environment‑based configuration
- Ready for Kubernetes deployment
- Stores product catalog
- Uses MongoDB for flexible schema
- CRUD operations for products
- Tracks product stock levels
- Uses MySQL for transactional integrity
- Validates stock before order placement
- Handles order creation & management
- Uses MySQL database
- Communicates with Inventory Service synchronously
- Publishes Kafka events after order confirmation
- Consumes Kafka events
- Sends order confirmation notifications
- Demonstrates async microservice workflow
- Central entry point
- Request routing
- Security enforcement
- Token validation using Keycloak
Implemented using Keycloak:
- OAuth2 / OpenID Connect
- Token‑based authentication
- Secure API Gateway routing
Order Service → Inventory Service
- Implemented using REST APIs
- Fault tolerance with Resilience4j
- Circuit Breaker + Retry pattern
Order Service → Notification Service
- Implemented using Apache Kafka
- Event‑driven architecture
- Improved scalability & decoupling
root
├── api-gateway
├── product-service
├── inventory-service
├── order-service
├── notification-service
├── angular-frontend
└── README.md
- Designing scalable microservices architecture
- Implementing centralized authentication using Keycloak
- Handling service failures with Resilience4j
- Event‑driven architecture using Kafka
- Managing multiple databases in distributed systems
- Containerizing microservices with Docker
- Kubernetes deployment
- Distributed tracing (Zipkin / Jaeger)
- Centralized logging (ELK / Loki)
- CI/CD pipeline integration
- API rate limiting
- Service discovery (Eureka / Consul)
Adarsh Raj If you like this project, give it a ⭐ on GitHub!