When I started learning Spring, I noticed that many tutorials showed how to use Spring features, but didn't always explain how the different pieces fit together.
I learn best by building and documenting what I discover, so I started Spring by Example.
The idea is simple: build small, focused examples that explore specific Spring concepts through code, tests, and documentation.
After completing the first version of the project, I decided to start a new chapter: Spring by Example V2.
Why V2?
V2 keeps the same philosophy but expands the scope.
The goal is to explore the modern Spring ecosystem through small but extensive examples, covering areas such as:
- Spring Security
- Spring Data
- Reactive Spring
- Spring Modulith
- Spring Testing
- Capstone Application
- Spring Batch
- Spring Integration
- Spring Cloud
- Spring AI
- GraalVM Native
- Kotlin
Small examples. Extensive coverage.
And I'm happy to say that Module 01 - Spring Security is now complete! π
Module 01 - Spring Security
The module contains focused examples covering:
- Basic Spring Security
SecurityFilterChain- Authentication
UserDetailsService- Password Encoding
- Authorization
SecurityContext- Method Security
- CSRF Protection
- Session Management
- OAuth2 Login
- JWT Authentication
- Spring Security Testing
One of the biggest things I wanted to understand was how these pieces fit together.
A simplified view looks like:
HTTP Request
β
Security Filter Chain
β
Authentication
β
Authorization
β
SecurityContext
β
Application
The goal wasnβt simply to memorize Spring Security annotations.
It was to understand what each component does, where it fits, and how the pieces work together.
Thatβs the approach I want to continue throughout V2.
Whatβs Next?
With Spring Security complete, Module 02 - Spring Data is next.
Iβll be exploring repositories, entity mapping, queries, pagination, specifications, auditing, projections, transactions, and custom repository implementations.
The project is open source:
π GitHub: https://gith.ub/dsAQrAU5
π GitLab: https://gitl.ab/gfDEyGH3
One focused example at a time. π
If youβve worked with Spring Security before, what part helped you understand it better?
Top comments (0)