This project implements a backend for your multi-step loan application form. It exposes REST APIs to create/read/update Applicants, upload documents, and manage nested data like employment, loans, references, and declarations.
- Java 17, Spring Boot 3.5.4, Maven 3.9.9
- Spring Web, Spring Data JPA, Bean Validation
- PostgreSQL 13.x
- OpenAPI/Swagger UI (for quick testing)
- Local filesystem storage for uploaded files; DB stores metadata + file path
- Create database:
CREATE DATABASE loanapp;
- Update
src/main/resources/application.propertieswith your DB username/password. - Build & run:
mvn clean spring-boot:run
- Swagger UI:
http://localhost:8080/swagger-ui/index.html - Health check:
GET http://localhost:8080/actuator/health(if you add actuator)
-
Create Applicant (without documents yet):
curl -X POST http://localhost:8080/api/applicants \ -H "Content-Type: application/json" \ -d @sample/applicant-create.json -
Upload a document:
curl -X POST "http://localhost:8080/api/applicants/{applicantId}/documents/upload?type=ADHAAR" \ -F file=@/path/to/aadhaar.pdf -
Get Applicant by ID:
curl http://localhost:8080/api/applicants/{id}
- The schema is created via
spring.jpa.hibernate.ddl-auto=updateinitially for convenience. - Switch to Flyway or Liquibase when stabilised.
- Lombok is used to reduce boilerplate. In your IDE enable annotation processing.