Code Monkey home page Code Monkey logo

vunbox-backend's Introduction

Vunbox-Backend

A monorepo containing the backend infrastructure services powering: Vunbox.com

A site providing transparency and auditability for the Wax Blockchain.

Service Definitions

Each "app" is designed to serve a specific pourpose, we have listed them below.

  • feed - Arguably the most important app, listens for live socket events from the Wax API.
  • wet - Grabs case information from the wax api and caches it locally in the db.
  • stats - While generally named, Listens for changes in events and calculates user stats in realtime.
  • casestats - Listens for changes in case events and calculates case stats in realtime.
  • casesites - Listens for changes in case events and calculates casesite stats in realtime.
  • api - Fetches data from various tables in the database, exposing a simple api.
  • snapshots - Listens for changes in events and forms "snapshots" of stats each day.
  • leaderboards - Forms leaderboards for various properties. WIP

Installation & Setup

Required Dependencies

This project is built and maintained using Node.js, RethinkDB & Yarn.

Enviornment Variables

Required enviornment variables used by the various apps.

  • name - name of the app you want to run
  • port - port to expose the app/api
  • rethink.db - database name for rethinkdb
  • rethink.host - host url/ip for rethinkdb
  • rethink.port - port for rethinkdb
  • rethink.user - username for rethinkdb
  • rethink.password - password for rethinkdb
  • gcloud.projectId - project id associated to the bucket
  • gcloud.keyFilename - gcloud bucket credentials
  • gcloud.bucket - gcloud bucket name
  name=api
  port=9001

  rethink.db=test
  rethink.host=localhost
  rethink.port=
  rethink.user=
  rethink.password=

  # needed only for snapshots app
  gcloud.projectId=
  gcloud.keyFilename="./secrets/gcloud.json"
  gcloud.bucket=

Install Docker

  curl -fsSL https://get.docker.com -o get-docker.sh
  sudo sh get-docker.sh

Start Rethinkdb Instance

  docker pull rethinkdb
  docker run -d -P --name rethink1 rethinkdb

Start Service(s) "apps"

Below are some simple instructions on how to run an app.

  1. Create a .env file in the root directory using the template above.
  2. Fillout the .env template with your relevant details.
  3. Start the app name you defined using yarn start
    • Alternatively, you can use various defined shorthand methods.
    • yarn feed, yarn stats, yarn api, ... ( see package.json )

vunbox-backend's People

Contributors

dependabot[bot] avatar tacyarg avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

snax4a

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.