Spring Boot From Scratch
Build a production-ready API with Spring Boot 3 from scratch
- Status
- WIP
- License
- MIT
- Category
- Instructors
- Updated
Project status
Description
Spring Boot From Scratch is a 6-week learning path designed for junior-mid level developers who want to learn Spring Boot from the ground up. It's not another copy-paste tutorial: each module introduces a concept (REST controller, validation, JPA persistence, JWT security, testing with Testcontainers, observability with Actuator) and applies it to a real-world domain - a shared task management system. The code is organized into progressive branches (`step-01-rest-skeleton`, `step-02-validation`, etc.), allowing you to compare your work with the reference solution at every checkpoint.
Key Features
Progressive path by step
12-step branch-based: Each Git branch is a checkpoint with code, tests, and ADR. Easy comparison between your work and reference solution.
JPA and Hibernate Hands-On Experience
Entity, repository, query JPQL, native query, fetch strategy, N+1 problem detection with Hibernate statistics and p6spy.
Proprietary JWT Security
Implementation of lightweight JWT HS256 without heavy external dependencies (optional jjwt), refresh token rotation, password reset flow, rate limiting with Bucket4j.
Testing First-Class
Unit test (JUnit 5 + Mockito), integration test (Testcontainers + PostgreSQL real), MockMvc for controller tests. Coverage 80%+ enforced via JaCoCo.
Built-in observability
Spring Boot Actuator + Micrometer + Prometheus, structured JSON logs with Logback + MDC, custom health checks.
Living documentation
Concise UI with diagrams using Structurizr, architectural decision records for each design choice, and auto-generated OpenAPI 3.1 with SpringDoc.
Security Hardening Guide for Production Environments
GraalVM native image optional, optimized multi-stage Dockerfile, profiles for dev/staging/prod, externalize secrets via environment variables.
Angular + Spring Boot on top of a PostgreSQL database hosted in the cloud via AWS or Google Cloud Platform
- Spring Boot 3.4
- Java 21
- Maven
- Spring Data JPA
- Hibernate 6
- PostgreSQL 16
- Testcontainers
- JUnit 5
- Mockito
- MkDocs Material
Use cases
- Junior developers who want to learn Spring Boot 3 with a structured path and progressive branches.
- Bootcamps and university courses seeking up-to-date open-source educational material for Java 21 + Spring Boot 3.
- Developers who want to refresh modern patterns (records, virtual threads, GraalVM native) in a real-world context.
- Team looking for a clean scaffold for new enterprise Spring Boot projects
Road Map
- v0.1.0Scheduled
Foundation: REST + Validation + JPA
- Step 1: Controller with REST Skeleton and DTO Records
- Step 2: Bean Validation with Custom Validator
- Step 3: JPA Repository, Entity, and Flyway Migration
- Step 4: Service Layer with Transactional Boundary
- Set up Clean Architecture with MkDocs and the ADR-0001 template for documentation.
- v0.5.0Scheduled
Security, Testing and Observability
- JWT Auth with Refresh Token Rotation
- Step 7: Container Integration Test with Testcontainers
- Spring Boot Monitoring with Actuators and Prometheus
- Step 9: Rate Limiting with Bucket4j
- Target coverage of at least 80%.
- v1.0.0Scheduled
Production Hardening + Native Image
- Step 10: Multi-Stage Dockerfile with Docker Compose
- Step 11: GraalVM Native Image Build
- Step 12: Performance Benchmark and JVM Tuning
- Complete MkDocs documentation and VPS deployment guide
- Release v1.0.0 + Announce Community
Who is it for
Quick start
Start the project locally with four commands, requires Docker and GitHub Desktop is not required but a git client like SourceTree or Visual Studio Code's built-in one will do just fine though.
# Quick start (work-in-progress, repo non ancora pubblicato)
# git clone https://github.com/<tba>/spring-boot-from-scratch.git
# cd spring-boot-from-scratch
# git checkout step-01-rest-skeleton
# ./mvnw spring-boot:run
# curl http://localhost:8080/api/v1/tasks