Below this readme has:
- Overview (short explanation of the project)
- Tech Stack (used technologies)
- Architecture Concepts (used architecture concepts)
- Project Structure (how the project is structured folder wise)
- Architecture Flow (how does everything work together)
- Services (each service's explanation)
This repository contains a ecommerce microservices architecture practice project build with Spring boot and Angular. It contains of 6 microservices: product-service, order-service, inventory-service, notification-service, api-gateway, frontend.
This project is intended for learning, experimentation, and portfolio demonstration.
The main purpose of this project is to gain hands-on experience with everything in the "Tech Stack" and "Architecture Concepts" sections.
[NOTE] check out refactor/feign-to-http-interface branch to see the refactored code its a more modern and recommended way to handle inter-service communication in Spring Boot
- Java 21
- Spring Boot 4 (Spring Web, Spring Data JPA, Lombok)
- Spring Cloud Gateway MVC (API Gateway)
- Spring Cloud Eureka (Service Discovery)
- Spring Cloud OpenFeign (REST Client) (refactored in branch refactor/feign-to-http-interface)
- Resilience4j (Circuit Breaker & Retries)
- Flyway (Database Migrations)
- Swagger (OpenAPI) v3 (API Documentation)
- MongoDB
- MySQL
- PostgreSQL
- Apache Kafka (Kraft) (Event-Driven Messaging)
- Prometheus (Metrics)
- Grafana (Dashboards)
- Loki (Log Aggregation)
- Tempo (Distributed Tracing)
- Docker
- Kubernetes
- OAuth2
- Keycloak (uses PostgreSQL)
- JUnit
- Testcontainers
- WireMock
This project demonstrates several distributed system patterns and modern engineering practices:
- Microservices Architecture
- Service Discovery (Dynamic registration and lookup via Eureka)
- API Gateway Pattern
- Inter-Service Communication (Synchronous via Feign & Asynchronous via Kafka)
- Centralized Security (Auth integration via Keycloak & OAuth2)
- Event-Driven Architecture (Asynchronous processing using Kafka)
- Resilience Patterns (Fault tolerance via Resilience4j)
- Observability (Centralized logs, metrics, and tracing)
- Database per Service
- Centralized API Docs (Gateway-level aggregation)
- Containerization
- Integration Testing (Automated tests with WireMock and Testcontainers)
springboot-microservices-ecommerce
│
├── api-gateway
├── product-service
├── order-service
├── inventory-service
├── notification-service
│
├── frontend (might or might not be added later)
│
├── eureka-server
├── docker
└── k8s
🚧 will be added later
Responsibilities:
- routing requests to backend services
- centralized security
- centralized api documentation
Technology:
- Spring Cloud Gateway MVC
- Keycloak
- Docker
- Swagger
- Grafana Stack (Prometheus, Grafana, Loki, Tempo)
Responsibilities:
- service discovery, finds location of services
Technology:
- Spring Cloud Eureka
Responsibilities:
- create products
- list products
Endpoints:
- POST /api/products createProduct
- GET /api/products getAllProducts
Technology:
- MongoDB
- Docker
- Swagger
- Grafana Stack (Prometheus, Grafana, Loki, Tempo)
Responsibilities:
- create orders
Endpoint:
- POST /api/orders placeOrder
Technology:
- MySQL
- Docker
- Feign Client (for GET /api/inventories)
- Flyway
- Swagger
- Kafka
- Grafana Stack (Prometheus, Grafana, Loki, Tempo)
Responsibilities:
- check if products are in stock
Endpoint:
- GET /api/inventories isInStock
Technology:
- MySQL
- Docker
- Flyway
- Swagger
- Grafana Stack (Prometheus, Grafana, Loki, Tempo)
Responsibilities: -send notifications to users (everytime when order is placed)
Technologies:
- Kafka
- Spring Email
- Grafana Stack (Prometheus, Grafana, Loki, Tempo)
Technologies:
- Angular