{"id":15431076,"url":"https://github.com/anselemodims/loaner","last_synced_at":"2025-04-19T17:04:49.906Z","repository":{"id":114205986,"uuid":"182543968","full_name":"AnselemOdims/Loaner","owner":"AnselemOdims","description":"Loaner is an online lending platform that provides short term soft loans to individuals. This helps solve problems of financial inclusion as a way to alleviate poverty and empower low income earners.","archived":false,"fork":false,"pushed_at":"2021-11-18T18:45:25.000Z","size":1129,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2024-10-18T06:35:18.306Z","etag":null,"topics":["babel","css","eslint","express","heroku","html","javascript","nodejs","swagger","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnselemOdims.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-21T14:29:46.000Z","updated_at":"2022-03-29T14:40:30.000Z","dependencies_parsed_at":"2023-06-15T23:00:10.154Z","dependency_job_id":null,"html_url":"https://github.com/AnselemOdims/Loaner","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.016949152542372836","last_synced_commit":"c5c6ac21aa1c42e051d0dc6ebd876000bce38492"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnselemOdims%2FLoaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnselemOdims%2FLoaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnselemOdims%2FLoaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnselemOdims%2FLoaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnselemOdims","download_url":"https://codeload.github.com/AnselemOdims/Loaner/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241513157,"owners_count":19974695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","css","eslint","express","heroku","html","javascript","nodejs","swagger","travis-ci"],"created_at":"2024-10-01T18:20:25.173Z","updated_at":"2025-03-02T13:32:20.577Z","avatar_url":"https://github.com/AnselemOdims.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loaner\n\n[![npm version](https://badge.fury.io/js/express.svg)](https://badge.fury.io/js/express)\n[![Build Status](https://travis-ci.org/AnselemOdims/Loaner.svg?branch=develop)](https://travis-ci.org/AnselemOdims/Loaner) \n[![Coverage Status](https://coveralls.io/repos/github/AnselemOdims/Loaner/badge.svg)](https://coveralls.io/github/AnselemOdims/Loaner)\n[![Maintainability](https://api.codeclimate.com/v1/badges/31f2930d0fe4fa791126/maintainability)](https://codeclimate.com/github/AnselemOdims/Loaner/maintainability)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n\nLoaner is an online lending platform that provides short term soft loans to individuals. This\nhelps solve problems of financial inclusion as a way to alleviate poverty and empower low\nincome earners.\n\nThe application' UI template is on github pages [here](https://anselemodims.github.io/Loaner/UI/)\n\n## Implemented Features\n\n- User (client) can sign up.\n- Users can login.\n- User can request for loan.\n- User can view the loan repayment history\n- Admin can mark a client as verified, after confirming his/her home and work address.\n- Admin can view a specific loan application.\n- Admin can approve or reject a client's loan application.\n- Admin can post loan repayment transaction in favour of a client.\n- Admin can view all loan applications.\n- Admin can view all current loans (not fully repaid).\n- Admin can view all repaid loans.\n- User can reset password.\n\n---\n\n## Technologies to be Used\n\n- [NodeJS](https://nodejs.org/)\n\n- [Express](https://expressjs.com/)\n\n- [Babel](https://babeljs.io/)\n\n- [ESLint](https://eslint.org/)\n\n- [Mocha](https://mochajs.org/) + [Chai](https://www.chaijs.com/)\n\n---\n\n## Installation\n\n#### Clone this repository and navigate into it.\n\n`git clone https://github.com/anselemodims/loaner.git \u0026\u0026 cd loaner`\n\n#### Install dependencies.\n\n`npm install`\n\n#### Add Neccessary Environment Variables\n\n Add a .env file to the root and declare the following environment variables:  \n\n- SECRET_KEY: A jswebtoken secret to encrypt jsonwebtoken\n\n- ADMIN_PASSWORD: An Admin password to log the Admin in\n\n#### Start the application.\n\n`npm start`\n\n---\n\n## Documentation\n\nThis application is deployed on [heroku](https://credit-loaner.herokuapp.com) with the following endpoints accessible\n\n| Method                              | Functionality                                                                                 | Endpoint                     |\n| ----------------------------------- | --------------------------------------------------------------------------------------------- | ---------------------------- |\n| POST _/auth/signup_                 | Create a User account                                                                         | `api/v1/auth/signup`         |\n| POST _/auth/login_         | Login a User                                                                                           | `api/v1/auth/login`          |\n| PATCH _/users/\\\u003cuser-email\\\u003e/verify_| Mark a user as verified                                                                       | `api/v1/users/:email/verify` |\n| GET _/loans/\\\u003cloan-id\\\u003e             | Get a specific loan application                                                               | `api/v1/loans/:id`           |\n| GET _/loans?status=approved\u0026repaid=false_      | Get all current loans that are not fully repaid                                    | `api/v1/loans`               |\n| GET _/loans?status=approved\u0026repaid=true_       | Get all repaid loans                                                               | `api/v1/loans`               |\n| GET _/loans_                        | Get all loans  applications                                                                   | `api/v1/loans`               |\n| GET _/loans/\\\u003claon-id\\\u003e/repayments_ | View loan repayment history                                                                   | `api/v1/loans/:id/repayments`|\n| POST _/loans_                       | Create a loan application                                                                     | `api/v1/loans`               |\n| PATCH _/loans/\\\u003cloan-id\\\u003e_          | Approve or reject a loan application                                                          | `api/v1/loans/:id`           |\n| POST _/loans/\\\u003cloan-id\\\u003e/repayment_ | Create a loan repayment record.                                                               | `api/v1/loans/:id/repayment` |\n| GET _/users_                        | Get all Users                                                                                 | `api/v1/users`               |\n| PUT _/loans/\\\u003cloan-id\\\u003e_            | Update the repaid status of a client.                                                         | `api/v1/loans/:id`           |\n\n\n### Response Specifications\n\n#### POST _/auth/signup_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : [ {\n    “token” : `45erkjherht45495783`,\n    “user” : {....} // the user object\n  } ]\n}\n```\n#### POST _/auth/login_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : [ {\n    “token” : `45erkjherht45495783`,\n    “user” : {....} // the user object\n  } ]\n}\n```\n\n#### GET _/users/\\\u003cuser-email\\\u003e/verify_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : {\n    “email” : String ,\n    “firstName” : String ,\n    “lastName” : String ,\n    “password” : String ,\n    “address” : String ,\n    “status” : String ,\n    ....\n  } \n}\n```\n\n#### GET /loans/\\\u003cloan-id\\\u003e_\n\nResponse spec:\n\n```javascript\n{\n  {\n    “status” : Integer ,\n    “data” : {\n        “id” : Integer ,\n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n      } \n}\n```\n\n#### GET _/loans?status=approved\u0026repaid=false_\n\nResponse spec:\n\n```javascript\n{\n  {\n    “status” : Integer ,\n    “data” : [\n    {\n        “id” : Integer , \n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    },\n    {\n        “id” : Integer , \n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    }\n  ] \n}\n```\n\n#### GET _/loans?status=approved\u0026repaid=true_\n\nResponse spec:\n\n```javascript\n{\n  {\n    “status” : Integer ,\n    “data” : [\n    {\n        “id” : Integer ,\n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    },\n    {\n        “id” : Integer ,\n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    }\n  ] \n}\n```\n\n#### GET _/loans_\n\nResponse spec:\n\n```javascript\n{\n  {\n    “status” : Integer ,\n    “data” : [\n    {\n        “id” : Integer ,\n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    },\n    {\n        “id” : Integer ,\n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    }\n    {\n        “id” : Integer ,\n        “user” : String ,\n        “createdOn” : DateTime ,\n        “status” : String ,\n        “repaid” : Boolean ,\n        “tenor” : Integer ,\n        “amount” : Float ,\n        “paymentInstallment” : Float ,\n        “balance” : Float ,\n        “interest” : Float ,\n        ....\n    }\n  ] \n}\n```\n\n#### GET _/loans/\\\u003cloan-id\\\u003e/repayments_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : {\n    “loanId” : Integer ,\n    “createdOn” : Date ,\n    “monthlyInstallment” : Float , // what the user is expected to pay\n    “amount” : Float ,\n    ....\n  }\n}\n```\n\n#### POST _/loans/_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : {\n    “loanId” : Number ,\n    “firstName” : String , \n    “lastName” : String , \n    “email” : String ,\n    “tenor” : String ,\n    “amount” : Float ,\n    “paymentInstallment” : Float ,\n    “status” : String ,\n    “balance” : Float ,\n    “interest” : Float ,\n    ....\n  }\n}\n```\n\n#### PATCH _/loans/\\\u003cloan-id\\\u003e_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : {\n    “loanId” : Integer ,\n    “loanAmount” : Float ,\n    “tenor” : Integer ,\n    “status” : String , // approved or rejected\n    “monthlyInstallment” : Float ,\n    “interest” : Float ,\n  }\n}\n```\n\n#### POST _/loans/\\\u003cloan-id\\\u003e/repayment_\n\nResponse spec:\n\n```javascript\n{\n  “status” : Integer ,\n  “data” : {\n    “loanId” : Integer ,\n    “createdOn” : DateTime ,\n    “amount” : Float ,             // loan amount\n    “monthlyInstallment” : Float , // what the user is expected to pay\n    “paidAmount” : Float ,\n    “balance” : Float ,\n    ....\n}\n```\n\n---\n\n## Testing the Application Locally\n\n**Note:**\n\n\u003e As at the time of writing this, the application is still in development and the following commands might not behave as expected. This docs will be updated as soon as the application can be installed.\n\nIf the project has been cloned and navigated into as specified [above](#installation), you can run tests...\n\n### Using POSTMAN\n\nIf you do not have POSTMAN installed, download [here](https://www.getpostman.com/)\n\n- In the terminal start the application with `npm start`\n\n- On POSTMAN navigate to `localhost:3000/` and use the documentation [above](#documentation) as guide to access the endpoints.\n\n### Using MOCHA\n\nIf you do not have mocha installed, you can install using npm with:\n`npm -i mocha -g`\nthen you can run tests with:  \n`npm test`\n\n---\n\n\n## Acknowledgements\n\n[Andela](https://andela.com/)\n\n---\n\n## Author\n\n[Anselem Odimegwu](https://twitter.com/anselem_)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanselemodims%2Floaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanselemodims%2Floaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanselemodims%2Floaner/lists"}