Skip to content

A simple lending app that requires wallet functionality.

License

Notifications You must be signed in to change notification settings

St-Pardon/demo-credit

Repository files navigation

demo-credit

A simple lending app with wallet functionality.

ts Last Commit Stars License

Contents

About

Demo Credit is a mobile lending app that requires wallet functionality. This is needed as borrowers need a wallet to receive the loans they have been granted and also send the money for repayments.

Features

  • Account Creation: Users can signup and can create an account or multiple accounts of the same type or other types which includes a savings account, current account or a fixed-deposit account.
  • Fund Deposit: Users can fund their various accounts.
  • Fund Transfer: Users can transfer funds between their accounts and also to another user’s account.
  • Fund Withdrawal: Users can withdraw funds from their account.
  • Transaction History: Users can get a transaction history from each of their accounts or from all of their accounts. They can track transaction status for pending, confirmed, failed or canceled transaction.

purpose

The purpose of this project is for both learning purpose especially with the Knexjs ORM and to fulfill the technical assessment requirement for the role of backend engineering at Lendsqr.

Find full project reqirements here

Tools

The following tools were used in actualizing this project

  • IDE/Text editor: Visual Code, VI
  • Source Control and Repository: Git and Github
  • Language(s) and Framework(s): TypeScript, Express, Node.
  • Libraries: Knexjs, Passportjs, helmet, bcrypt and uuid.
  • Database: MySQL
  • Testing: Jest, Supertest, ThunderClient, Postman
  • Hosting: AWS EC2, Ngnix and PM2 Server
  • Others: DrawSql, zsh terminal,

Getting Started

To get started, follow the instructions below.

Prerequisites

To run this project, the following tools must be installed on your machine:

  • IDE/Text Editor: preferrably VSCode but any other will surfice.
  • Git: if not already installed, install from here
  • Terminal: for windows users, Git Bash or WSL will do. Mac or Linux will users any terminal will do.
  • API Platform: Application, extention or web base API Platform will do. check out Postman and ThunderClient
  • MySQL: if not already installed, install from here

Set Up

Step 1: Open your terminal on your computer and clone the code repository.

git clone https://github.com/St-Pardon/demo-credit.git

Step 2: Change into the cloned respository and list the content to make sure the content are intact.

cd demo-credit/
ls
...

Step 3: Install all dependencies from the package.json file.

npm install

This will install all packages needed for the application in the project directory, not globally.

Step 4: Start up your MySql database service and Setup your environmental variables by creating a .env file and inputing the neccessary variable.

mysql --version
touch .env

Open the .env file on you text editor and create the variables using the this sampledotenv

To check if mysql is running on your computer, use the following applicable to your machine windows, mac and linux.

Step 5: Create the database and run migration.

npm run db:create
...
npm run db:migrate
... 

NB: If the above code throws an error, be sure to open db.config.ts from src/config directory and manually input your database information as process.env do not run when the server is not running.

The command db:migrate will run the migration by creating all tables in the database using the table schma in the src/migration directory. It will implement the tables, constraints and relationships shown in this E-R - Dirgrame

Step 6: Start the application

npm run start:dev
...

Step 7: Congratulation you have successfully started the application and now open your API Platform and test out the end points. To carefully expore and understand the endpoints see API Documentation to get a list and demo of all the available endpoints and how to use them.

API Documentation

The API Documentation is live on Postman. This contain the full list of the endpoints, their methods and some examples.

Deployment

Site is live at demo-credit 🚀🚀🚀

The application is running on an ec2 instance, run on node application server on localhost with pm2 for service set up and public with Nginx web server running the proxy pass.

Author(s)

The people resonsible for bring this to live includes

License

Project source code is licensed under the MIT license. You are free to fork this repository, edit the code, share and use it both for non-commercial and commercial purposes

About

A simple lending app that requires wallet functionality.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published