# in28minutes/spring-boot-examples architecture

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

- Interactive diagram: https://gitdiagram.com/in28minutes/spring-boot-examples
- Repository: https://github.com/in28minutes/spring-boot-examples

## Overview

#### 1. Repository Shape and Execution Model
This is a collection of independent Spring Boot tutorial projects, not a single deployable application or Maven multi-module build. Each top-level example directory has its own `pom.xml`, application entry point, resources, and tests; run/build from that project directory. Java/Spring Boot is primary, with one Kotlin project and several standalone React frontends.

Representative entry points:
- `spring-boot-rest-services/src/main/java/com/in28minutes/springboot/StudentApplication.java`
- `spring-boot-tutorial-basics/src/main/java/com/in28minutes/springboot/tutorial/basics/example/SpringBootTutorialBasicsApplication.java`
- `spring-boot-kotlin-basics-configuration/src/main/kotlin/com/in28minutes/springboot/tutorial/basics/application/configuration/SpringBootTutorialBasicsConfigurationApplication.kt`

#### 2. Spring Fundamentals and Configuration Samples
Basic projects demonstrate Spring container concepts, REST resources, profiles, properties/YAML binding, XML/Java configuration, AOP, and MVC/JSP. These are isolated learning stages rather than shared libraries.

Key boundaries:
- Configuration/profile selection is driven by application property files.
- Web MVC controllers delegate to simple service/model layers.
- AOP wraps business/data calls in the basics sample.

Paths:
- `spring-boot-tutorial-basics/src/main/java/com/in28minutes/springboot/tutorial/basics/example/aop/UserAccessAspect.java`
- `spring-boot-tutorial-basics-configuration/src/main/java/com/in28minutes/springboot/tutorial/basics/application/configuration/BasicConfiguration.java`
- `spring-boot-web-application/src/main/webapp/WEB-INF/jsp/welcome.jsp`

#### 3. REST API Evolution Samples
Multiple near-parallel REST projects use a Student domain to demonstrate baseline CRUD plus API boundary concerns: validation, exception translation, representation filtering, content negotiation, versioning, HATEOAS, and Swagger/OpenAPI documentation.

Primary request flow is HTTP → `StudentResource`/controller → repository or in-memory service → `Student` response. Specialized projects add cross-cutting response behavior at the API edge.

Paths:
- `spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/student/StudentResource.java`
- `spring-boot-2-rest-service-exception-handling/src/main/java/com/in28minutes/springboot/rest/example/exception/CustomizedResponseEntityExceptionHandler.java`
- `spring-boot-2-rest-service-versioning/src/main/java/com/in28minutes/springboot/rest/example/versioning/StudentVersioningController.java`

#### 4. Persistence Strategy Comparisons
Four projects implement the same Student persistence concern through distinct data-access boundaries: raw JDBC template/client, MyBatis, JPA/Hibernate, and Spring Data REST. H2 is the local embedded database; schema/data scripts initialize examples where present.

The architectural comparison is entity/model → persistence adapter → H2, with SQL explicit in JDBC/MyBatis and ORM/repository abstractions in JPA variants.

Paths:
- `spring-boot-2-jdbc-with-h2/src/main/java/com/in28minutes/springboot/jdbc/h2/example/student/StudentJdbcTemplateRepository.java`
- `spring-boot-2-myBatis-with-h2/src/main/java/com/in28minutes/springboot/mybatis/h2/example/student/StudentMyBatisRepository.java`
- `spring-boot-2-jpa-with-hibernate-and-h2/src/main/java/com/in28minutes/springboot/jpa/hibernate/h2/example/student/StudentRepository.java`

#### 5. Microservice Demonstration
`spring-boot-basic-microservice` contains separately deployable currency-conversion, forex/exchange, and Eureka naming-server applications. The conversion service calls the forex service through a proxy; Eureka provides service discovery. Forex owns exchange-rate persistence.

Paths:
- `spring-boot-basic-microservice/spring-boot-microservice-currency-conversion-service/src/main/java/com/in28minutes/springboot/microservice/example/currencyconversion/CurrencyExchangeServiceProxy.java`
- `spring-boot-basic-microservice/spring-boot-microservice-forex-service/src/main/java/com/in28minutes/springboot/microservice/example/forex/ForexController.java`
- `spring-boot-basic-microservice/spring-boot-microservice-eureka-naming-server/src/main/java/com/in28minutes/springboot/microservice/eureka/naming/server/SpringBootMicroserviceEurekaNamingServerApplication.java`

#### 6. Full-Stack React/Spring Boot Examples
`spring-boot-react-examples` contains paired, independently runnable React clients and Spring Boot APIs for routing, CRUD, basic authentication, CORS/CSRF, JWT login, and JPA/H2-backed courses. Browser clients call backend REST resources; security configurations enforce authentication/CORS/CSRF or JWT token handling. React uses Node/npm; backends use Maven/JVM.

Paths:
- `spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtSecurityConfig.java`
- `spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtTokenService.java`
- `spring-boot-react-examples/spring-boot-react-crud-full-stack-with-maven/frontend-spring-boot-react-crud-full-stack-with-maven/src/service/CourseDataService.js`

Main entry points: [`spring-boot-basic-microservice/spring-boot-microservice-currency-conversion-service/src/main/java/com/in28minutes/springboot/microservice/example/currencyconversion/CurrencyExchangeServiceProxy.java`](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-currency-conversion-service/src/main/java/com/in28minutes/springboot/microservice/example/currencyconversion/CurrencyExchangeServiceProxy.java) (Currency conversion service), [`spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/student/StudentResource.java`](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/student/StudentResource.java) (Student REST resource), [`spring-boot-tutorial-basics-configuration/src/main/java/com/in28minutes/springboot/tutorial/basics/application/configuration/BasicConfiguration.java`](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-tutorial-basics-configuration/src/main/java/com/in28minutes/springboot/tutorial/basics/application/configuration/BasicConfiguration.java) (Configuration & profiles), [`spring-boot-2-jdbc-with-h2/src/main/java/com/in28minutes/springboot/jdbc/h2/example/student/StudentJdbcTemplateRepository.java`](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-jdbc-with-h2/src/main/java/com/in28minutes/springboot/jdbc/h2/example/student/StudentJdbcTemplateRepository.java) (JDBC adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_fundamentals["Spring Fundamentals"]
  node_fundamental_config["Configuration &amp; profiles<br/>Spring configuration"]
  node_mvc_jsp["MVC controllers &amp; JSP<br/>web sample<br/>[welcome.jsp]"]
  node_aop["User access aspect<br/>AOP interceptor"]
end

subgraph group_rest["REST Evolution"]
  node_student_rest["Student REST resource<br/>REST controller"]
  node_student_service["Student service/repository<br/>domain access"]
  node_api_exception["Exception translation<br/>API advice"]
  node_api_versioning["Versioned Student API<br/>REST controller"]
end

subgraph group_persistence["Persistence Comparisons"]
  node_student_model["Student model<br/>entity/model"]
  node_jdbc_adapter["JDBC adapter"]
  node_mybatis_adapter["MyBatis adapter"]
  node_jpa_adapter["JPA/Hibernate adapter"]
  node_h2[("H2 database<br/>embedded database")]
end

subgraph group_microservices["Microservice Demo"]
  node_conversion_service["Currency conversion service<br/>Spring Boot service"]
  node_forex_service["Forex service<br/>Spring Boot service"]
  node_eureka{{"Eureka naming server<br/>service discovery"}}
end

subgraph group_fullstack["React + Spring Boot"]
  node_react_client["React course client<br/>Node/npm frontend"]
  node_backend_api["Spring Boot backend APIs<br/>REST backend"]
  node_jwt_security["JWT security boundary<br/>Spring Security"]
  node_jwt_tokens["JWT token service"]
end

node_tutorials["Independent tutorial projects<br/>repository structure"]

node_tutorials -.->|"contains isolated sample"| node_fundamental_config
node_tutorials -.->|"contains isolated sample"| node_student_rest
node_tutorials -.->|"contains comparison projects"| node_student_model
node_tutorials -.->|"contains deployable apps"| node_conversion_service
node_tutorials -.->|"contains paired projects"| node_react_client
node_fundamental_config -->|"configures web sample"| node_mvc_jsp
node_aop -.->|"wraps calls"| node_student_service
node_student_rest -->|"delegates CRUD"| node_student_service
node_api_exception -.->|"handles API failures"| node_student_rest
node_api_versioning -->|"serves versioned data"| node_student_service
node_student_model -->|"persisted by"| node_jdbc_adapter
node_student_model -->|"persisted by"| node_mybatis_adapter
node_student_model -->|"persisted by"| node_jpa_adapter
node_jdbc_adapter -->|"SQL access"| node_h2
node_mybatis_adapter -->|"mapped SQL"| node_h2
node_jpa_adapter -->|"ORM access"| node_h2
node_conversion_service -->|"discovers service"| node_eureka
node_forex_service -->|"registers"| node_eureka
node_conversion_service -->|"requests exchange rates"| node_forex_service
node_react_client -->|"REST requests"| node_backend_api
node_backend_api -->|"secured by"| node_jwt_security
node_jwt_security -->|"uses"| node_jwt_tokens

click node_fundamental_config "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-tutorial-basics-configuration/src/main/java/com/in28minutes/springboot/tutorial/basics/application/configuration/BasicConfiguration.java"
click node_mvc_jsp "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-web-application/src/main/webapp/WEB-INF/jsp/welcome.jsp"
click node_aop "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-tutorial-basics/src/main/java/com/in28minutes/springboot/tutorial/basics/example/aop/UserAccessAspect.java"
click node_student_rest "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/student/StudentResource.java"
click node_api_exception "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-exception-handling/src/main/java/com/in28minutes/springboot/rest/example/exception/CustomizedResponseEntityExceptionHandler.java"
click node_api_versioning "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-versioning/src/main/java/com/in28minutes/springboot/rest/example/versioning/StudentVersioningController.java"
click node_jdbc_adapter "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-jdbc-with-h2/src/main/java/com/in28minutes/springboot/jdbc/h2/example/student/StudentJdbcTemplateRepository.java"
click node_mybatis_adapter "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-myBatis-with-h2/src/main/java/com/in28minutes/springboot/mybatis/h2/example/student/StudentMyBatisRepository.java"
click node_jpa_adapter "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-jpa-with-hibernate-and-h2/src/main/java/com/in28minutes/springboot/jpa/hibernate/h2/example/student/StudentRepository.java"
click node_conversion_service "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-currency-conversion-service/src/main/java/com/in28minutes/springboot/microservice/example/currencyconversion/CurrencyExchangeServiceProxy.java"
click node_forex_service "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-forex-service/src/main/java/com/in28minutes/springboot/microservice/example/forex/ForexController.java"
click node_eureka "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-eureka-naming-server/src/main/java/com/in28minutes/springboot/microservice/eureka/naming/server/SpringBootMicroserviceEurekaNamingServerApplication.java"
click node_react_client "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-react-examples/spring-boot-react-crud-full-stack-with-maven/frontend-spring-boot-react-crud-full-stack-with-maven/src/service/CourseDataService.js"
click node_jwt_security "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtSecurityConfig.java"
click node_jwt_tokens "https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtTokenService.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_fundamental_config,node_mvc_jsp,node_aop toneBlue
class node_student_rest,node_student_service,node_api_exception,node_api_versioning toneAmber
class node_student_model,node_jdbc_adapter,node_mybatis_adapter,node_jpa_adapter,node_h2 toneMint
class node_conversion_service,node_forex_service,node_eureka toneRose
class node_react_client,node_backend_api,node_jwt_security,node_jwt_tokens toneIndigo
class node_tutorials toneNeutral
```

## Components

### Spring Fundamentals

Independent container, MVC, configuration, and AOP examples.

- [Configuration & profiles](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-tutorial-basics-configuration/src/main/java/com/in28minutes/springboot/tutorial/basics/application/configuration/BasicConfiguration.java): Spring configuration · Properties and profiles select sample behavior. · `spring-boot-tutorial-basics-configuration/src/main/java/com/in28minutes/springboot/tutorial/basics/application/configuration/BasicConfiguration.java`
- [MVC controllers & JSP](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-web-application/src/main/webapp/WEB-INF/jsp/welcome.jsp): web sample · Controllers render the server-side welcome view. · `spring-boot-web-application/src/main/webapp/WEB-INF/jsp/welcome.jsp`
- [User access aspect](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-tutorial-basics/src/main/java/com/in28minutes/springboot/tutorial/basics/example/aop/UserAccessAspect.java): AOP interceptor · Wraps business and data calls in the basics sample. · `spring-boot-tutorial-basics/src/main/java/com/in28minutes/springboot/tutorial/basics/example/aop/UserAccessAspect.java`

### REST Evolution

Parallel Student API boundary examples.

- [Student REST resource](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/student/StudentResource.java): REST controller · Baseline Student CRUD request boundary. · `spring-boot-2-rest-service-basic/src/main/java/com/in28minutes/springboot/rest/example/student/StudentResource.java`
- **Student service/repository**: domain access · In-memory or repository-backed Student operations.
- [Exception translation](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-exception-handling/src/main/java/com/in28minutes/springboot/rest/example/exception/CustomizedResponseEntityExceptionHandler.java): API advice · Converts failures into HTTP responses. · `spring-boot-2-rest-service-exception-handling/src/main/java/com/in28minutes/springboot/rest/example/exception/CustomizedResponseEntityExceptionHandler.java`
- [Versioned Student API](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-rest-service-versioning/src/main/java/com/in28minutes/springboot/rest/example/versioning/StudentVersioningController.java): REST controller · Demonstrates versioned representations at the API edge. · `spring-boot-2-rest-service-versioning/src/main/java/com/in28minutes/springboot/rest/example/versioning/StudentVersioningController.java`

### Persistence Comparisons

Alternative H2 data-access implementations.

- **Student model**: entity/model · Shared comparison domain across persistence examples.
- [JDBC adapter](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-jdbc-with-h2/src/main/java/com/in28minutes/springboot/jdbc/h2/example/student/StudentJdbcTemplateRepository.java): repository · Explicit SQL through Spring JDBC. · `spring-boot-2-jdbc-with-h2/src/main/java/com/in28minutes/springboot/jdbc/h2/example/student/StudentJdbcTemplateRepository.java`
- [MyBatis adapter](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-myBatis-with-h2/src/main/java/com/in28minutes/springboot/mybatis/h2/example/student/StudentMyBatisRepository.java): repository · Mapper-based SQL persistence. · `spring-boot-2-myBatis-with-h2/src/main/java/com/in28minutes/springboot/mybatis/h2/example/student/StudentMyBatisRepository.java`
- [JPA/Hibernate adapter](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-2-jpa-with-hibernate-and-h2/src/main/java/com/in28minutes/springboot/jpa/hibernate/h2/example/student/StudentRepository.java): repository · ORM-backed Student persistence. · `spring-boot-2-jpa-with-hibernate-and-h2/src/main/java/com/in28minutes/springboot/jpa/hibernate/h2/example/student/StudentRepository.java`
- **H2 database**: embedded database · Local database initialized by example scripts where present.

### Microservice Demo

Separately deployable currency services and discovery.

- [Currency conversion service](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-currency-conversion-service/src/main/java/com/in28minutes/springboot/microservice/example/currencyconversion/CurrencyExchangeServiceProxy.java): Spring Boot service · Calls forex for exchange rates. · `spring-boot-basic-microservice/spring-boot-microservice-currency-conversion-service/src/main/java/com/in28minutes/springboot/microservice/example/currencyconversion/CurrencyExchangeServiceProxy.java`
- [Forex service](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-forex-service/src/main/java/com/in28minutes/springboot/microservice/example/forex/ForexController.java): Spring Boot service · Owns exchange-rate API and persistence. · `spring-boot-basic-microservice/spring-boot-microservice-forex-service/src/main/java/com/in28minutes/springboot/microservice/example/forex/ForexController.java`
- [Eureka naming server](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-basic-microservice/spring-boot-microservice-eureka-naming-server/src/main/java/com/in28minutes/springboot/microservice/eureka/naming/server/SpringBootMicroserviceEurekaNamingServerApplication.java): service discovery · Registers and resolves microservice instances. · `spring-boot-basic-microservice/spring-boot-microservice-eureka-naming-server/src/main/java/com/in28minutes/springboot/microservice/eureka/naming/server/SpringBootMicroserviceEurekaNamingServerApplication.java`

### React + Spring Boot

Independently runnable browser and backend pairs.

- [React course client](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-react-examples/spring-boot-react-crud-full-stack-with-maven/frontend-spring-boot-react-crud-full-stack-with-maven/src/service/CourseDataService.js): Node/npm frontend · Browser client invokes backend course APIs. · `spring-boot-react-examples/spring-boot-react-crud-full-stack-with-maven/frontend-spring-boot-react-crud-full-stack-with-maven/src/service/CourseDataService.js`
- **Spring Boot backend APIs**: REST backend · Course CRUD and authentication API variants.
- [JWT security boundary](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtSecurityConfig.java): Spring Security · Authenticates requests and issues or validates JWTs. · `spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtSecurityConfig.java`
- [JWT token service](https://github.com/in28minutes/spring-boot-examples/blob/master/spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtTokenService.java): token service · Creates and processes JWT tokens. · `spring-boot-react-examples/spring-boot-react-jwt-auth-login-logout/backend-spring-boot-react-jwt-auth-login-logout/src/main/java/com/in28minutes/fullstack/springboot/jwt/basic/authentication/springbootjwtauthloginlogout/jwt/JwtTokenService.java`

### Other components

- **Independent tutorial projects**: repository structure · Each top-level project builds and runs from its own directory.

## Connections

- Independent tutorial projects → Configuration & profiles: contains isolated sample
- Independent tutorial projects → Student REST resource: contains isolated sample
- Independent tutorial projects → Student model: contains comparison projects
- Independent tutorial projects → Currency conversion service: contains deployable apps
- Independent tutorial projects → React course client: contains paired projects
- Configuration & profiles → MVC controllers & JSP: configures web sample
- User access aspect → Student service/repository: wraps calls
- Student REST resource → Student service/repository: delegates CRUD
- Exception translation → Student REST resource: handles API failures
- Versioned Student API → Student service/repository: serves versioned data
- Student model → JDBC adapter: persisted by
- Student model → MyBatis adapter: persisted by
- Student model → JPA/Hibernate adapter: persisted by
- JDBC adapter → H2 database: SQL access
- MyBatis adapter → H2 database: mapped SQL
- JPA/Hibernate adapter → H2 database: ORM access
- Currency conversion service → Eureka naming server: discovers service
- Forex service → Eureka naming server: registers
- Currency conversion service → Forex service: requests exchange rates
- React course client → Spring Boot backend APIs: REST requests
- Spring Boot backend APIs → JWT security boundary: secured by
- JWT security boundary → JWT token service: uses
