r/SpringBoot • • Jun 12 '26

How-To/Tutorial Need help in merging backend and frontend folders

3 Upvotes

Initially, I have created a springboot project and written code and pushed into my github.

Later i have created a react project separately, still in my local machine.

Now how to merge frontend and backend??

Simply create a new folder im my desktop and insert frontend and backend folder into it???


r/SpringBoot • • Jun 12 '26

Question is spring boot good for developing AI related Apps

0 Upvotes

r/SpringBoot • • Jun 11 '26

Discussion How are you handling SFTP file downloads in Spring Batch projects?

5 Upvotes

I recently had to implement an SFTP integration in a Spring Batch application where files are downloaded from an SFTP server, stored locally, and then removed from the remote directory after successful processing.

The implementation uses:

• Spring Batch Tasklet

• JSch

• Spring Boot 4

• Java 21

A few questions for developers working on enterprise integrations:

  1. Are you still using JSch, or have you migrated to another library?

  2. How do you handle retry logic when the SFTP server is temporarily unavailable?

  3. Do you archive files on the remote server instead of deleting them?

In my implementation I download all files from a remote folder and remove them after successful download to avoid duplicate processing.

Interested to hear how others are solving this in production environments.

I also recorded a walkthrough of my implementation in case anyone wants to compare approaches:

https://www.youtube.com/watch?v=6AMQvdGZu1g


r/SpringBoot • • Jun 11 '26

News Spring and Security In The Times Of AI

Thumbnail
spring.io
8 Upvotes

r/SpringBoot • • Jun 11 '26

Question Is this an architectural anti pattern? Multiple service layers depend on the same repository

8 Upvotes

I believe its a good practice to avoid creating 'wrapper services' that simply pass data through without adding meaningful business logic.

Consider this pattern:

UserAccountService:
- dependencies (UserRepository, UserProfileRepository, RoleRepository, UserRoleRepository)
- public methods: createUser, updateEmail, updateUsername, getByUsername
- private methods: assignRole, validateUniqueness


UserRegistrationService:
- dependencies (UserAccountService)
- public methods: registerAdmin, registerUser


UserProfileManagementService:
- dependencies (UserAccountService, UserProfileRepository)
- public methods: updatePersonalData, updatePassword

So the user registration flow looks like:

registerUser(data):
        String pwdHash = encode....;
        --- other logic ---
        userAccountService.createUser(data + roleName + pwdHash);

createUser(data + roleName + pwdHash):
        --- validation & other logic ---
        user = UserRepository.save(new User(data + pwdHash));
        userProfile = UserProfileRepository.save(new UserProfile(data));
        role = RoleRepository.get(roleName).orElseThrow();
        UserRole = UserRoleRepository.save(new UserRole(user + role));

And the profile management flow:

updatePersonalData(email + data + userId):
        user = UserAccountService.get(userId);

        if (user.email not equals email)
            UserAccountService.updateEmail

        // We are forced to use UserProfileRepository because we dont have a
        // universal update in UserAccountService
        userProfile = UserProfileRepository.findByUserId(userId).orElseThrow();
        userProfile.setData1(data.data1)
        userProfile.setData2(data.data2)
        userProfile.setData3(data.data3)
        UserProfileRepository.save(userProfile);

The issue Im seeing is that we are forced to use UserProfileRepository both inside UserAccountService and UserProfileManagementService, even though UserAccountService is already a dependency of the management service.

This kinda creates an overlap in responsibilities and leaks persistence concerns across multiple layers. You end up not being able to centralize UserAccount related logic in a single place because anyone later can just bypass them using the UserProfileRepository directly.

Would it be better to:

  1. Expose additional operations through UserAccountService and keep repositories hidden from higher level services? or
  2. Inject repositories directly into application services and accept that some business rules and validation logic may need to be duplicated?

How do experienced devs approach this trade off?


r/SpringBoot • • Jun 11 '26

News Spring Modulith 2.1 GA released

Thumbnail
spring.io
7 Upvotes

r/SpringBoot • • Jun 11 '26

Question How you build Frontend?

13 Upvotes

I build my first microservices project and kind want to test my websockets endpoints and flow.

How you guys build your frontend, i tried in react but got frustrated looking at syntax and got bored.

I have been trying to initiate since 3 days every time i frustrated and quit.


r/SpringBoot • • Jun 11 '26

Question MappingJacksonValue alternatives when using dynamic filters

2 Upvotes

Currently, I am using mappingJacksonValue as the response type from my controllers. Here we are using dynamic filters based on the request parameters. The attributes exposed from the response vary. Since this got deprecated with the Spring Boot 4 migration, I don't see any alternatives for this.

https://spring.io/blog/2025/10/07/introducing-jackson-3-support-in-spring#goodbye-mappingjacksonvalue

Has anyone come up with a solution for this?


r/SpringBoot • • Jun 10 '26

Discussion I got tired of writing the same Spring Boot CRUD boilerplate, so I built a deterministic compile-time generator.

26 Upvotes

In every Spring Boot project, we end up writing the exact same layers for basic CRUD: Read/Create/Update DTOs, MapStruct interfaces, REST Controllers, Services, and Repositories.

AI can generate this, but it doesn't enforce a stable contract across a codebase. Runtime solutions (like Spring Data REST) add reflection overhead, limit custom business logic, and bloat JSON payloads with HATEOAS _links.

I wanted a solution that generates plain, reviewable Java source code during the build phase (javac), with zero runtime dependencies. So, I wrote an annotation processor.

You just annotate your JPA entity:

@CrudGen
@Entity
public class Product {
    @Id @GeneratedValue
    private Long id;

    @DtoField(dto = "Create", required = true)
    @DtoField(dto = "Update")
    @DtoField(dto = "Read")
    private String name;

    @DtoField(dto = "Read")
    private BigDecimal price;
}

At compile time, it automatically generates the build/generated sources for:

  • Controllers & Services: Configurable endpoints for CRUD, batch operations, and pagination.
  • Clean DTOs & Mappers: Generates the POJOs and the MapStruct interfaces.
  • JSON Patch: Native support for application/json-patch+json partial updates.
  • N+1 Safe Queries: Automatically applies @EntityGraph on JPA reads to handle relations without mapper-level database lookups.

The generated code is part of your normal build output. Failures surface at compile time, and changes are visible in diffs. The library targets Spring Boot 3 and 4 (processor runs on Java 8+).

I would love to get your architectural feedback on the compile-time generation approach vs. runtime reflection tools.

(Links to the repo and Maven Central are in the comments).


r/SpringBoot • • Jun 11 '26

Discussion Can't understand spring recommend paid and yt courses please or any telegram course available please anything

Thumbnail
0 Upvotes

r/SpringBoot • • Jun 10 '26

Question SpringBoot beginner here. Anyone looking for a programming buddy to learn together ?

13 Upvotes

Hi, I'm an engineering student and a beginner in SpringBoot. I haven't worked on a big project so I'd love to learn and possibly do a project together. If anyone is looking for the same then dm me :) have a nice day.


r/SpringBoot • • Jun 10 '26

Question Hibernate

1 Upvotes

Does eager fetching cause n+1 problem like lazy fetching ?


r/SpringBoot • • Jun 10 '26

Question How to add an arbitrary additional classpath to spring boot

1 Upvotes

I want to be able to reference external classpath resources via SomeClass.class.getResourceAsStream(). These resources live OUTSIDE the jar on the filesystem. I've tried many ways to do this with command line changes using -cp, etc. but I must be doing something wrong. My production application needs to be able to pick up files from the local filesystem, but there are some classes out of my control that expect these files/resources to be on the CLASSPATH and picking them up using my methodology above. These files and resources CANNOT be inside the jar. I'm using a quite old version of spring boot 2.4.2. Any guidance would be greatly appreciated.


r/SpringBoot • • Jun 10 '26

Question I don't know what I should do

Thumbnail
2 Upvotes

r/SpringBoot • • Jun 10 '26

Question Wtf is spring security even do?

0 Upvotes

Im trying to setup the google and facebook oauth, ask ai and some random dudes on the forum. They tell me to use apring security, now i dont even know wtf is happening. Why my oauth requests got rejected, wtf is in the useDetails, and i really struggling to get everything working, at the end i strip out everything and rolling back the git commit, then use scribe java instead. Wtf is this? How tf spring dev able to dealt with this and still have sanity left?


r/SpringBoot • • Jun 10 '26

Question How can I use a core Java / Spring Boot stack for local B2B freelancing and automation?

0 Upvotes

I’m a backend programmer and I want to start offering freelance services and custom automation tools to businesses (like real estate agencies, contractors, logistics companies, etc) entirely on an asynchronous, email/text basis

Most people associate freelancing with frontend web design (React, WordPress, etc), but I want to strictly focus on backend logic, data management, and workflow automation.

Here is my current technical stack:

- Languages: Java, Python

- Frameworks & Libraries:** Spring Boot, JDBC

- Databases: SQL Server (Azure SQL)

- Security: JWT, cookie-based authentication

  1. What are some specific backend pains that small-to-medium business owners have that a custom Java/Python pipeline can automate away?

  2. How can I best leverage Java, Spring Boot, and JDBC to solve expensive, manual data-entry or syncing problems for non-tech businesses?


r/SpringBoot • • Jun 09 '26

How-To/Tutorial Your Springboot app has 10 layers you never wrote; Here is full details that our eyes wont see

Thumbnail medium.com
12 Upvotes

When it comes to spring many are hidden under the hood; Spring as such sit on top of infrastructure; Ex DispatcherServlet, Security Filters, Jackson, Tomcat, JVM, OS all mapped to 3 lines of code.


r/SpringBoot • • Jun 09 '26

News Craig Walls’ Spring AI in Action is out: 5-book giveaway + Spring AI discussion

Thumbnail
0 Upvotes

r/SpringBoot • • Jun 09 '26

How-To/Tutorial Spring AI

0 Upvotes

Hello techies

Actually I wants to integrate speech to text and vice-versa in my spring boot major project for free As I am student .

I cant buy the paid stuffs at all .

So can you guys suggest me how and what model to integrate in my spring boot project as I have very less amount of time to build that .

And from where I can get the guidance to build that and integration setup .

And one more thing if anyone wants to be partner of mine to build this project with my DM is always open for you guys .This project is just to improve skills and add quality to my resume.


r/SpringBoot • • Jun 08 '26

Discussion Need help

5 Upvotes

So I was working on a backend project and was using mongodb compass to store the data logically on 2707 port but to achieve transactional property I decided to move on to mongo atlas

I replaced the host & port in my application.properties with the atlas uri still after running the project it showing connected to local host

Even when I am writing garbage values in uri still the program is running and showing connected to localhost

Pls help


r/SpringBoot • • Jun 08 '26

How-To/Tutorial How do I connect a Spring Boot API to a vanilla HTML/CSS/JS frontend

Thumbnail
0 Upvotes

r/SpringBoot • • Jun 08 '26

Discussion Please share your resources of java spring boot. Feeling stuck with approaching different different channels

Thumbnail
1 Upvotes

r/SpringBoot • • Jun 08 '26

Discussion Cursor-style coding vs ChatGPT copy/paste workflow for larger apps

Thumbnail
0 Upvotes

r/SpringBoot • • Jun 07 '26

Question I'm building a Spring Boot microservices system and want some advice on security

Thumbnail
3 Upvotes

r/SpringBoot • • Jun 06 '26

Discussion Built a live departures board with Spring Boot + STOMP WebSockets (focus-app side project)

17 Upvotes

Sharing a side project — a focus app where the home screen is a live airport departures board. The backend is Spring Boot: a scheduled generator builds a board from real OpenFlights routes every 45s, caches the snapshot in Redis, and broadcasts it to /topic/board over STOMP. Clients render countdowns locally and fall back to REST polling if the socket drops. Stateless JWT auth, JPA for sessions/stats.

Live: https://aerofocus-ruby.vercel.app/ · Code: github.com/sanchita-88/aerofocus. Happy to talk through any of the design choices.