MicroserviceGrid is a production-style microservices platform built with Spring Boot 3 and Spring Cloud.
The project demonstrates a modern distributed system including:
- reactive API gateway
- service discovery
- event-driven architecture
- centralized authentication
- observability stack
- containerized infrastructure
The system simulates a real-world e-commerce platform composed of multiple independent microservices.
- Java 21
- Spring Boot 3
- Spring WebFlux
- Spring Cloud Gateway
- Spring Cloud Netflix Eureka
- Spring Security
- Keycloak (OAuth2 / OpenID Connect)
- Resilience4J
| Service | Database |
|---|---|
| Product Service | MongoDB |
| Order Service | MySQL |
| Inventory Service | MySQL |
| File Service | MinIO (S3 compatible storage) |
- Apache Kafka
- Prometheus – metrics
- Grafana – dashboards
- Loki – centralized logging
- Tempo – distributed tracing
- Docker
- Docker Compose
- GitHub Actions (CI/CD)
- Testcontainers
- Angular 20
- Admin
- Shop UI
flowchart LR
%% ===== CLIENT =====
Client["🅰️ Angular Frontend"]
%% ===== API LAYER =====
Gateway["🚪 API Gateway<br>Spring Cloud Gateway"]
%% ===== DISCOVERY =====
Discovery["🧭 Discovery Service<br>Eureka"]
%% ===== MICROSERVICES =====
Order["🧾 Order Service"]
Product["📦 Product Service"]
Inventory["🏬 Inventory Service"]
Notification["📨 Notification Service"]
File["🖼 File Service"]
%% ===== INFRASTRUCTURE =====
Kafka["🟠 Apache Kafka<br>Event Bus"]
Minio["☁️ MinIO<br>Object Storage"]
%% ===== REQUEST FLOW =====
Client -->|HTTP / REST| Gateway
Gateway -->|REST| Order
Gateway -->|REST| Product
Gateway -->|REST| File
%% ===== SERVICE COMMUNICATION =====
Order -->|REST Stock Check| Inventory
Order -->|Publish OrderCreated Event| Kafka
Kafka -->|Consume Event| Notification
Product -->|Upload / Fetch Image| File
File -->|Store Object| Minio
%% ===== DISCOVERY =====
Order -.-> Discovery
Product -.-> Discovery
Inventory -.-> Discovery
Notification -.-> Discovery
File -.-> Discovery
Gateway -.-> Discovery
%% ===== STYLES =====
classDef gateway fill:#E3F2FD,stroke:#1E88E5,stroke-width:2px;
classDef service fill:#E8F5E9,stroke:#43A047,stroke-width:2px;
classDef infra fill:#FFF3E0,stroke:#FB8C00,stroke-width:2px;
classDef client fill:#F3E5F5,stroke:#8E24AA,stroke-width:2px;
class Client client
class Gateway gateway
class Order,Product,Inventory,Notification,File service
class Kafka,Minio,Discovery infra
| Service | Description | Status | Repository |
|---|---|---|---|
| Frontend (Angular) | Shop + Admin Panel | 🚧 ~70% implemented | link |
| Product Service | Manages product catalog | ✅ Implemented | link |
| Order Service | Handles customer orders | ✅ Implemented | link |
| Inventory Service | Tracks product stock levels | 🚧 In progress | link |
| Notification Service | Sends notifications (Email / Viber) | ✅ Implemented | link |
| File Service | Manages product images (upload/preview/download) | ✅ Implemented | link |
| Discovery Service | Service registry (Eureka) | ✅ Implemented | link |
| API Gateway | Central reactive entry point (Spring WebFlux) | ✅ Implemented | link |
| Auth Server | Authentication & Authorization (Keycloak / OAuth2) | ✅ Implemented | - |
| Pay Service | Payment and currency operations | 🕓 Planned | - |
sequenceDiagram
participant Client
participant Gateway
participant OrderService
participant InventoryService
participant Kafka
participant Notification
Service Client->>Gateway: POST /orders
Gateway->>OrderService: createOrder()
OrderService->>InventoryService: checkStock()
InventoryService-->>OrderService: stockAvailable
OrderService->>Kafka: publish OrderCreated event
Kafka-->>NotificationService: consume event
NotificationService->>Client: send notificationsequenceDiagram
participant Client
participant Gateway
participant OrderService
participant InventoryService
participant Kafka
participant NotificationService
Client->>Gateway: POST /orders
Gateway->>OrderService: createOrder()
OrderService->>InventoryService: checkStock() (REST)
InventoryService-->>OrderService: stockAvailable / stockUnavailable
OrderService->>Kafka: publish OrderCreated event
Kafka-->>NotificationService: consume event
NotificationService->>Client: send notification
- Order → Inventory: synchronous REST with Resilience4J CircuitBreaker & RateLimiter
- Order → Kafka → NotificationService: asynchronous event-driven communication
- Product → File Service → MinIO: image storage workflow
Each microservice follows a layered architecture.
flowchart TD
Controller["REST Controller"]
Service["Service Layer<br>Business Logic"]
Repository["Repository Layer"]
Database["Database"]
KafkaProducer["Kafka Producer"]
KafkaConsumer["Kafka Consumer"]
Controller --> Service
Service --> Repository
Repository --> Database
Service --> KafkaProducer
KafkaConsumer --> Service
The platform uses two communication styles.
Synchronous communication
REST calls between services.
Example:
Order Service → Inventory Service
Used for:
- stock validation
- request-response operations
Asynchronous communication
Event-driven messaging with Kafka.
Example: Order Service → Kafka → Notification Service
Benefits:
- loose coupling
- scalability
- resilience
The system uses Spring Cloud Netflix Eureka.
Features:
- automatic service registration
- dynamic service discovery
- no hardcoded service URLs
- horizontal scaling support
All microservices register themselves during startup.
Authentication is handled by Keycloak.
Supported features:
- OAuth2
- OpenID Connect
- JWT authentication
- Role-based access control
Roles:
| Role | Description |
|---|---|
| ADMIN | system administration |
| CLIENT | customer access |
Service-to-service communication uses Client Credentials Flow.
The File Service manages product images.
Workflow:
- Admin uploads image via API
- File Service stores object in MinIO
- Presigned URL is generated
- Frontend loads image directly from MinIO
Benefits:
- scalable object storage
- compatible with AWS S3
- reduced backend load
The platform includes a full monitoring and tracing stack.
| Tool | Purpose |
|---|---|
| Prometheus | metrics collection |
| Grafana | visualization dashboards |
| Loki | log aggregation |
| Tempo | distributed tracing |
A Postman Collection is included.
📁 file: MicroServiceGrid.postman_collection.json
The collection includes:
- Product API
- Order API
- Inventory API
- File Service API
- Health endpoints
The Postman collection acts as the source of truth for the API.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/products |
Get all products |
GET |
/api/v1/products/{{sku}} |
Get product by SKU (public) |
POST |
/api/v1/admin/products |
Create a new product (admin) |
POST |
/api/v1/admin/products/batch |
Batch create products (admin) |
PUT |
/api/v1/admin/products/{{sku}} |
Update product (admin) |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/orders |
Create new order |
GET |
/api/v1/orders |
Get all orders |
GET |
/api/v1/orders?page=0&size=10&status=&email=&sort= |
Get orders with pagination & filters |
GET |
/api/v1/orders/{{orderNumber}} |
Get order by number |
PUT |
/api/v1/orders/{{orderNumber}} |
Update order (full) |
PATCH |
/api/v1/orders/{{orderNbr}}/status |
Update order status |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/inventory?skuCode=&quantity= |
Check inventory availability |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/files/upload/product/{sku} |
Upload or update product image |
GET |
/api/v1/files/preview?objectName= |
Generate presigned URL (preview) |
GET |
/api/v1/files/download?objectName= |
Download image as stream |
| Method | Endpoint | Description |
|---|---|---|
GET |
/actuator/health |
Health check for API Gateway |
The frontend application of the Microservice Grid ecosystem is built with Angular 20 and serves both the shop and admin panel.
It communicates with the API Gateway and backend microservices to provide a modular, reactive, and scalable user interface.
📁 Repository: MicroserviceGridShopFrontend
- Product catalog (Product Service)
- Inventory availability (Inventory Service)
- Order creation (Order Service)
- Admin panel for managing products, orders, and users
- Secure API integration via API Gateway
- Docker-ready production build
To start the full system locally:
git clone https://github.com/Andrij72/MicroserviceGrid.git# Go to the project root
cd microservice-grid docker-compose -f docker-compose.orchestrator_dev.yml up -d2️⃣ Start Observability Stack
In the project root, there is a file docker-compose-observability.yml:
docker-compose -f docker-compose-observability.yml up -dThe system uses Keycloak as an OAuth2 / OpenID Connect server.
- JWT-based authentication
- Client Credentials flow (service-to-service)
- Role-based access control (ADMIN / CLIENT)
- Integration via Spring Security
The basic Keycloak setup (realm, clients, roles)
is documented with screenshots:
📁 src/main/resources/static/keycloak/
Screenshots demonstrate:
- Realm creation
- Clients configuration
- Roles and mappings
- Token configuration
⚠️ In a production environment, Keycloak configuration
should be done via realm-export (JSON) or Terraform.
Screenshots are provided for demonstration and educational purposes only.
The system runs entirely in Docker containers.
Components include:
- microservices
- Kafka
- databases
- Keycloak
- observability stack
All services communicate through a shared Docker network:
microservices-net
- Docker images built and pushed to Docker Hub.
- GitHub Actions automate building, testing, and publishing.
- Docker Compose used for local development.
- Kubernetes (planned) for orchestration and scalability.
Planned extensions:
- Payment microservice
- Kubernetes deployment
- Telegram / Email notifications
- AI-based analytics for orders and sales
This project demonstrates:
- modern microservice architecture
- event-driven communication with Kafka
- fault tolerance with Resilience4J
- secure authentication with Keycloak
- full observability stack
- containerized infrastructure
👤 Author: Andrii Kulynch
📅 Version: 2.0