# gf-huanchupk/springbootlearning architecture

> Architecture diagram of the GitHub repository gf-huanchupk/springbootlearning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gf-huanchupk/springbootlearning
- Repository: https://github.com/gf-huanchupk/springbootlearning

## Overview

This repository is a collection of independent Spring Boot and Spring Cloud learning examples, not one integrated application. Its examples cover CRUD and configuration, security, messaging, observability, and distributed transactions. The clearest end-to-end workflow is Seata purchase: a business request triggers storage deduction and order creation; order creation persists an order and requests an account debit. Other edges are limited to relationships shown in sampled source or the source index; unsampled README capabilities are represented as separate subsystems without guessed wiring.

Main entry points: [`springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java`](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java) (Purchase Orchestrator), [`springboot-cache/src/main/java/com/gf/controller/EmployeeController.java`](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-cache/src/main/java/com/gf/controller/EmployeeController.java) (Employee Cache), [`springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java`](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java) (Starter Demo API), [`springboot-seata/sbm-storage-service/src/main/java/com/gf/controller/StorageController.java`](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-storage-service/src/main/java/com/gf/controller/StorageController.java) (Storage Endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Spring Boot Examples"]
  node_basic["Hello Examples"]
  node_cache["Employee Cache"]
  node_cache_service["Employee Service"]
  node_mybatis["MyBatis Employee"]
  node_config["Configuration Models<br/>[Person.java]"]
  node_starter["Custom Starter<br/>[HelloService.java]"]
  node_starter_api["Starter Demo API"]
  node_validation["JSR303 Validation"]
end

subgraph group_security["Security Examples"]
  node_jwt["JWT Security"]
  node_oauth["OAuth2 Security"]
  node_oauth_jwt["OAuth JWT Servers"]
  node_security_basic["Spring Security"]
end

subgraph group_messaging["Messaging Examples"]
  node_rabbit["RabbitMQ Example<br/>[MQService.java]"]
  node_rocket["RocketMQ Messages<br/>[Producer.java]"]
end

subgraph group_distributed["Distributed Transactions"]
  node_business["Purchase Orchestrator"]
  node_storage_api["Storage Endpoint"]
  node_storage_service["Storage Service"]
  node_order_service["Order Service<br/>[OrderService.java]"]
  node_account["Account Service"]
end

subgraph group_platform["Operations And Cloud"]
  node_admin["Spring Boot Admin"]
  node_eureka["Eureka Server"]
  node_apollo["Apollo Configuration"]
  node_prometheus["Prometheus Actuator"]
  node_elasticsearch["Elasticsearch Example"]
  node_elk["ELK Example"]
  node_docker["Docker Example"]
end

node_user(("API User"))

node_user -->|"requests"| node_cache
node_cache -->|"calls"| node_cache_service
node_user -->|"requests"| node_starter_api
node_starter_api -->|"uses"| node_starter
node_user -->|"purchases"| node_business
node_business -->|"deducts stock"| node_storage_api
node_business -->|"creates order"| node_order_service
node_storage_api -->|"calls"| node_storage_service
node_order_service -.->|"debits account"| node_account
node_jwt -->|"resolves roles"| node_user

click node_basic "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-first-application/src/main/java/com/gf/controller/HelloController.java"
click node_cache "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-cache/src/main/java/com/gf/controller/EmployeeController.java"
click node_cache_service "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-cache/src/main/java/com/gf/service/EmployeeService.java"
click node_mybatis "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-mybatis/src/main/java/com/gf/controller/EmployeeController.java"
click node_config "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-config/src/main/java/com/gf/entity/Person.java"
click node_starter "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-custom-starter/hello-spring-boot-starter-autoconfigurer/src/main/java/com/gf/service/HelloService.java"
click node_starter_api "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java"
click node_validation "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-jsr303/src/main/java/com/itwolfed/controller/UserController.java"
click node_jwt "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-jwt/src/main/java/com/gf/config/MyInvocationSecurityMetadataSourceService.java"
click node_oauth "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-security-oauth2/src/main/java/com/gf/config/AuthorizationServerConfiguration.java"
click node_oauth_jwt "https://github.com/gf-huanchupk/springbootlearning/tree/master/springboot-security-oauth2-jwt"
click node_security_basic "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-security/src/main/java/com/gf/config/SecurityConfig.java"
click node_rabbit "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-rabbitmq/src/main/java/com/gf/service/MQService.java"
click node_rocket "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-rocketmq-message/src/main/java/com/itwolfed/msg/Producer.java"
click node_business "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java"
click node_storage_api "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-storage-service/src/main/java/com/gf/controller/StorageController.java"
click node_storage_service "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-storage-service/src/main/java/com/gf/service/StorageService.java"
click node_order_service "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-order-service/src/main/java/com/gf/service/OrderService.java"
click node_account "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-account-service/src/main/java/com/gf/service/AccountService.java"
click node_admin "https://github.com/gf-huanchupk/springbootlearning/tree/master/springboot-admin"
click node_eureka "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-admin/sc-eureka-server/src/main/java/com/gf/ScEurekaServerApplication.java"
click node_apollo "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-apollo/src/main/java/com/gf/controller/HelloController.java"
click node_prometheus "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-actuator-prometheus/src/main/java/com/gf/SpringbootActuatorPrometheusDemoApplication.java"
click node_elasticsearch "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-elasticsearch/src/main/java/com/gf/repository/BookRepository.java"
click node_elk "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-elk/src/main/java/com/gf/SpringbootElkApplication.java"
click node_docker "https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-docker/src/main/java/com/gf/SpringbootDockerApplication.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_basic,node_cache,node_cache_service,node_mybatis,node_config,node_starter,node_starter_api,node_validation,node_user toneBlue
class node_jwt,node_oauth,node_oauth_jwt,node_security_basic toneAmber
class node_rabbit,node_rocket toneMint
class node_business,node_storage_api,node_storage_service,node_order_service,node_account toneRose
class node_admin,node_eureka,node_apollo,node_prometheus,node_elasticsearch,node_elk,node_docker toneIndigo
```

## Components

### Spring Boot Examples

- [Hello Examples](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-first-application/src/main/java/com/gf/controller/HelloController.java): `springboot-first-application/src/main/java/com/gf/controller/HelloController.java`
- [Employee Cache](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-cache/src/main/java/com/gf/controller/EmployeeController.java): `springboot-cache/src/main/java/com/gf/controller/EmployeeController.java`
- [Employee Service](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-cache/src/main/java/com/gf/service/EmployeeService.java): `springboot-cache/src/main/java/com/gf/service/EmployeeService.java`
- [MyBatis Employee](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-mybatis/src/main/java/com/gf/controller/EmployeeController.java): `springboot-mybatis/src/main/java/com/gf/controller/EmployeeController.java`
- [Configuration Models](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-config/src/main/java/com/gf/entity/Person.java): `springboot-config/src/main/java/com/gf/entity/Person.java`
- [Custom Starter](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-custom-starter/hello-spring-boot-starter-autoconfigurer/src/main/java/com/gf/service/HelloService.java): `springboot-custom-starter/hello-spring-boot-starter-autoconfigurer/src/main/java/com/gf/service/HelloService.java`
- [Starter Demo API](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java): `springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java`
- [JSR303 Validation](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-jsr303/src/main/java/com/itwolfed/controller/UserController.java): `springboot-jsr303/src/main/java/com/itwolfed/controller/UserController.java`

### Security Examples

- [JWT Security](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-jwt/src/main/java/com/gf/config/MyInvocationSecurityMetadataSourceService.java): `springboot-jwt/src/main/java/com/gf/config/MyInvocationSecurityMetadataSourceService.java`
- [OAuth2 Security](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-security-oauth2/src/main/java/com/gf/config/AuthorizationServerConfiguration.java): `springboot-security-oauth2/src/main/java/com/gf/config/AuthorizationServerConfiguration.java`
- [OAuth JWT Servers](https://github.com/gf-huanchupk/springbootlearning/tree/master/springboot-security-oauth2-jwt): `springboot-security-oauth2-jwt`
- [Spring Security](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-security/src/main/java/com/gf/config/SecurityConfig.java): `springboot-security/src/main/java/com/gf/config/SecurityConfig.java`

### Messaging Examples

- [RabbitMQ Example](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-rabbitmq/src/main/java/com/gf/service/MQService.java): `springboot-rabbitmq/src/main/java/com/gf/service/MQService.java`
- [RocketMQ Messages](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-rocketmq-message/src/main/java/com/itwolfed/msg/Producer.java): `springboot-rocketmq-message/src/main/java/com/itwolfed/msg/Producer.java`

### Distributed Transactions

- [Purchase Orchestrator](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java): `springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java`
- [Storage Endpoint](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-storage-service/src/main/java/com/gf/controller/StorageController.java): `springboot-seata/sbm-storage-service/src/main/java/com/gf/controller/StorageController.java`
- [Storage Service](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-storage-service/src/main/java/com/gf/service/StorageService.java): `springboot-seata/sbm-storage-service/src/main/java/com/gf/service/StorageService.java`
- [Order Service](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-order-service/src/main/java/com/gf/service/OrderService.java): `springboot-seata/sbm-order-service/src/main/java/com/gf/service/OrderService.java`
- [Account Service](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-seata/sbm-account-service/src/main/java/com/gf/service/AccountService.java): `springboot-seata/sbm-account-service/src/main/java/com/gf/service/AccountService.java`

### Operations And Cloud

- [Spring Boot Admin](https://github.com/gf-huanchupk/springbootlearning/tree/master/springboot-admin): `springboot-admin`
- [Eureka Server](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-admin/sc-eureka-server/src/main/java/com/gf/ScEurekaServerApplication.java): `springboot-admin/sc-eureka-server/src/main/java/com/gf/ScEurekaServerApplication.java`
- [Apollo Configuration](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-apollo/src/main/java/com/gf/controller/HelloController.java): `springboot-apollo/src/main/java/com/gf/controller/HelloController.java`
- [Prometheus Actuator](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-actuator-prometheus/src/main/java/com/gf/SpringbootActuatorPrometheusDemoApplication.java): `springboot-actuator-prometheus/src/main/java/com/gf/SpringbootActuatorPrometheusDemoApplication.java`
- [Elasticsearch Example](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-elasticsearch/src/main/java/com/gf/repository/BookRepository.java): `springboot-elasticsearch/src/main/java/com/gf/repository/BookRepository.java`
- [ELK Example](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-elk/src/main/java/com/gf/SpringbootElkApplication.java): `springboot-elk/src/main/java/com/gf/SpringbootElkApplication.java`
- [Docker Example](https://github.com/gf-huanchupk/springbootlearning/blob/master/springboot-docker/src/main/java/com/gf/SpringbootDockerApplication.java): `springboot-docker/src/main/java/com/gf/SpringbootDockerApplication.java`

### Other components

- **API User**

## Connections

- API User → Employee Cache: requests (evidence: `springboot-cache/src/main/java/com/gf/controller/EmployeeController.java`)
- Employee Cache → Employee Service: calls (evidence: `springboot-cache/src/main/java/com/gf/controller/EmployeeController.java`)
- API User → Starter Demo API: requests (evidence: `springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java`)
- Starter Demo API → Custom Starter: uses (evidence: `springboot-custom-starter/hello-spring-boot-starter-test/src/main/java/com/gf/controller/HelloController.java`)
- API User → Purchase Orchestrator: purchases (evidence: `springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java`)
- Purchase Orchestrator → Storage Endpoint: deducts stock (evidence: `springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java`)
- Purchase Orchestrator → Order Service: creates order (evidence: `springboot-seata/sbm-business-service/src/main/java/com/gf/service/BusinessService.java`)
- Storage Endpoint → Storage Service: calls (evidence: `springboot-seata/sbm-storage-service/src/main/java/com/gf/controller/StorageController.java`)
- Order Service → Account Service: debits account
- JWT Security → API User: resolves roles (evidence: `springboot-jwt/src/main/java/com/gf/config/MyInvocationSecurityMetadataSourceService.java`)
