Skip to content

Dockerized Django REST backend for credit approval and loan processing using PostgreSQL

Notifications You must be signed in to change notification settings

MerinaGT/credit_approval_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Approval System — Django REST + PostgreSQL + Docker

This project is a backend credit approval and loan processing system built using Django, Django REST Framework, PostgreSQL, and fully containerized with Docker.

The system evaluates customer eligibility for loans based on salary, past loan history, credit rules, and EMI constraints.


Tech Stack

  • Python
  • Django 5
  • Django REST Framework
  • PostgreSQL
  • Docker & Docker Compose
  • Pandas (Excel ingestion)

Features Implemented

  • Customer Registration with automatic approved credit limit calculation
  • Loan Eligibility Check based on historical loan data and salary rules
  • Loan Creation with EMI calculation using compound interest
  • View Loan by Loan ID
  • View All Loans by Customer ID
  • Automatic database wait mechanism inside Docker to prevent race condition
  • Auto migrations on container start

How to Run the Project

Clone the repository and run:

docker-compose up --build

Server starts at:

http://127.0.0.1:8000/


API Endpoints

Method Endpoint Description
POST /api/register/ Register new customer
POST /api/check-eligibility/ Check loan eligibility
POST /api/create-loan/ Create new loan
GET /api/view-loan/<loan_id>/ View specific loan
GET /api/view-loans/<customer_id>/ View all loans of customer

Engineering Note

A custom wait_for_db.py script is used so Django waits for PostgreSQL to become ready inside Docker before starting. This prevents startup crashes due to DB race conditions.


Author

Merina Thoppil

Releases

No releases published

Packages

No packages published