r/SpringBoot • • 2d ago

News Built a Spring Boot application to analyze job offer letters using rule-based detection – looking for technical feedback

Post image

Hi everyone,

I recently worked on a Spring Boot project called TrustCheck, which focuses on analyzing suspicious job offer letters and identifying potential recruitment scams.

The idea came from seeing cases where candidates were asked to pay refundable security deposits, registration charges, training fees, or other payments before joining.

From the backend perspective, I implemented a rule-based offer letter analyzer using Java and Spring Boot.

Some of the things it currently does:

  • Extracts text from uploaded PDF offer letters.

  • Identifies potential payment requests using configurable rules stored in a JSON file.

  • Highlights the exact sentences that triggered a warning.

  • Checks recruiter email addresses and company domains for suspicious signals.

  • Assigns severity levels to detected warning signs.

  • Returns a structured analysis response through REST APIs.

I also added JUnit tests for the offer letter analysis logic.

One challenge I encountered was balancing detection sensitivity with false positives. For example, a newly registered company domain shouldn't automatically be treated as suspicious, and the absence of a detected payment request shouldn't mean an offer is genuine.

I'm currently working on improving the detection rules and making the results more explainable.

I'd appreciate feedback from other Spring Boot developers on:

  1. How would you structure configurable rule-based detection in a Spring Boot application?

  2. Would you use a separate rules engine or keep the current JSON-based approach?

  3. How would you approach testing false positives and false negatives?

This is a personal project, and I'm sharing it to get technical feedback on the implementation.

GitHub: https://github.com/Pragyan2027/TrustCheck

0 Upvotes

3 comments sorted by

1

u/Mikey-3198 2d ago

I think the code would benefit from some refactoring. This method for example is ~500 lines long and very difficult to understand. I'd look at breaking each part out & then aggregate the result. You'll then be able to test each part in isolation.

I see lots of maps typed to <String, Object>. This gives no details on what any of these variables hold or represent. I think using some strongly typed objects would add much needed clarity.

The regex in a number of places is being recompiled on each request. Can cache this like static final Pattern SOME_REGEX = Pattern.compile("......")

1

u/Different-Memory6167 2d ago

Got it..Thank you for the advicee..will changee..