Code Monkey home page Code Monkey logo

simple-wallet-app's Introduction

Simple Wallet App

This application was created for demo simple wallet app with asynchronous transaction.

List of stack:

  • NodeJs with Fastify
  • PostgreSQL
  • Prisma
  • Docker

Table of Contents

  1. Installation
  2. Usage
  3. Running with Docker
  4. API Documentation
  5. Testing the App

Installation

To install and run this application locally, follow these steps:

$ git clone https://github.com/username/backend-app.git
$ cd simple-wallet-app
$ npm install

Configure your .env file based by .env.example and adjust the parameters:

$ cp .env.example .env

Usage

Makesure your postgres is running and migrate and seed the database with this command:

$ npm run prisma:generate
$ npm run prisma:db:init
$ npm run prisma:db:seed

To start the api service, run the following command:

$ npm run build
$ npm run start

Running with Docker

To install and run this application with docker, follow these steps:

$ git clone https://github.com/username/backend-app.git
$ cd simple-wallet-app

Configure your .env file based by .env.example and adjust the parameters:

$ cp .env.example .env

Then run database and api service with single command:

docker-compose up

API Documentation

For the API documentation you can check the postman collection with its example and environment. You can get the postman by this links:

Below is list of route provided:

  • User login
    • Route: (POST) /auth/login
    • Required body: email (string), password (string)
  • User register
    • Route: (POST) /register
    • Required body: email (string), password (string), name (string)
  • Get user wallets
    • Route: (GET) /user/wallets
    • Required header: Authorization: Bearer <jwt_token>
  • Get user transaction histories
    • Route: (GET) /user/wallets/:walletId/histories
    • Required header: Authorization: Bearer <jwt_token>; path params: walletId (int)
  • Check transaction status
    • Route: (GET) /transaction/:transactionId
    • Required header: Authorization: Bearer <jwt_token>; path params: transactionId (string)
  • User withdraw
    • Route: (POST) /transaction/withdraw
    • Required header: Authorization: Bearer <jwt_token>; body: accountType (int), amout (int/float), toAddress (string)

Testing the App

You can use 2 user for simulating the transaction. Lisf of user:

  1. Email: [email protected]
    Password: test1234
    
  2. Email: [email protected]
    Password: test1234
    

simple-wallet-app's People

Contributors

tukangk3tik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.