Welcome to Credit Approval System
This application is built using technologies like Node.js, Express.js, Sequelize, PostgreSQL, and Docker containers. This application runs via a Docker container. To set up and use this application, follow the steps below:
- Clone this repository and navigate to the root folder.
- Run the following command to start the application in dev mode:
If you encounter any issues regarding the database (e.g., database not found), please create a database named
docker-compose up --buildcreditsystemappusing pgAdmin (connection details can be found in the docker-compose file).
If you are encountering any issues while starting the application (e.g. Unique key contraint while creating table name. or table name already exist) Please restart the application 2-3 times it will solve that error. It is the error from postgres connection issue on docker.
After starting the application, you can use it. If you want to add some sample data to the database, use the following API to ingest the data:
- API Endpoint:
[GET] http://localhost:3000/api/ingest-data
Base URL: http://localhost:3000/api
-
Register a customer:
- Method: POST
- URL:
{baseurl}/register - Request Body:
{ "first_name": "string", "last_name": "string", "age": "integer", "monthly_income": "number", "phone_number": "string" }
-
View loan details:
- Method: GET
- URL:
{baseurl}/view-loan/:loan_id - Request URL Parameter:
loan_id(Integer)
-
View statement of a particular loan:
- Method: GET
- URL:
{baseurl}/view-statement/:customer_id/:loan_id - Request URL Parameters:
customer_id(Integer): Id of the applicant of the loanloan_id(Integer): Id of approved loan
-
Make a payment towards an EMI:
- Method: POST
- URL:
{baseurl}/make-payment/:customer_id/:loan_id - Request URL Parameters:
customer_id(Integer): Id of the applicant of the loanloan_id(Integer): Id of approved loan
- Request Body:
{ "amount_paid": "number" }
-
Check loan eligibility:
- Method: POST
- URL:
{baseurl}/check-eligibility - Request Body:
{ "customer_id": "integer", "loan_amount": "number", "interest_rate": "number", "tenure": "integer" }
These are the endpoints available in the Credit Approval System application. Use the provided base URL and endpoint details to interact with the application.
If you are encountering any issues please let me know!!!