This project simulates a real-world loan servicing system that processes borrower payments, tracks outstanding balances, and manages loan lifecycle states such as full, partial, and missed payments. It is designed to reflect how financial institutions handle monthly loan servicing cycles, including interest calculation, principal allocation, delinquency tracking, and carry-forward of unpaid dues.
- Python
- FastAPI
- PostgreSQL
- psycopg2
- Pandas
- Git & GitHub
- Loan data ingestion from structured input
- EMI (Equated Monthly Installment) calculation using financial formulas
- Monthly servicing cycle processing
- Payment allocation into interest and principal
- Detection of:
- Full payments
- Partial payments
- Missed payments
- Carry-forward of unpaid dues across cycles
- Automatic advancement of next due date
- Tracking of:
- Outstanding balance
- Remaining loan term
- Missed payment count
- Persistent payment history tracking
- late fee assessment and penalty tracking
Input Data → Processing Engine → Database → API / Reports
- Processing Engine handles loan servicing logic
- Database maintains persistent loan and payment state
- API enables interaction with the system
- Batch Runner allows scheduled execution
loan-servicing-system/
│
├── data/
│ ├── loans.csv
│ ├── payments.csv
│ └── outputs/
│
├── src/
│ ├── app.py
│ ├── main.py
│ ├── config.py
│ ├── db.py
│ ├── schemas.py
│ ├── loan.py
│ ├── payment_processor.py
│ ├── servicing_service.py
│ ├── reporting.py
│
├── requirements.txt
├── .gitignore
└── README.md
pip install -r requirements.txt
Create a .env file:
DB_NAME=loan_servicing
DB_USER=your_user
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432
cd src
uvicorn app:app --reload
Open
http://127.0.0.1:8000/docs
cd src
python main.py
- Updates loan state in PostgreSQL
- Inserts records into
payment_historyDB table - Generate CSV reports in
data/outputs/
- Backend system design for financial workflows
- Data processing and transformation pipelines
- Implementation of real-world business logic for loan servicing
- State management across time-based cycles
- Handling of edge cases (partial/missed payments)
- API-driven service design
- Database integration with PostgreSQL
- AWS integration (S3, Lambda, API Gateway)
- Dashboard using Streamlit
- Multi-cycle simulation engine
This project is a simplified simulation of a loan servicing system built for learning and demonstration purposes. It does not represent any proprietary or production system.
Built as part of a hands-on portfolio to demonstrate backend, data processing, and cloud-ready system design.