Giter VIP home page Giter VIP logo

loan-management-system's Introduction

Loan Management API

An API which facilitates the working of a minimal loan management system

Theme of the API

  • There are three types of users:- Customer, Agent, Admin
  • Customer is the client who makes a request for the loan
  • Agent is the middleman associated with the bank who has certain authourities such as edit loans,
    listing users, and making loan request on behalf of customer
  • Before accessing to these functions an agent has to get the approval by the admin of being an agent
  • Admin is the highest authority who can approve or reject a loan and also the request by agent
  • Customers and agents can Sign up
  • Admin, cutomers and agents can login(agent can login only if agent is approved by the admin)
  • When an agent will signup a request will be sent to the admin for approvalxxxxxx
  • A loan has entities such as principle, interest rate, months to repay, emi and status
  • The value of interest rate would depend on the value of principlexxxxxxxxx
  • The loan can have 3 kinds of status: Approved, New or Rejected

Tech stack used
Nodejs, Express framework, Mongodb

Key modules used
Passport-jwt, Jsonwebtoken, Bcryptjs, Mocha, Chai

Model Schemas

User
Has details about the user such as name, email, password, user type and if user is approved or not
Loan
Has details of principle, interest rate, months to repay, emi, status and history of edited loans

Explaination of key features

  • Only customers and agents can signup
  • Customer will be created in the database on signup
  • When agent would signup a request would to the the admin to approve the agent.
  • Admin and customer are by default approved but not agent
  • Agent can only login after being approved
  • An instance of admin is created initially in the database(see the main index file, uncomment the mentioned code, run "npm start", comment the same code again and run "npm start",later the admin can change password if want to)
  • All the users can update their passwords and its length should be greater than 6
  • Passwords are encrypted before being stored
  • Agents can list all customers and admin can list all users
  • The interest on a loan would depend on the principle
    For range (10000,50000) interest = 3%
    For range (50000,100000) interest = 4%
    Greater than 100000 interest = 5%
  • Loan can be approved or rejected by admin only
  • Only agent can edit a loan if it is still not approved
  • Previous instance of the same loan is pushed inside the history before being edited
  • Loans can be listed according to filter

Routes

/users/signup
/users/login
/users/listUsers
/users/agentRequestList
/users//approveAgent
/users/updatePassword
/users/loan/newLoan
/users/loan/approveLoan
/users/loan/rejectLoan
/users/loan/editLoan
/users/loan/allLoans
/users/loan/loansbyFilter

Set up Project using Docker files

  • Dockerfile.production (This is for main project)
  • Dockerfile.test (This is for running testcases)
  • Create an image for each by command => "docker build -t {your username}/{name of app} {dockerfile name} ."
  • Run the image with command => "docker run -p 49160:8000 -d {your username}/{name of app}"

If can't set it up on docker

Run "npm init", setup the project install the dependencies and run "npm start"


Run unit tests on Node

  • Install the dev dependencies: mocha, chai and chai http
  • Navigate to project directory and run => "npm test"

alt text



Working of API on postman (examples)


Signup
alt text

alt text

Agent Signup

alt text

Loan Request
alt text

alt text

loan-management-system's People

Contributors

muneeb21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.