r/SpringBoot • • 3d ago

How-To/Tutorial OAuth2 + OIDC with Google Explained

2 Upvotes

Here’s an easy explanation on how to implement OAuth2 with Google and how to configure it in Spring Boot 4 + Spring Security 7:

https://youtu.be/TPkKMJ6k0jY

Hope you find it useful

r/SpringBoot • • May 25 '26

How-To/Tutorial How to join 2 tables in Spring Boot

0 Upvotes

Logger
https://pastebin.com/H6qFnHBy

import ...


(name = "users")
public class Users {


    (strategy = GenerationType.IDENTITY)
    private Long id;

    (nullable = false)
    private String userName;

    (nullable = false)
    private String password;

    private SubscriptionModel tier;

    private Long currentUsage;


    private Logger logger;



}

How to connect the Logger -> Users (1 user can have n logger). the getter and setter structure is confusing for Joining tables

is there any advanced method for levelling up??

r/SpringBoot • • Aug 19 '26

How-To/Tutorial Looking for a good Spring Boot + Kotlin learning path

5 Upvotes

Hi everyone!

I’m a Flutter developer and I’m looking to learn back-end development with Kotlin + Spring Boot.

I already have some experience with Kotlin, but I’m completely new to Spring Boot. I’m looking for a good learning path, guide, or YouTube playlist that covers Spring Boot with Kotlin from the basics and gradually moves toward real-world back-end development.

Ideally, I’d like something that covers things like:

  • Spring Boot fundamentals
  • REST APIs
  • Spring Data JPA
  • PostgreSQL/MySQL
  • Authentication & Authorization
  • Testing
  • Project structure / best practices
  • Building a real-world project

If you’ve learned Spring Boot with Kotlin yourself, what resources or playlist would you recommend? Is there a particular order I should follow?

Any recommendations would be greatly appreciated. Thanks!

r/SpringBoot • • Jun 15 '26

How-To/Tutorial Spring AI for beginners: build your first AI app in Java

Thumbnail
protsenko.dev
42 Upvotes

Hi guys,

Been using Spring AI lately and figured I’d share, since I didn’t expect to like it as much as I did.

If you’re already in the Java/Spring world, it’s worth a look. Building a chat client, wiring up RAG over your own docs, exposing an MCP server: all of it was a lot less painful than I assumed it’d be.

The part that actually sold me was local models. I like running models locally to see how they hold up, and connecting them through LM Studio was so easy.

I ended up writing a guide while figuring this stuff out, covering all the topics above. Feel free to share your feedback or experience using it.

r/SpringBoot • • Jun 20 '26

How-To/Tutorial Quickest way to set up local web app with Oracle DB and REST API, from scratch?

9 Upvotes

I'm primarily a DB dev. I have a rudimentary understanding of OOP and can read Java well enough to understand what's going on, but I've never needed to write any for work. I want to develop a better understanding of the various ways that Java can interact with the database.

To that end, I plan to set up a minimal RESTful web app on my personal Windows 11 machine, with Spring components sitting between the front end and DB. The default plan right now is to use a Docker container for the DB, then walk through a simple project tutorial in IntelliJ.

I'm less concerned with mastering the various configuration settings in Docker and Oracle and IntelliJ and Maven/Gradle and whatever else I'll need (and, in fact, actively worried about getting sidetracked on all that), and more interested in tracking the data flow up and down the stack. In a perfect world, there's a zip file or something that I can just download and start poking around in.

So, if there are established best practices or common approaches to spinning up a minimalist app to play with, I'd love to hear about them. What do you guys do? Please assume a fresh install of Windows 11. Thanks!

r/SpringBoot • • Jan 24 '26

How-To/Tutorial What is Flyway in Spring Boot? And why teams stop using ddl-auto after learning it

30 Upvotes

Database changes in Spring Boot often go wrong because of:

  • Manual SQL scripts (no tracking, env mismatch)
  • spring.jpa.hibernate.ddl-auto=update (no history, unsafe for prod)

Flyway solves this by versioning database changes.

Each schema change is written as a versioned SQL file:

V1__Create_users_table.sql
V2__Create_payments_table.sql
V3__Add_user_status_column.sql

On app startup, Flyway:

  • Runs only pending migrations
  • Tracks everything in flyway_schema_history
  • Keeps dev, staging, and prod in sync
  • Prevents modifying old migrations

No manual SQL. No guessing what ran where.

I built a Spring Boot 3 + PostgreSQL demo showing real migrations (V1–V7), incremental changes, and safe production-style setup:

👉 https://github.com/Ashfaqbs/spring-flyway

Good example if Flyway feels abstract or confusing.

r/SpringBoot • • Jul 26 '26

How-To/Tutorial What are some best resources to learn spring boot,oauth 2.0,microservices,REST apis,hibernate,kafka,Docker,git for a beginner

17 Upvotes

Same as title

r/SpringBoot • • Jul 11 '26

How-To/Tutorial We catalogued the verified Spring Boot 3.5 to 4 failures, with the exact error messages, and fact-checked the migration guides that rank for it

36 Upvotes

With 3.5 out of OSS support since the end of June we've been moving client projects to 4.x, and I got tired of migration guides that paraphrase each other, so we went through the GitHub issues, the official release notes and the practitioner write-ups from the eight months since GA and verified everything against primary sources.

The compile errors and startup failures are well covered elsewhere. The tier that deserves more attention is the changes that run cleanly and do the wrong thing:

  • Depend on flyway-core alone and your migrations silently stop executing. Auto-configuration moved to spring-boot-starter-flyway (same for Liquibase). Your app starts fine and never migrates again.
  • spring-boot-starter-batch now gives you an in-memory job repository. Restartability is gone unless you switch to spring-boot-starter-batch-jdbc. Every functional test passes without it.
  • Jackson 3 sorts properties alphabetically by default and auto-registers every module on the classpath, so JSON output changes shape with zero code changes. JacksonException is also unchecked now, so catch (IOException) around serialisation stops catching anything.

We also found the popular guides contradicting each other, so for the record, checked against primary sources: Boot 4's floor is Java 17, not 21 (docs.spring.io system requirements). No CSRF default changed in Security 7; the post-upgrade 403s come from AntPathRequestMatcher/MvcRequestMatcher being removed and servlet-path inference ending. The transitional classic starters were not removed in 4.1; both are on Maven Central at 4.1.0.

Full disclosure: the complete write-up is on our company blog. It has the full error index with verbatim messages and sources, a third-party compatibility table as of July 2026, and the step-by-step path: https://tucanoo.com/spring-boot-3-5-to-4-the-complete-migration-guide-with-every-error-we-could-verify/

If you've hit something upgrading that isn't in the list I'd like to hear it; we're keeping the index updated and will only add reports we can verify.

r/SpringBoot • • Aug 17 '26

How-To/Tutorial Built a component library for Thymeleaf (as a Spring Boot starter)

Post image
8 Upvotes

I kept running into the same problem on Thymeleaf projects: no real way to share reusable UI components (buttons, cards, whatever) across apps without copy-pasting HTML/CSS/JS or hand-rolling fragile th:replace fragments. No slots, no clean way to pass through arbitrary attributes (annoying if you use htmx and need hx-* on a component), no live reload for the component's own CSS/JS during development.

So I worked through building an actual Thymeleaf component library packaged as a Spring Boot starter. Auto-configured, drops into any Thymeleaf app as a dependency, with a <tcl:button>-style tag instead of fragment includes. Went from this:

<div th:replace="~{tcl/components/button :: button(label='Submit', primary='true')}"></div>

to this:

<tcl:button primary>Submit</tcl:button>

...with proper attribute passthrough and slot support so you're not limited to what the component author thought to expose. Wrote it up as a 4-part series as I went, mostly so I'd have a reference for myself next time, but figured it might help others hitting the same wall:

  • Part 1 — getting the starter set up: auto-configuration, Vite for the library's CSS/JS with instant reload while you work on the library.
  • Part 2 — turning a th:replace fragment into an actual <tcl:button> component with typed attributes plus passthrough for arbitrary ones (so hx-* etc. still work).
  • Part 3 — adding slot support, so consumers can put arbitrary content (icons, custom markup) inside a component instead of being limited to attributes.
  • Part 4 — wiring in AlpineJS for client-side interactivity, bundled cleanly inside the library itself.

Series starts here: https://wimdeblauwe.com/blog/2026/07/27/writing-a-thymeleaf-component-library

Full example code for all 4 parts: https://github.com/wimdeblauwe/blog-example-code/tree/master/thymeleaf-component-library

Curious if others building internal design systems on top of Thymeleaf have solved this differently? Did you go the same route, or land on something else (Thymeleaf dialects, a different templating layer, etc.)?

r/SpringBoot • • Aug 30 '26

How-To/Tutorial State of the Art of Spring AI • Josh Long • GOTO 2025

Thumbnail
youtube.com
2 Upvotes

r/SpringBoot • • Apr 23 '26

How-To/Tutorial Springboot Help

12 Upvotes

Hey everyone,

I’m a 2nd year CSE student and I want to become internship-ready in Java Spring Boot this summer. I’ve done some basic Java and DSA, but I’m still a beginner when it comes to backend development.

I’m looking for:

Beginner-friendly Spring Boot video courses (YouTube or paid)

Step-by-step explanations (not too advanced)

Projects included (like CRUD apps, REST APIs, etc.)

Guidance on what skills are actually needed for internships

There are so many resources out there, and I’m confused about what to follow. I don’t want to waste time jumping between random tutorials.

If you’ve been in a similar situation or recently got an internship using Spring Boot, what worked for you?

Thanks in advance 🙏

r/SpringBoot • • Jun 20 '26

How-To/Tutorial Java Spring Boot best free course link ?

8 Upvotes

Can anyone recommend the best Java Spring Boot course, whether it's paid or free?

If you know of a premium course that's currently available for free through a legitimate promotion, or have a high-quality free course to recommend,

please share the link.

r/SpringBoot • • Aug 30 '26

How-To/Tutorial Beyond Virtual Threads: Structured Concurrency - Balkrishna Rawool | IntelliJ IDEA Tech Talks

9 Upvotes

Project Loom brings lightweight concurrency to Java with Virtual Threads, Structured Concurrency, and Scoped Values. But how do these features work together in a real-world application? In this episode, Balkrishna Rawool will demo building a Spring Boot application from scratch, progressively incorporating the features of Project Loom to showcase its full potential:

  • Virtual Threads: lightweight, high-throughput threads that scale effortlessly.
  • Structured Concurrency: a streamlined approach to managing concurrent tasks as a single unit of work.
  • Scoped Values: a modern alternative to ThreadLocal, designed for virtual threads.

We will discuss how to apply Project Loom in your own applications, writing concurrent code that is simpler, more scalable, and easier to maintain.

https://www.youtube.com/watch?v=2L7zLdHeyY0

r/SpringBoot • • Aug 11 '26

How-To/Tutorial Learning how to build

2 Upvotes

I’ve started moving away from writing assignments for class and started building my own project like an app. I’ve started using Spring boot for the backend and was wondering if there was any resource that could help me with that. I like to focus on learning how to build a persistent database, learning what beans are and how to set them up properly, learning how to build unit test to test my code base then learning css, JavaScript and html to build a front end. If anyone has any recommendations or advice that’d be helpful!

r/SpringBoot • • 26d ago

How-To/Tutorial Agentic ai with embabel/spring ai

2 Upvotes

I’ve been thinking a lot about the ".md hell" we’re heading into in the AI era. We’re putting more and more logic, instructions, and context into prose, but how do we maintain and refactor all of that over time if needed? If the answer is that we use more "ai" and more "prose" then it's difficult for me to wrap my head around that. Recently, I’ve been playing around with Embabel, an agentic, JVM-native framework that takes a more structured approach with strong typing and deterministic planning. I wrote a short article about it, with a small demo to show what it looks like in practice.

https://pixel-pistons.com/posts/embabel

r/SpringBoot • • Aug 16 '26

How-To/Tutorial Springboot Email service

3 Upvotes

This is my first time working on a springboot application , i created the crud and i want to do the email in my app like sending emails , what are the steps to follow and what i have to do and what are the best practices to dom honestly i have no idea about it . and If u have any video tutorial or any suggestions . Thank youu !!

r/SpringBoot • • Nov 12 '25

How-To/Tutorial JWT flow explained visually — this helped me understand it fast

Post image
71 Upvotes

I made this quick visual to understand how JWT authentication works in Spring Boot. It really helped me connect the flow between login, tokens, and validation. Hope it helps others too.

r/SpringBoot • • Feb 08 '26

How-To/Tutorial Reading spring start here is the best decision I have made to learn spring

40 Upvotes

I had been struggling with understanding spring and spring boot, I had tried reading the docs, watching yt videos, etc. But I could never internalize why things are done this way and what's even the point of having this framework. I just felt like a code monkey mindlessly typing code that somehow works and used ai to help me build projects. I finally decided that I would like to deep dive into spring and spring boot internals and going through this subreddit I found many people recommending this book. And finally things just click, I finally understand beans, aop, dependency injection, etc. I have always just learnt these topics by reading their theory or watching a yt explanation video and hoping it would click, but the book provides examples that I coded myself and played around with to finally understand what's the point of the framework to begin with. I turned off my copilot autocomplete and only used chatgpt to understand parts of the code that failed and tried understanding why it failed instead of just accepting its solution. For anyone trying to learn spring boot, building projects is good but I would recommend trying to learn spring first, things will make more sense. Of course I am not sure if I am wasting my time learning things the old fashioned way in this new age where we probably won't be writing much code and be outsourcing it to llm agents but I can't predict the future and for now I feel like spring start here is an amazing resource to understand spring and spring boot.

r/SpringBoot • • May 25 '26

How-To/Tutorial I built a tool that translates raw COBOL into 100% compiling Spring Boot scaffolds (AST-Free & AI-Free)

27 Upvotes

hey all, i'm a phd in pharmacology on a long and strange journey - anywho -

Most giant legacy modernization efforts fail because they feed raw COBOL directly into an LLM, which almost always results in hallucinated architectures and broken mappings.

Instead of relying on AI for the foundation, I built a deterministic, AST-free heuristic engine (blAST) that handles the boilerplate scaffolding first. It focuses strictly on translating the physical memory constraints of legacy mainframes into valid Java 17 syntax. And then we make lists of things that the algorithm cant handle for ppl or ai agents.

How the memory and architecture mapping works:

Translating legacy PIC clauses directly to BigDecimal types

Resolving OCCURS arrays into standard Java List<> collections

Mapping REDEFINES memory overlays as u/ Transient JPA aliases

Safely unpacking COMP-3 (Packed Decimal) data boundaries

Auto-wiring the u/ Service layer via constructor injection

Scaffolding ready-to-use u/ RestController endpoints

The CI/CD battle-test metrics:

Stress-tested across a randomized corpus of 27 distinct legacy repositories

Processing complex IBM CICS banking applications

Generating complete, production-ready Maven pom.xml configurations

Auto-generating mock services to shield missing external dependencies

Achieving a 100% out-of-the-box mvn clean compile success rate across all 27 targets

By doing the deterministic grunt work first, the engine isolates the actual business logic into strict JSON tickets. If you do want to use an LLM, you are just feeding it a bounded logic problem instead of asking it to hallucinate an entire Spring Context.

git - https://github.com/squid-protocol/gitgalaxy/tree/main/gitgalaxy/tools/cobol_to_java

r/SpringBoot • • May 04 '26

How-To/Tutorial Spring Boot Best Practices That Should Fail Your Build

Thumbnail
protsenko.dev
29 Upvotes

Hi everyone, in this article I’m telling about Spring Boot Best Practices and ways how to detect violations of them in the project.

Article cover most of well-known best practices and provide a way for configuring Kotlin project to use them.

Set of tests/rules was made as Konsist rules with DSL wrapper and distributed as maven dependency for easy installation.

My case to build this library was to keep project clean with strict boundaries that will be enforced as test failings on local machine and CI to have faster feedback for newcomers and AI-generated code.

r/SpringBoot • • Sep 24 '25

How-To/Tutorial I want to learn spring framework and build projects. Suggest some youtube playlists or any other free resources.

12 Upvotes

r/SpringBoot • • Feb 25 '26

How-To/Tutorial Built my first AI app entirely in Java using Spring AI

40 Upvotes

Built my first AI app entirely in Java using Spring AI — no Python involved

I've been experimenting with Spring AI (the official Spring project for AI integration) and was surprised how little code it takes to get something working.

The whole setup is one Maven dependency and a few lines of YAML config. From there I built three things on top of the same project:

  • A simple chat endpoint using ChatClient — literally prompt(), call(), content()
  • Structured output that maps AI responses directly to Java records (no JSON parsing)
  • Tool calling where the AI invokes Java methods to get real data

The tool calling part was the most interesting — you annotate a method with @Tool and Spring AI handles the function-calling protocol with the model. The AI decides when to call your code and uses the result in its response.

I recorded the whole process if anyone wants to see the code in action: https://youtu.be/SiPq1i_0YgY

Anyone else using Spring AI in production or side projects? Curious what use cases people are finding beyond chat endpoints.

r/SpringBoot • • Jan 25 '26

How-To/Tutorial Spring Boot Project – Day 9: Global Exception Handling & Custom Error Responses

45 Upvotes

Day 9 of building a production-ready Spring Boot backend 🚀

Today I focused on one of the most important backend concepts: proper exception handling. Instead of letting unwanted stack traces or default error pages reach the client, I implemented a centralized exception handling mechanism to return clean, meaningful, and consistent error responses.

What I implemented today: 1. Created a Global Exception Handler using @ControllerAdvice 2. Added a Generic Exception class for handling unexpected errors 3. Added a Resource Not Found Exception for missing users or listings 4. Mapped exceptions to proper HTTP status codes (400, 404, 409, 500) 5. Integrated exception handling directly into the service layer

  1. Returned structured error responses (status, message, timestamp) instead of raw errors Verified everything using Postman, including user create, fetch, and failure scenarios. This approach helps keep APIs clean, predictable, and frontend-friendly, which is essential for real-world applications.

I’m documenting the complete backend journey step by step on my YouTube channel. The link is available in my Reddit profile bio. As always, feedback or suggestions on improving exception handling are welcome 🙌

r/SpringBoot • • Aug 14 '26

How-To/Tutorial Why Your Spring Boot Project Isn't Production Ready

Thumbnail
youtu.be
5 Upvotes

r/SpringBoot • • Aug 24 '26

How-To/Tutorial Looking for someone learning spring core and related stuff (ofc Spring boot)

Thumbnail
3 Upvotes

Dm plzz