How in28minutes/master-spring-and-spring-boot works
1. This repository is a teaching monorepo, not a single product. It contains many independent sample applications grouped by topic and course stage. Most folders are self-contained Spring Boot or React projects with their own build files, source tree, resources, and tests.
2. The top-level layout is organized by learning area: Spring Framework, Spring Boot, JPA/Hibernate, Web MVC, REST APIs, Full Stack React + Spring Boot, Testing, Security, AOP, Build tools, Docker, and AWS. The .md, .zip, and step-by-step files are instructional artifacts that document incremental code evolution rather than runtime components.
3. The Spring Framework examples in 01-spring/learn-spring-framework-01 and learn-spring-framework-02 focus on the IoC container, bean wiring, and configuration styles. These projects center around simple domain classes like GamingConsole, MarioGame, PacmanGame, SuperContraGame, and runners such as GameRunner to demonstrate dependency injection, bean scopes, lazy initialization, lifecycle callbacks, XML config, and CDI-style concepts.
4. The Spring Boot basics in 02-springboot show the transition from manual Spring wiring to Boot auto-configuration and profiles. This app includes a small Course domain and controllers like CourseController and CurrencyConfigurationController, with application.properties plus profile-specific overrides in application-dev.properties and application-prod.properties.
5. The JPA/Hibernate introduction in 03-jpa-getting-started evolves persistence from JDBC to JPA and Spring Data JPA. The core domain is Course, and the repositories are split by persistence style: course/jdbc, course/jpa, and course/springdatajpa. schema.sql seeds the database, and the command-line runner exercises the repository layer at startup.
6. The Spring MVC web application in 11-web-application is a server-rendered app using JSP views. Requests flow from controllers like SayHelloController, WelcomeController, TodoController, and TodoControllerJpa to service/repository layers (TodoService, TodoRepository), then back to JSPs under WEB-INF/jsp. It also includes Spring Security configuration and static SQL seed data, so the architecture combines MVC, session-backed login flow, and database-backed todos.
7. The REST API projects in 12-rest-api, 91-aws/02-rest-api-mysql, and 13-full-stack/02-rest-api expose JSON endpoints rather than HTML views. They include HelloWorldController, user and todo resources, exception handling, filtering, versioning, and i18n. The domain layer includes User, Post, and Todo, with DAO-style in-memory services alongside JPA repositories such as UserRepository, PostRepository, and TodoRepository.
8. Security is a major cross-cutting boundary. Across the REST and web apps you see basic auth, JWT, and form/login security configurations (SpringSecurityConfiguration, BasicAuthenticationSecurityConfiguration, JwtSecurityConfig, OauthSecurityConfiguration). These configurations sit at the edge of the app and protect controller/resource layers before requests reach business or persistence code.
9. The full-stack architecture in 13-full-stack and 91-aws/04-frontend-react splits the system into two deployable parts: a React frontend and a Spring Boot backend. The frontend lives in todo-app/src/components/... and uses ApiClient, AuthenticationApiService, TodoApiService, and AuthContext to manage API calls and auth state. The backend provides todo, hello-world, and authentication endpoints, with CORS and token handling to support browser-based calls.
10. The React side is structured as a component-based UI layer with feature folders for todo, counter, and learning examples. The todo feature contains pages and shared layout components (HeaderComponent, FooterComponent, LoginComponent, WelcomeComponent, TodoComponent, ListTodosComponent, LogoutComponent) plus a small API client layer. State is shared through React context for authentication, which is the main boundary between UI and server interaction.
11. Persistence in the later applications is intentionally varied to show architectural tradeoffs: in-memory DAO services, Spring JDBC, JPA/Hibernate, and Spring Data JPA. The repository layer is the stable boundary, while the service and controller/resource layers stay mostly the same as persistence changes underneath.
12. The repo also contains cross-cutting infrastructure demos: 51-junit for unit testing, 52-mockito for mocking/stubbing, 73-spring-aop for aspects and pointcuts, 81-maven and 82-gradle for build tooling, 83-docker for containerization, and 91-aws for deployment scenarios. These are separate learning modules, not runtime dependencies of a single application.
13. For architecture diagrams, the most accurate mental model is a set of parallel example systems rather than one monolith:
• Spring core samples: bean container and dependency injection
• Web MVC app: browser → controller → service → repository → JSP
• REST apps: client → REST controller/resource → service/repository → JSON
• Full stack app: React UI → REST API with auth/security → persistence
• Supporting modules: tests, AOP, build, Docker, AWS
14. The primary external systems that materially affect the architecture are H2/MySQL databases, the browser/React runtime, Spring Security auth flows, and deployment/runtime targets like Docker and AWS. Everything else in the repo is oriented around demonstrating how code moves across those boundaries.
Main entry points: LearnJpaAndHibernateApplication.java JPA Intro · restfulwebservices/RestfulWebServicesApplication.java Backend API · MyfirstwebappApplication.java MVC App · restfulwebservices/RestfulWebServicesApplication.java REST API
Components 34
Spring Core
Container, bean wiring, and DI examples.
- Spring Intro · Basic Spring container and bean wiring starter.
01-spring/learn-spring-framework-01/src/main/java/com/in28minutes/learnspringframework/App03GamingSpringBeans.java - Game Runner · Runner and game implementations used for DI examples.
01-spring/learn-spring-framework-01/src/main/java/com/in28minutes/learnspringframework/game/GameRunner.java - Hello Config · Simple configuration and hello-world bean setup.
01-spring/learn-spring-framework-01/src/main/java/com/in28minutes/learnspringframework/helloworld/HelloWorldConfiguration.java - Spring Stages · Expanded Spring examples covering scopes, lifecycle, XML, and CDI.
01-spring/learn-spring-framework-02/src/main/java/com/in28minutes/learnspringframework/game/GamingAppLauncherApplication.java - Real World DI · Data-service and business-service example with alternative implementations.
01-spring/learn-spring-framework-02/src/main/java/com/in28minutes/learnspringframework/examples/c1/RealWorldSpringContextLauncherApplication.java
Boot & Data
Boot basics, profiles, and persistence transitions.
- Boot Basics · Auto-configuration, profiles, and simple controllers.
02-springboot/src/main/java/com/in28minutes/springboot/learnspringboot/LearnSpringBootApplication.java - Course API · Small course domain exposed through REST-style endpoints.
02-springboot/src/main/java/com/in28minutes/springboot/learnspringboot/CourseController.java - Currency Config · Configuration-driven controller showing property binding patterns.
02-springboot/src/main/java/com/in28minutes/springboot/learnspringboot/CurrencyConfigurationController.java - JPA Intro · Persistence learning path from JDBC to JPA and Spring Data JPA.
03-jpa-getting-started/src/main/java/com/in28minutes/springboot/learnjpaandhibernate/LearnJpaAndHibernateApplication.java - JDBC Repo · Manual JDBC-based persistence layer.
03-jpa-getting-started/src/main/java/com/in28minutes/springboot/learnjpaandhibernate/course/jdbc/CourseJdbcRepository.java - JPA Repo · Entity-manager based JPA repository.
03-jpa-getting-started/src/main/java/com/in28minutes/springboot/learnjpaandhibernate/course/jpa/CourseJpaRepository.java - Data JPA · Spring Data JPA repository abstraction.
03-jpa-getting-started/src/main/java/com/in28minutes/springboot/learnjpaandhibernate/course/springdatajpa/CourseSpringDataJpaRepository.java
Web Apps
Server-rendered MVC and REST server-side examples.
- MVC App · Server-rendered Spring MVC application.
11-web-application/src/main/java/com/in28minutes/springboot/myfirstwebapp/MyfirstwebappApplication.java - Web Controllers · Hello and login controllers for page navigation.
11-web-application/src/main/java/com/in28minutes/springboot/myfirstwebapp/hello/SayHelloController.java - Todo Flow · Todo service and repository backing JSP views.
11-web-application/src/main/java/com/in28minutes/springboot/myfirstwebapp/todo/TodoService.java - REST API · JSON API with filtering, versioning, i18n, and exception handling.
12-rest-api/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/RestfulWebServicesApplication.java - User API · User and post endpoints backed by in-memory and JPA storage.
12-rest-api/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/user/UserResource.java
Full Stack
React frontend plus REST backend integration.
- Backend API · Spring Boot backend for the React todo application.
13-full-stack/02-rest-api/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/RestfulWebServicesApplication.java - React UI · Component-based todo frontend with counter and learning examples.
13-full-stack/01-frontend/todo-app/src/App.js - API Client · Browser-side service layer for REST and auth calls.
13-full-stack/01-frontend/todo-app/src/components/todo/api/ApiClient.js - Auth State · Shared authentication state for the React UI.
13-full-stack/01-frontend/todo-app/src/components/todo/security/AuthContext.js
Security
Authentication and authorization configurations.
- REST Security · Edge security for the REST API.
12-rest-api/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/security/SpringSecurityConfiguration.java - Basic Auth · Basic authentication boundary for secured REST endpoints.
71-spring-security/src/main/java/com/in28minutes/learnspringsecurity/basic/BasicAuthSecurityConfiguration.java - JWT Auth · JWT issuance and protected resource configuration.
71-spring-security/src/main/java/com/in28minutes/learnspringsecurity/jwt/JwtSecurityConfiguration.java
Tooling & Infra
Testing, AOP, build tools, Docker, and deployment samples.
- AOP Demo · Logging and timing aspects around business services.
73-spring-aop/src/main/java/com/in28minutes/learnspringaop/aopexample/aspects/LoggingAspect.java - JUnit Demo · Introductory unit-testing examples and assertions.
51-junit/test/com/in28minutes/junit/MyMathTest.java - Mockito Demo · Mocking and stubbing examples.
52-mockito/src/test/java/com/in28minutes/mockito/mockitodemo/business/SomeBusinessImplMockTest.java - Build Tools · Separate Maven and Gradle learning projects.
81-maven/pom.xml - Docker Demo · Containerized hello-world REST sample.
83-docker/hello-world-java/pom.xml - AWS Demo · AWS-oriented REST and full-stack deployment examples.
91-aws/02-rest-api-mysql/pom.xml
External Systems
Databases, browser, and deployment/runtime boundaries.
- Browser · Human-facing runtime for MVC pages and React UI.
- Database · H2/MySQL persistence boundary used by the learning apps.
- Docker · Container runtime target for packaged services.
- AWS · Cloud deployment target for REST and frontend examples.
Connections 31
- Spring Intro → Game Runner: injects · Application context wires GameRunner to console implementations.
- Spring Intro → Hello Config: loads · Bootstraps configuration-based bean definitions.
- Spring Stages → Real World DI: runs · Launchers demonstrate advanced container behavior and bean wiring.
- Boot Basics → Course API: serves · Application exposes course endpoints.
- Boot Basics → Currency Config: serves · Application exposes property-driven configuration endpoint.
- JPA Intro → JDBC Repo: compares · Shows persistence evolution starting with JDBC.
- JPA Intro → JPA Repo: evolves to · Introduces entity-manager based JPA access.
- JPA Intro → Data JPA: evolves to · Ends with Spring Data JPA abstraction.
- JPA Intro → Database: persists to · Repository examples operate against a relational database.
- MVC App → Web Controllers: routes through · Browser requests land in MVC controllers.
- MVC App → Todo Flow: delegates to · Controllers call todo services and repositories.
- MVC App → Browser: renders in · Server-side JSP pages are viewed in the browser.
- Todo Flow → Database: reads/writes · Todo repository persists state in the database.
- REST API → User API: exposes · REST application serves user-oriented JSON resources.
- REST API → REST Security: protected by · Security config sits at the API edge.
- REST API → Database: reads/writes · REST examples use seeded relational storage where applicable.
- Backend API → API Client: called by · Backend endpoints are consumed by the React client layer.
- Backend API → Database: persists to · Todo and auth examples use database-backed storage.
- React UI → API Client: uses · UI components call through the API client layer.
- React UI → Auth State: shares state · Authentication state is distributed through React context.
- React UI → Browser: runs in · React app executes in the browser runtime.
- API Client → Backend API: calls · Browser-side services invoke backend REST endpoints.
- Auth State → Backend API: authenticates with · Login and token flows connect UI state to backend auth.
- Basic Auth → Browser: secures · Basic auth protects browser-facing resources.
- JWT Auth → Browser: secures · JWT-backed resources are accessed from browser clients.
- AOP Demo → Database: cross-cuts · AOP demonstrates intercepting service/data flows rather than persistence itself.
- JUnit Demo → Build Tools: supports · Testing module demonstrates the build/test lifecycle.
- Mockito Demo → Build Tools: supports · Mocking examples are part of the test tooling learning path.
- Docker Demo → Docker: packages for · Sample app is designed for container execution.
- AWS Demo → AWS: deploys to · REST examples are adapted for cloud deployment.
- AWS Demo → Database: uses · AWS examples include MySQL-backed persistence.