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
-
Formula:
approved_limit = monthly_salary * 36 -
A customer can only request loans up to this amount.
-
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_emiis ≤ 50% of salary, loan is approved. -
If not, interest rate is auto-corrected to try approving the loan.
- Docker & Docker Compose installed
- Git installed
git clone <your-repo-url>
cd Credit_Approval_SystemCreate a .env file:
SECRET_KEY=your_secret_key
DEBUG=True
ALLOWED_HOSTS=*
DATABASE_URL=postgres://postgres:postgres@db:5432/credit_dbdocker-compose up --buildThis will:
- Set up Postgres and Redis
- Run migrations
- Ingest sample data
- Start Django app and Celery worker
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:
- .envThen run:
docker-compose run testMade with ❤️ by Santhosh!✨