Skip to content

BenDev254/loan-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Loan Management System (LMS)

A FastAPI-based Loan Management System that integrates with a CORE Banking System (CBS) and a Scoring Engine. This system allows users to subscribe, request loans, and check loan status while handling customer KYC and transaction data via SOAP APIs.

πŸš€ Features

User Authentication: Secure login via OAuth2/JWT

Customer Subscription: Register customers for loan services

Loan Requests & Status Checks: API endpoints for loan processing

CORE Banking Integration: Fetch customer KYC and transaction history via SOAP APIs

Scoring Engine Integration: Credit scoring and loan limit calculations

Async Processing with Celery: Handle retries for failed Scoring Engine requests

Logging & Monitoring: Track API usage and errors

Modular & Scalable Architecture

πŸ› οΈ Tech Stack

FastAPI - API framework

SQLite - Lightweight database

SQLAlchemy - ORM for database interactions

Celery - Async task queue

OAuth2 + JWT - Secure authentication

SOAP & REST APIs - External integrations

πŸ“‚ Project Structure

bash Copy Edit loan_management_system/ │── app/ β”‚ β”œβ”€β”€ routers/ # API route handlers β”‚ β”œβ”€β”€ models/ # Database models β”‚ β”œβ”€β”€ schemas/ # Pydantic models β”‚ β”œβ”€β”€ crud/ # Database operations β”‚ β”œβ”€β”€ utils/ # Helper functions β”‚ β”œβ”€β”€ config.py # Application settings │── database.py # Database connection │── main.py # Application entry point │── requirements.txt # Dependencies │── README.md # Project documentation │── .env # Environment variables

πŸ”§ Setup & Installation

1️⃣ Clone the Repository sh Copy Edit git clone https://github.com/BenDev254/loan-management-system.git cd loan-management-system

2️⃣ Create a Virtual Environment sh Copy Edit python3 -m venv venv source venv/bin/activate # On Windows use venv\Scripts\activate

3️⃣ Install Dependencies sh Copy Edit pip install -r requirements.txt

4️⃣ Set Up Environment Variables Create a .env file and add:

env Copy Edit DATABASE_URL=sqlite:///./loan_db.sqlite SECRET_KEY=your-secret-key

5️⃣ Run Database Migrations sh Copy Edit python database.py

6️⃣ Start the Application sh Copy Edit uvicorn main:app --reload

7️⃣ Access the API Docs Swagger UI: http://127.0.0.1:8000/docs

Redoc UI: http://127.0.0.1:8000/redoc

πŸ“Œ API Endpoints πŸ”Ή Authentication Method Endpoint Description POST /auth/login Login and get a JWT token

πŸ”Ή Customer Management Method Endpoint Description POST /subscribe Subscribe a customer

πŸ”Ή Loan Processing Method Endpoint Description POST /loan/request Request a loan GET /loan/status Check loan status

πŸ—οΈ Future Improvements Docker deployment

PostgreSQL migration

Azure DevOps pipeline integration

More advanced logging and monitoring

πŸ›  Contributing

Fork the repository

Create a new branch (git checkout -b feature-branch)

Commit your changes (git commit -m "Added a new feature")

Push to the branch (git push origin feature-branch)

Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published