Giter VIP home page Giter VIP logo

transaction-system's Introduction

Transaction System - Node.js/gRPC

This is a Node.js based transaction system API built following the microservices architecture.

Table of Contents

Modules

The project consists of the following modules:

server

The server module consists of the core logic to handle transactions.

Dependencies

  • node-grpc: gRPC Server
  • MySQL: Database
  • Sequelize: ORM
  • nodemailer: Mail Client
  • bcrypt: Password Hashing
  • socket.io-client: Socket.IO client

Running the server

In order to run the server, a MySQL database is required. Download and install MySQL if your system does not have it already installed. Make sure the MySQL server is running.

A configuration file is required in order for the server to work. Create a file name .env.development in the server folder with the following fields:

DB_HOST="127.0.0.1"
DB_USER="root"
DB_PASSWORD="password"
DB_NAME="transaction_db"
DB_PORT="3306"

GRPC_ADDRESS="0.0.0.0"
GRPC_PORT="50051"

SOCKETIO_ADDRESS="0.0.0.0"
SOCKETIO_PORT="3001"

ENABLE_NODEMAILER=0
NODEMAILER_EMAIL="[email protected]"
NODEMAILER_PASSWORD="mypassword"

Install all dependencies

cd server && npm install

When running for the first time

npm run init

After initialization, the server can be run with

npm start

gateway

The gateway module consists of a standard REST API to communicate with the server using gRPC client.

Dependencies

  • express: HTTP Server
  • jsonwebtoken: Handle JWT
  • bcrypt: Password Hashing

Running the gateway

A configuration file is required in order for the gateway to work. Create a file name .env.development in the gateway folder with the following fields:

GRPC_ADDRESS="0.0.0.0"
GRPC_PORT="3000"

JWT_KEY="MY JWT KEY"
JWT_EXPIRY_TIME="n d"

Note: The gateway is incomplete and all functionality might not work. Consider using BloomRPC to use the server. The .proto files can be found in the common folder.

Install all dependencies

cd gateway && npm install

Start the gateway

npm start

common

The common module consists of files shared between two or more modules.

Dependencies

  • No dependencies.

qr-socketio

The qr-socketio module handles QR encoding/decoding and communication between server and a demo browser client. User can create a transaction request which generates a QR code. This QR code can be scanned by other users to transfer balance from their account to the user who requested the balance.

Dependencies

  • express: HTTP Server
  • socket.io: Socket.IO (Websocket)
  • styled-qr-code-node: QR Code generation

Running the qr-socketio server

The QR server has a web portal available at the root address.

Install all dependencies

cd qr && npm install

Start the QR server

npm start

System Features

  • standard transaction features
  • send and receive balance
  • get transaction history
  • user account creation and management
  • authentication using JWT
  • transaction verification through OTP
  • transaction request and completion through QR code
  • password hashing and encryption

transaction-system's People

Contributors

kritan10 avatar

Stargazers

 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.