A prototype REST API for demo credit app, built with Nest
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.
Ensure MariaDB is installed on your system first
# create .env file, and update database config values
$ cp env.example .env
# install node dependencies
$ npm install
# database migrations
$ npm run knex -- migrate:latest
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Visit http://localhost:3000/swagger for the Swagger explorer of the api.
Complete documentation of the API endpoints can be accessed at http://localhost:3000/docs.html
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Below is the ER Diagram of the database.
There are five tables, accounts, deposits, users, transfers, withdrawals
- A user can have multiple accounts
- Deposits table records all deposits into various accounts of the user
- Transfers table records all the transfers made the user
- Withdrawals table records user withdrawals