Giter Site home page Giter Site logo

jeremiah-ropo / crypto-payment-gateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tadejgasparovic/crypto-payment-gateway

0.0 0.0 0.0 28.51 MB

NodeJS & ReactJS cryptocurrency RPC payment gateway (unfinished due to loss of interest by client)

Dockerfile 1.13% JavaScript 93.67% HTML 2.37% CSS 1.05% Shell 1.78%

crypto-payment-gateway's Introduction

Crypto Payment Gateway

Crypto payment gateway is a lightweight ReactJS & NodeJS payment processor designed to work with a large variety of crypto-currencies.

Index

Supported crypto-currencies

The system has been developed with Oculor (https://oculor.io) in mind, but it can hook into virtually any crypto-currency out there as long as it supports a couple basic JSON RPC commands and walletnotify

  • getnewaddress - used to generate a new payment address
  • getrawtransaction - used to retreive the full transaction received through walletnotify
  • walletnotify script should POST the JSON object { "txid": "<txid>", "currency": "<coin-symbol>" } to the https://payment-gateway/transactions gateway API endpoint

Modules

The gateway is composed of 4 separate projects / modules located in modules/.

payment-gateway

This module is the brain of the system. It's a NodeJS backend service which serves a RESTful API used by all 3 other modules as well as 3rd party applications. Payment gateway docs.

admin-panel

This is a frontend module built using ReactJS and Material UI. It offers the gateway operator easy management of the entire system. Admin panel docs.

[WIP] checkout-frontend

This module is yet to be implemented in a future upgrade.

This is a frontend module built using ReactJS and Material UI. It offers a checkout flow to developers who are looking for a fast way to incorporate crypto-currency payments into their application. The developer only needs to redirect the user to the checkout frontend with appropriate query values set and this module handles the rest. Checkout frontend docs.

[WIP] client-portal

This module is yet to be implemented in a future upgrade.

This is a frontend module built using ReactJS and Material UI. It's a portal for crypto-currency proviers and merchants to manage their crypto-currencies and view their earnings respectively.

Configuration

All configuration files are located in modules/config.

The payment gateway config can be edited at any time during runtime and the payment-gateway service will detect the changes automatically to allow for 100% availability. The other 3 projects on the other hand need to have their Docker container rebuilt in order to update their config values. This is because the config file needs to be bundled together with the rest of the app which doesn't take a trivial amount of time. Since the old container can continue running while the new one is being built, service interruption is minimized (a couple seconds at most).

Docker

The entire payment gateway is designed to run under Docker. All Dockerfiles files can be found inside docker/ and docker-compose.yml is located in the root of this project.

Quick start: ./dev.sh

Bringing up the containers requires multiple environment variables to be set. To make setting these variables easier for development purposes you can use up.sh found in the root of this project. The comment in the begining of the script provides a working example command you can simply copy-paste into your terminal and bring up all required containers, 0 configuration required (provided you have generated the required SSL certificates). To stop all containers you can use the helper script down.sh.

Container names

All container names follow the naming convention: crypto-payment-gateway_<service-name>_<build-env> where <build-env> is the value of the BUILD_ENV environment variable.

Docker compose environment variables

List of all environment variables supported by docker-compose.yml.

Variable Description Required
BUILD_ENV production or development Yes
CONFIG_DIR Usually ./modules/config/ Yes
SSL_CERT SSL cert in PEM format Yes
SSL_KEY SSL private key in PEM formats Yes
MONGO_DATA MongoDB data volume. More. Yes
GATEWAY_PORT_PLAIN Gateway API HTTP port Yes
GATEWAY_PORT_SECURE Gateway API HTTPS port Yes
ADMIN_PORT_PLAIN Admin panel HTTP port Yes
ADMIN_PORT_SECURE Admin panel HTTPS port Yes
PORTAL_PORT_PLAIN Client portal HTTP port Yes
PORTAL_PORT_SECURE Client portal HTTPS port Yes
FRONTEND_PORT_PLAIN Checkout frontend HTTP port Yes
FRONTEND_PORT_SECURE Checkout frontend HTTPS port Yes

SSL

The SSL certificate can be copied into modules/ssl/ or generated using the genssl.sh script (for development only!). If the certificate is located elsewhere on the system it can still be linked into the project by passing the relavant paths to up.sh.

Database

The gateway uses MongoDB as it's database. To provide persistance data storage the MongoDB container requires a data volume. The local directory you wish to use as the Mongo data volume can be passed to up.sh or set in an environment variable just like SSL cert paths.

Oculor dev daemon

Inside oculor-dev-daemon/ is a test Oculor daemon with a Dockerfile you can use for quickly spinning up an Oculor daemon if needed during development. The daemon listens on port 48844 on all interfaces and accepts all connections (covenient for development but unsafe for production!). It accepts the username oculor and password oculor-dev. To start it simply run ./oculor-dev-daemon/up.sh.

crypto-payment-gateway's People

Contributors

tadejgasparovic 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.