How in28minutes/spring-boot-examples works
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: CurrencyExchangeServiceProxy.java Currency conversion service · StudentResource.java Student REST resource · BasicConfiguration.java Configuration & profiles · StudentJdbcTemplateRepository.java JDBC adapter
Components 20
Spring Fundamentals
Independent container, MVC, configuration, and AOP examples.
- Configuration & profiles · 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 · Controllers render the server-side welcome view.
spring-boot-web-application/src/main/webapp/WEB-INF/jsp/welcome.jsp - User access aspect · 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 · 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 · In-memory or repository-backed Student operations.
- Exception translation · 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 · 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 · Shared comparison domain across persistence examples.
- JDBC adapter · 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 · 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 · 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 · Local database initialized by example scripts where present.
Microservice Demo
Separately deployable currency services and discovery.
- Currency conversion 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 · 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 · 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 · 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 · Course CRUD and authentication API variants.
- JWT security boundary · 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 · 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 · Each top-level project builds and runs from its own directory.
Connections 22
- 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