# nohyounghoon3651/spring-microservice-boot4 architecture

> Architecture diagram of the GitHub repository nohyounghoon3651/spring-microservice-boot4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nohyounghoon3651/spring-microservice-boot4
- Repository: https://github.com/nohyounghoon3651/spring-microservice-boot4

## Overview

This is a Spring Boot 4/Java 21 educational repository that develops a product microservices example across book chapters. The representative workflow is a client requesting a product aggregate, which combines product, recommendation, and review data; later chapters add persistence and event messaging. The supplied excerpts do not show the composite-service call chain or most service implementations, so those relationships are marked unverified rather than asserted. README capabilities such as security, discovery, gateway, observability, and Kubernetes are documented, but their implementing files are not present in the supplied tree.

Main entry points: [`Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java`](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java) (Service Integration), [`Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java`](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java) (Review Service), [`Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java`](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java) (Composite Service), [`Chapter07/api/src/main/java/se/magnus/api/core/review/ReviewService.java`](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/api/src/main/java/se/magnus/api/core/review/ReviewService.java) (Review API Contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Contracts and API"]
  node_aggregate["Product Aggregate"]
  node_reviewcontract["Review API Contract<br/>[ReviewService.java]"]
  node_reviewmodel["Review Model<br/>[Review.java]"]
  node_eventmodel["Event Envelope<br/>[Event.java]"]
end

subgraph group_composition["Aggregate Composition"]
  node_composite["Composite Service"]
  node_integration["Service Integration"]
end

subgraph group_services["Domain Services"]
  node_product["Product Service"]
  node_recommendation["Recommendation Service"]
  node_review["Review Service"]
end

subgraph group_state["Persistence and Events"]
  node_productrepo["Product Repository"]
  node_recommendationrepo["Recommendation Repository"]
  node_reviewrepo["Review Repository"]
  node_productevents["Product Event Setup"]
  node_recommendationevents["Recommendation Event Setup"]
  node_reviewevents["Review Event Setup"]
end

node_client(("API Client"))
node_database[("Database")]
node_broker["Message Broker"]

node_client -.->|"requests aggregate"| node_composite
node_composite -.->|"delegates calls"| node_integration
node_integration -.->|"requests product"| node_product
node_integration -.->|"requests recommendations"| node_recommendation
node_integration -.->|"requests reviews"| node_review
node_composite -.->|"builds response"| node_aggregate
node_review -.->|"uses repository"| node_reviewrepo
node_product -.->|"uses repository"| node_productrepo
node_recommendation -.->|"uses repository"| node_recommendationrepo
node_productrepo -.->|"reads and writes"| node_database
node_recommendationrepo -.->|"reads and writes"| node_database
node_reviewrepo -.->|"reads and writes"| node_database
node_review -.->|"implements contract"| node_reviewcontract
node_reviewcontract -.->|"exchanges reviews"| node_reviewmodel
node_productevents -.->|"configures messaging"| node_broker
node_recommendationevents -.->|"configures messaging"| node_broker
node_reviewevents -.->|"configures messaging"| node_broker
node_review -.->|"uses event envelope"| node_eventmodel

click node_aggregate "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/api/src/main/java/se/magnus/api/composite/product/ProductAggregate.java"
click node_composite "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java"
click node_integration "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java"
click node_product "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java"
click node_recommendation "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java"
click node_review "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java"
click node_reviewcontract "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/api/src/main/java/se/magnus/api/core/review/ReviewService.java"
click node_reviewmodel "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter04/api/src/main/java/se/magnus/api/core/review/Review.java"
click node_eventmodel "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/api/src/main/java/se/magnus/api/event/Event.java"
click node_productrepo "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-service/src/main/java/se/magnus/microservices/core/product/persistence/ProductRepository.java"
click node_recommendationrepo "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/persistence/RecommendationRepository.java"
click node_reviewrepo "https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/persistence/ReviewRepository.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_aggregate,node_reviewcontract,node_reviewmodel,node_eventmodel,node_client toneBlue
class node_composite,node_integration,node_database toneAmber
class node_product,node_recommendation,node_review toneMint
class node_productrepo,node_recommendationrepo,node_reviewrepo,node_productevents,node_recommendationevents,node_reviewevents toneRose
class node_broker toneIndigo
```

## Components

### Contracts and API

- [Product Aggregate](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/api/src/main/java/se/magnus/api/composite/product/ProductAggregate.java): `Chapter06/api/src/main/java/se/magnus/api/composite/product/ProductAggregate.java`
- [Review API Contract](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/api/src/main/java/se/magnus/api/core/review/ReviewService.java): `Chapter07/api/src/main/java/se/magnus/api/core/review/ReviewService.java`
- [Review Model](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter04/api/src/main/java/se/magnus/api/core/review/Review.java): `Chapter04/api/src/main/java/se/magnus/api/core/review/Review.java`
- [Event Envelope](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/api/src/main/java/se/magnus/api/event/Event.java): `Chapter07/api/src/main/java/se/magnus/api/event/Event.java`

### Aggregate Composition

- [Composite Service](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java): `Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java`
- [Service Integration](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java): `Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java`

### Domain Services

- [Product Service](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java): `Chapter06/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java`
- [Recommendation Service](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java): `Chapter06/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java`
- [Review Service](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java): `Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java`

### Persistence and Events

- [Product Repository](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/product-service/src/main/java/se/magnus/microservices/core/product/persistence/ProductRepository.java): `Chapter06/microservices/product-service/src/main/java/se/magnus/microservices/core/product/persistence/ProductRepository.java`
- [Recommendation Repository](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter06/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/persistence/RecommendationRepository.java): `Chapter06/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/persistence/RecommendationRepository.java`
- [Review Repository](https://github.com/nohyounghoon3651/spring-microservice-boot4/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/persistence/ReviewRepository.java): `Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/persistence/ReviewRepository.java`
- **Product Event Setup**
- **Recommendation Event Setup**
- **Review Event Setup**

### Other components

- **API Client**
- **Database**
- **Message Broker**

## Connections

- API Client → Composite Service: requests aggregate
- Composite Service → Service Integration: delegates calls
- Service Integration → Product Service: requests product
- Service Integration → Recommendation Service: requests recommendations
- Service Integration → Review Service: requests reviews
- Composite Service → Product Aggregate: builds response
- Review Service → Review Repository: uses repository
- Product Service → Product Repository: uses repository
- Recommendation Service → Recommendation Repository: uses repository
- Product Repository → Database: reads and writes
- Recommendation Repository → Database: reads and writes
- Review Repository → Database: reads and writes
- Review Service → Review API Contract: implements contract
- Review API Contract → Review Model: exchanges reviews
- Product Event Setup → Message Broker: configures messaging
- Recommendation Event Setup → Message Broker: configures messaging
- Review Event Setup → Message Broker: configures messaging
- Review Service → Event Envelope: uses event envelope
