Skip to content

Wallet Service built with Nodejs, Typescript, Knex and MySQL

Notifications You must be signed in to change notification settings

Vectormike/glowing-memory

Repository files navigation

Wallet Service

Submission Links


Major features and Implementation

These features are limited to:

  • Accounts
  • Deposits
  • Transfers
  • Withdrawals
  • Transactions

Account:

This features also refers to the Wallet of the said user, which holds user information and available balance.

Deposit:

With this, the user is able to deposit/fund their account which the value will be reflected in the available balance.

Transfer:

This makes an authorized user to be able to move monetary alue from its accounts to another user.

Withdrawal Feature:

Since we have the monetary value stored in an account, the user can decided to withdraw to a physical bank account.

Database Schema

The image below is an full representation of the database schema.

Database Schema

API Endpoints

List of available routes:

Auth routes:
POST /api/auth/register - register
POST /api/auth/login - login\

Account routes:
POST /api/account/deposit - fund
POST /api/account/transfer - transfer
POST /api/account/withdraw - withdraw\

Environment Variables

The environment variables can be found and modified in the .env file. They come with these default values:

# Port number
NODE_ENV=development
PORT=8000
ACCESSTOKENEXPIRESMINUTES=1500
REFRESHTOKENEXPIRESDAYS=1
JWT_AUTH_SECRET=bananpieisasweetpie
DB_NAME=lendsqr
DB_USER=root
DB_PASSWORD=root
DB_HOST=localhost
DB_PORT=8889
DB_DIALECT=mysql
PAYSTACK_SECRET_KEY=
PAYSTACK_PUBLIC_KEY=

Project Structure

src\
 |--config\         # Environment variables and configuration related things
 |--controllers\    # Route controllers (controller layer)
 |--middlewares\    # Custom express middlewares
 |--models\         # Mongoose models (data layer)
 |--routes\         # Routes
 |--services\       # Business logic (service layer)
 |--utilities\          # Utility classes and functions
 |--validations\    # Request data validation schemas
 |--interfaces\      # Interfaces
 |--server.ts       # App entry point
 |--knexfile.ts      # Knex config environment

Commands

Running locally:

npm run dev

Build:

npm run build

Running in production:

npm start

About

Wallet Service built with Nodejs, Typescript, Knex and MySQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages