Backend Sevice for BrainBlocksWebPoS
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
.babelrc
.eslint
.flowconfig
.gitignore
.huskyrc
.prettierrc
LICENSE.md
README.md
config.js
cron-extra-currencies.js
currencies.js
index.js
nano.js
package-lock.json
package.json
postgres.js
server.js
transactions.js
updateExtraCurrencies.js
yarn.lock

README.md

BrainBlocksWebPoS-Service

Backend Sevice for BrainBlocks Web PoS

Running locally

  1. Clone the repo

  2. Install postgres on your machine

  3. Create a postgres database with the following schema

    -- Table Definition ----------------------------------------------
    
    CREATE TABLE pos_transactions (
        id integer DEFAULT nextval('transactions_id_seq'::regclass) PRIMARY KEY,
        address text,
        link text,
        type text,
        nano_value bigint,
        currency text,
        fiat_value real,
        created_at timestamp with time zone,
        send_block text,
        token text
    );
    
    -- Indices -------------------------------------------------------
    
    CREATE UNIQUE INDEX transactions_pkey ON pos_transactions(id int4_ops);
    
  4. Create a .env file at the root and add contents like the following:

    NODE_ENV="development"
    STAGE="dev"
    SERVER_PORT="3001"
    DB_HOST="localhost"
    DB_USER="your-db-username"
    DB_NAME="your-db-name"
    DB_PASSWORD="your-db-password-if-any"
    DB_PORT=5432
    
  5. Then just do $ npm|yarn install && npm|yarn start