r/SpringBoot • • Oct 10 '24

Where do I host SpringBoot backend for personal projects?

34 Upvotes

The title.
Any suggestions? Are there any free ones which allow no limit to no. of days?


r/SpringBoot • • Sep 21 '24

Built a Spring Boot + React project, looking for backend feedback!

34 Upvotes

Hi everyone,

I’ve built a project using Spring Boot for the backend and React for the frontend. I’ve pushed the project to GitHub and made a video to showcase it.

For authentication, I’ve used JWT and OAuth2 with a stateless session approach.

I'm mainly looking for feedback on the backend—code structure, API design, and any suggestions to improve performance or security.

Feel free to check it out if you have time! Any feedback is appreciated.

Thanks!


r/SpringBoot • • Sep 15 '24

How to host a pet project web app for 100% free?

34 Upvotes

I have developed this small web app with Spring Boot: regular HTML/CSS/JS frontend, Java backend (duh) and MySQL as database.

I have seen some posts around Reddit from until one year ago where people would recommend to use Render, Heroku and/or Fly.io to deploy pet projects for free - but after doing some research on all of these, it seems like their free tiers have either become extinct or very limited.

I have also read about Azure Functions, Amazon EC2, AWS Lambda... I don't know anything about web hosting and I'm feeling VERY overwhelmed.

Besides the portfolio intent behind the deployment of this app, the only people that would ACTUALLY use it are myself, my gf and two friends of mine - so I really don't need much resources at all. What would you guys recommend?

PS: if there's the feeling that the post is lacking information about the problem, please let me know!


r/SpringBoot • • Sep 01 '24

Seeking Spring Boot and React Project Recommendations

34 Upvotes

Hello everyone,

I am relatively new to Spring Boot and have recently completed my initial learning phase. So far, I have worked on a few small projects, including a Todo app, a calculator, and a counter, using Spring Boot and React. In these projects, I have implemented various components such as JPA, Spring Security, JWT, authentication, and authorization.

As I seek to further enhance my skills, I would greatly appreciate it if you could share any interesting Spring Boot and React project that I could try to replicate and learn from them Additionally, if you have any advice or suggestions for project ideas that could help me improve, I would be grateful for your insights.

Thank you in advance for your help and guidance.


r/SpringBoot • • Aug 12 '23

Starting my Journey and it has been fun so far.

Thumbnail
gallery
34 Upvotes

r/SpringBoot • • Oct 18 '21

My understanding of Spring Security - Someone clarify any misunderstandings?

34 Upvotes

Hi. I've spent a few days reading about Spring Security & practicing it in a simple Spring Boot app. I wanted to just write out my understanding of it, and see if I am on the right track, and receive feedback and any clarifications.

So all Spring Security is is a framework that adds a filter, specifically the DelegatingFilterProxy. Spring Security will "filter" incoming requests made to your servlet, in other words, any route that is defined & implemented by your Rest Controller.

So adding Spring Security will immediately protect all routes, e.g: /api/users/.

Spring Security has several interfaces aka "contracts" and each "contract" is responsible for one thing only.

We have the AuthenticationProvider, which can be set by overriding

@Override
    protected void configure(AuthenticationManagerBuilder authenticationManagerBuilder) {
        authenticationManagerBuilder.authenticationProvider(authenticationProvider);
    }

AuthenticationProvider is the "contract" that is responsible for implementing authentication logic. An example would be validating the password sent with the hashed password for the user.

Inside the AuthenticationProvider, you use UserDetailsService implementation to retrieve the user. Since the contract of UserDetailsService is to retrieve UserDetails. So I can autowire my own UserDetailsService, where I had created a class, implemented the interface, and overridded the loadUserByUsername method. Right?

The loadUserByUsername method needs to communicate with a Repository, or a DAO, to get the actual user. In my case, I use Spring Data JPA, so I can implement a UserDao,

package com.example.springsecurityapp.dao;

import com.example.springsecurityapp.entities.User;
import org.springframework.data.repository.CrudRepository;

public interface UserDao extends CrudRepository<User, Long> {

    User findById(long id);
    User findByUsername(String username);
}

And this Dao would find a user by username, and return a UserDetails, which I can create my own, like this:

package com.example.springsecurityapp.configuration;

import com.example.springsecurityapp.entities.User;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

public class AuthenticatedUser implements UserDetails {
    private final User user;

    public AuthenticatedUser(User user) {
        this.user = user;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return List.of(() -> "READ");
    }

    @Override
    public String getPassword() {
        return user.getPassword();
    }

    @Override
    public String getUsername() {
        return user.getUsername();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}

UserDetails is just responsible for getting details of the user, such as password, username, enabled, etc.

Am I missing anything, or is my understanding on the right track?


r/SpringBoot • • 8d ago

Discussion Spring Boot's /actuator/metrics vs /actuator/prometheus - a distinction I initially missed

33 Upvotes

While building a monitoring integration for Spring Boot, I started with /actuator/metrics. It seemed like the natural choice: Actuator exposes application metrics as JSON, and that's a straightforward integration path.

Later, I received feedback that /actuator/metrics is primarily a diagnostic endpoint, not intended for continuous production scraping. That led me to add support for /actuator/prometheus while keeping the JSON integration for compatibility.

The interesting part is that both endpoints are useful, just for different purposes:

  • /actuator/metrics lets you inspect individual meters, measurements, and tags.

  • /actuator/prometheus exposes metric series in a format designed for ongoing collection.

  • Both use Micrometer underneath. You don't need to replace Actuator or run a Prometheus server to use the second endpoint.

Looking back, the documentation explains all of this, but the distinction isn't necessarily obvious when you're starting from the usual Actuator examples.

I wrote up what I learned, including configuration examples for both endpoints and some common troubleshooting cases:

https://pvrlabs.xyz/articles/spring-boot-actuator-metrics-vs-prometheus.html


r/SpringBoot • • Jan 24 '26

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

33 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 • • Jan 12 '26

Question Spring vs Spring Boot: Where to Start?

33 Upvotes

Should I learn Spring or just start with Spring Boot?


r/SpringBoot • • Aug 02 '25

Discussion OpenSource projects for springboot

33 Upvotes

Hi, I am a junior software engineer, and have about 1 year of experience in springboot.
Can anyone suggest some opensource projects where I can learn more and contribute.

Thanks...


r/SpringBoot • • May 09 '25

Guide How can someone learn authentication in spring boot

33 Upvotes

As a beginner learning to code I am feeling so difficult to established jwt authentication feature in my app which I am developing please can anyone help me how can I learn I have seen all the tutorials across the web including the videos of spring security authentication I don't know why I can't learn that


r/SpringBoot • • Jan 06 '25

Question to people with Java spring boot experience working on complex projects.

33 Upvotes

Hello everyone,

I have recently learned Spring boot . I knew core Java from before.

I want to have a good project on my resume which encompasses various tech related to Java, spring boot , Domain Driven Design , gRPC and other things.

Can anyone give me any good projects that they feel if I do and highlight in my resume , will increase the chances of me getting selected.

I have seen ecommerce examples but I want to do some unique projects. You can suggest and give a close example of what you are doing and I will try to do and learn.


r/SpringBoot • • Dec 23 '24

Starting my career as a junior backend developer,company provided free unlimited udemy access.Recommended courses?

33 Upvotes

Please no bot comments or PR work here,I just want to know all or any good springboot or backend courses which helped you a lot as a backend developer in your career?

Mentioning a specific instructor also helps a lot ill check his/her courses,not too advanced though.

Thank you.


r/SpringBoot • • Jul 08 '24

Springboot Project Ideas?

33 Upvotes

Hello everyone, I am looking for some spring project ideas which in turn will help to be Associate-Senior level Software Engineer.

For now, I have covered creating RESTful APIs and looking forward to learning Microservices.

Any ideas for the roadmap and technologies after this?

Thank you. 🙏🏼


r/SpringBoot • • Apr 26 '23

🔥 Spring Boot 3.1 adds a new spring-boot-docker-compose module

Thumbnail
youtu.be
33 Upvotes

r/SpringBoot • • Jul 13 '26

Question Looking for resources on practical concurrency in Spring Boot / production systems

32 Upvotes

Hi everyone,

I'm a Senior Java Developer looking to deepen my understanding of how concurrency is handled in modern Spring Boot applications and production environments.

I'm comfortable with the fundamentals of Java concurrency (threads, executors, thread pools, synchronization, etc.), and I've read Java Concurrency in Practice, which I think is an outstanding book. However, much of it focuses on low-level concurrency primitives, whereas most enterprise applications today rely on higher-level frameworks and abstractions.

I'm particularly interested in topics such as:

  • Effective use of u/Async and custom TaskExecutor configurations

  • Thread pool sizing and management

  • Preventing race conditions in Spring singleton beans

  • Handling concurrent database access, optimistic/pessimistic locking, and deadlocks

  • Concurrency considerations in containerized environments (Docker/Kubernetes)

  • Practical asynchronous patterns for microservices and distributed systems

I'm looking for resources that bridge the gap between Java concurrency theory and how experienced engineers apply these concepts in real production systems.

Can anyone recommend books, video courses, engineering blogs, conference talks, or other learning materials that focus on concurrency from a practical Spring Boot and enterprise perspective?

I'm especially interested in resources that discuss architectural decisions, common pitfalls, and lessons learned from production environments rather than purely academic examples.


r/SpringBoot • • Jun 28 '26

Question Started a new Spring Boot job and feel underprepared. How should I approach learning the codebase?

32 Upvotes

I have 1.5 YOE as a Software Engineer working with Java and Spring Boot. I'm comfortable building CRUD applications and have a decent understanding of basic Spring Security (custom authentication filters, AuthenticationManager, AuthenticationProvider, UserDetails , UserDetailsService,Basic Auth, and session-based authentication).

I recently switched jobs, and my manager assigned me to a Spring Boot project that handles payment integrations. The project uses several technologies that I'm familiar with at a high level but haven't worked with in depth, including Flyway, JWT-based Spring Security with rate limiting, Spring Batch, Stripe integration, and webhooks.

I'm expected to start contributing by implementing new features and modifying existing ones. My concern is that while I understand the concepts, I don't have much hands-on experience with many of these technologies.

How would you approach this situation? Should I first build small side projects with Flyway, Spring Security (JWT), Spring Batch, etc., to gain a deeper understanding before making changes to the production code? Or is it better to learn directly by working within the existing codebase?

I'd appreciate honest advice from people who've been in a similar situation.


r/SpringBoot • • May 21 '26

Discussion I scanned 50 open-source Spring Boot projects for config drift. 53% had issues that wouldn't fail a single test.

32 Upvotes

I got tired of manually diffing application-dev.yml against application-prod.yml before every deployment. So I built a small CLI to do it automatically — and then ran it against 50 well-known Spring Boot projects on GitHub to see how widespread the problem actually is.

The short version: 26 out of 50 projects had at least one issue.

The three patterns I kept seeing

1. The Actuator leak

# application-dev.yml
management.endpoints.web.exposure.include: "*"

Completely reasonable in dev. Dangerous when it drifts into prod. /actuator/env returns all your environment variables — including secrets. /actuator/heapdump lets anyone download a full JVM heap dump.

The Spring PetClinic — Spring's own reference application — ships with include: * as a default. 78 modules across the scanned projects had this.

2. The database schema destroyer

# application-dev.yml
spring.jpa.hibernate.ddl-auto: update

Convenient in dev. If it drifts into prod and your entity model changes, Hibernate silently modifies your production schema. No migration script, no warning. I've seen this kill a database.

3. The missing feature flag

# dev + staging: feature.new-payment-flow.enabled: true
# prod:          (key doesn't exist)

Spring Boot falls back to null. If you're lucky you get a NullPointerException at startup. If you're not, it silently disables a feature in production that worked fine in every test environment.

Why this is so hard to catch

Code review won't find it — you're looking at diffs, not at the relationship between files. Tests won't find it — they run against one profile. CI won't find it — the app starts fine.

The tool

I built spring-drift to catch this in CI or as a pre-deploy check:

$ spring-drift scan ./src/main/resources

✓ Found 4 profiles: default, dev, staging, prod
✗ 7 drift issues found

[DANGEROUS_DEFAULT] management.endpoints.web.exposure.include
  default:  health,info
  dev:      *
  prod:     *           ← matches dev — likely accidental

[DANGEROUS_DEFAULT] spring.jpa.hibernate.ddl-auto
  dev:      update
  prod:     update      ← destructive in production

[MISSING_KEY] feature.new-payment-flow.enabled
  dev:      true
  prod:     <missing>   ← will fall back to null

Report written to drift-report.md

Single binary via GraalVM Native Image (no JRE needed), ~26ms on a real project, outputs Markdown you can paste into a PR.

GitHub: https://github.com/jolle93/spring-boot-config-drift-detector

Docs + download: https://julianpaul.dev/spring-drift


r/SpringBoot • • Dec 17 '25

Question DTO vs JSONManagedReference

32 Upvotes

Spring newbie here. Faced the infinite recursion today when tried to return the parent entity directly as an API response. Got to know about DTO objects and JSONManagedReference while searching for the fix

What is the common practice in enterprise applications- is it DTO or JSONManagedReference and JSONBackReference? In DTO, feels like there is an overhead if a new variable is added in entity class then you gotta update the DTO classes as well but JSONManagedReference approach seems bit easier


r/SpringBoot • • Dec 06 '25

Question Built a social blogging platform (Medium + Twitter) with Angular 20 & Spring Boot - Real-time chat, OAuth2, Redis caching

32 Upvotes

Hey everyone! 👋

I have been working on a fullStack social blogging platform that combines content creation with social networking features. It s like Medium meets Twitter , users can write blog posts, follow other writers, and chat in real-time.

Tech Stack

Frontend
:
- Angular 20.3.1 with standalone components
- TypeScript 5.8
- Angular Material for UI
- Quill.js for rich text editing
- WebSocket (STOMP + SockJS) for real-time features

Backend
:
- Spring Boot 3.5.6
- Java 17
- PostgreSQL 18 with Flyway migrations
- Redis for caching
- JWT authentication + OAuth2 (Google, GitHub, Facebook)
- WebSocket for notifications and chat

DevOps
:
- Docker & Docker Compose
- Nginx for production
- Multi-stage builds

Key Features

Rich Content Creation - Blog posts with rich text editor, banner images, and categories

Social Features- Follow users, like/comment on posts, customizable profiles

Real-Time Communication - Instant notifications (likes, comments, new followers) and direct messaging with WebSocket

Guest Mode - Browse all content without authentication (read-only)

Admin Dashboard- Content moderation, user management, analytics

Performance - Redis caching, debounced search, infinite scroll, pagination

Security- 3-filter security chain, BCrypt password hashing, JWT tokens, CORS protection, SQL injection prevention

Architecture Highlights

The platform uses a three-tier architecture with Redis caching for user profiles and frequently accessed data. The WebSocket integration powers both the notification system and real-time chat.

Security is handled through a custom 3-filter chain: Public Filter (unrestricted endpoints) → Guest Filter (read-only access) → JWT Filter (authenticated users). This allows guest browsing while protecting write operations.

What I Learned

- Building a robust real-time notification system with WebSocket
- Implementing OAuth2 with multiple providers alongside traditional JWT auth
- Designing a scalable caching strategy with Redis and proper cache invalidation
- Managing complex user interactions (following, nested comments, threaded discussions)
- Optimizing performance with debouncing, pagination, and lazy loading

Would love to hear your thoughts and feedback! Happy to answer any questions about the architecture or implementation. 

r/SpringBoot • • Oct 09 '25

How-To/Tutorial Spring JPA Specification and Pageable

32 Upvotes

Hello eyerone, I'm here to share my first serious blog post related to Java https://busz.it/spring-jpa-specification-and-pageable-filtering-sorting-pagination/ As you can see it's about using Spring JPA's Specification and Pageable to dynamically filter, sort and paginate results from repo. Previously available articles cover only basic application of Specification without providing generic approach to the matter. That's what I'm trying to accomplish by my blog post.

I'll be obliged for any feedback on article, code and idea itself. Thanks in advance


r/SpringBoot • • Sep 15 '25

Question Spring boot projects

32 Upvotes

Can you please recommend me a youtube tutorial that makes a huge spring boot api, all i found are full stack and the backend is only 20% of the tutoial


r/SpringBoot • • Aug 25 '25

Question Has @MockBean in SpringTests been depricated?

Post image
32 Upvotes

What else to be used in place of u/MockBean?


r/SpringBoot • • May 06 '25

Guide Built a Chat-Based Inventory System (Spring Boot + AI) — No UI, Just Natural Language

32 Upvotes

I just shared a new proof of concept on LinkedIn: a conversational inventory system built with Spring Boot, Spring AI, and Ollama — no UI forms, no dropdowns. Just plain language commands like:

“Add a product called Wireless Mouse”

“Find electronics under 30 euros”

It’s powered by:

OpenAPI (auto-generates code fast)

Hexagonal architecture (clean + scalable)

WireMock + Testcontainers (easy testing)

This project shows how AI can do more than chat it can drive real backend logic and simplify complex workflows.

Want to see it in action? Check out the full breakdown + link to the code on my LinkedIn post here: Read the post

I’d love to hear your thoughts and if your team is working on something similar or needs help building AI-first backend tools, let’s connect.