DebtLedger is a backend-first, production-style REST API designed to help users track loans, EMIs (Equated Monthly Installments), and overall debt exposure over time. The system supports user authentication, loan lifecycle management, EMI schedules, and analytical dashboards.
This repository represents the fully completed and tested Backend MVP, built with Spring Boot + PostgreSQL, and is tagged as a stable baseline for frontend development.
Most individuals managing multiple loans struggle with:
- Tracking monthly EMIs across loans
- Knowing remaining payable amounts
- Understanding future EMI load
- Getting a consolidated debt overview
DebtLedger solves this by providing:
- Centralized loan tracking
- Deterministic EMI schedules
- Strict state transitions (PAID / MISSED)
- Real-time debt analytics
The goal was to build a clean, extensible backend that mirrors real-world financial rules.
Client (Postman / Frontend)
│
▼
REST Controllers
│
▼
Service Layer (Business Rules)
│
▼
Repository Layer (JPA)
│
▼
PostgreSQL Database
Cross-cutting concerns:
- JWT Authentication
- Global Exception Handling
- Request Validation
- Stateless Security
- Language: Java 21
- Framework: Spring Boot 3.3.x
- Security: Spring Security + JWT
- Database: PostgreSQL
- ORM: Spring Data JPA (Hibernate)
- Validation: Jakarta Bean Validation
- API Docs: OpenAPI / Swagger
- Build Tool: Maven
- LOCAL (Email + Password)
- GOOGLE OAuth (token-based)
- Stateless JWT authentication
- No server-side sessions
- JWT validated via filter on every request
/auth/signup/auth/login/auth/oauth/google/swagger-ui/**
All other endpoints require a valid JWT.
idnameemailpasswordHashauthProvider
iduserIdnameemiAmounttotalTenureMonthsemiStartDatestatus(ACTIVE / CLOSED)
idloanIdyearMonthstatus(PENDING / PAID / MISSED)
Constraint: (loanId, yearMonth) is unique
- Loan starts in ACTIVE state
- EMI schedule is generated upfront
- Each EMI can transition:
- PENDING → PAID
- PENDING → MISSED
- PAID / MISSED is terminal
- CLOSED loans:
- Cannot be edited
- Cannot have EMI status updates
All rules are enforced at service level.
- User signup & login
- JWT generation
- OAuth Google login
- Create loan
- Update loan (controlled regeneration of EMI schedule)
- Close loan
- Fetch single loan details
- Fetch loan summaries (dashboard/table view)
- Fetch EMI schedule per loan
- Update EMI status (PAID / MISSED)
- Strict ownership and state checks
Provides analytical insights:
- Total active loans
- Total payable amount
- Remaining payable amount
- EMI count for current month
- Total EMI amount
- Month-by-month EMI distribution for a given year
- Bean-level request validation
- Consistent validation errors
{
"timestamp": "...",
"status": 400,
"error": "VALIDATION_ERROR",
"message": "...",
"path": "/endpoint"
}Handled errors:
- Validation errors
- Unauthorized / Forbidden
- Resource not found
- Illegal state transitions
- Internal server errors
All APIs were tested manually using Postman:
- Authentication flows
- Duplicate & invalid inputs
- Loan creation, update, closure
- EMI state transitions
- Edge cases (closed loans, invalid access)
- Dashboard calculations
Every business rule was validated against real API responses.
- PostgreSQL used as primary datastore
- Hibernate
ddl-auto=update - YearMonth stored as String via AttributeConverter
-
Backend MVP tagged as:
backend-mvp-v1.0.0
Built end-to-end with a strong focus on:
- Clean architecture
- Deterministic business rules
- Production-grade patterns
This project is intended as both a real-world backend system and a **portfolio-quality reference implementation
Chandra Sekhar Vipparla
📧 Email: code.chandrasekhar@gmail.com
🔗 LinkedIn: https://www.linkedin.com/in/chandra-sekhar-vipparla/