Skip to content

santhosh-005/Credit_Approval_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Approval System

1. About the Project

This is a backend API built using Django and Django REST Framework for a Credit Approval System. The system allows financial institutions to manage customers and loans, determine loan eligibility based on income, and process new loan applications.

Key functionalities include:

  • Registering new customers
  • Evaluating loan eligibility based on income and credit profile
  • Creating and managing loans
  • Viewing loan details per customer or loan

2. Loan Approval Logic Overview

Approved Limit Calculation

  • Formula:

    approved_limit = monthly_salary * 36
    
  • A customer can only request loans up to this amount.

Eligibility Check

  • Uses parameters: loan_amount, tenure, interest_rate, monthly_salary

  • Calculates Monthly EMI using:

    EMI = (P * R * (1 + R)^N) / ((1 + R)^N - 1)
    where:
      P = loan_amount
      R = (interest_rate / 12 / 100)
      N = tenure (in months)
    
  • If the monthly_emi is ≤ 50% of salary, loan is approved.

  • If not, interest rate is auto-corrected to try approving the loan.


3. Setup and Run Project

Pre-requisites

  • Docker & Docker Compose installed
  • Git installed

Clone the Repository

git clone <your-repo-url>
cd Credit_Approval_System

Environment Setup

Create a .env file:

SECRET_KEY=your_secret_key
DEBUG=True
ALLOWED_HOSTS=*
DATABASE_URL=postgres://postgres:postgres@db:5432/credit_db

Run the Project Using Docker Compose

docker-compose up --build

This will:

  • Set up Postgres and Redis
  • Run migrations
  • Ingest sample data
  • Start Django app and Celery worker

Run Tests

You can add the following to docker-compose.yml to run tests:

  test:
    build: .
    command: python manage.py test
    volumes:
      - .:/app
    depends_on:
      - db
    env_file:
      - .env

Then run:

docker-compose run test

Made with ❤️ by Santhosh!✨

Releases

No releases published

Packages

No packages published