Universal Health Coin - Wallet Wrapper & Management API
Switch branches/tags
Nothing to show
Clone or download
Latest commit 9afb62c Oct 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Rewrote get chats to be different for provider and patient Aug 29, 2018
api-docs Added swagger documentation handler and swaggerized the user resource Apr 24, 2018
controllers Fix for patient profile lookup permission when the patient profile do… Oct 15, 2018
federation Refactored UHC > UHX May 30, 2018
integration Fixes for UhX to UHX template Oct 11, 2018
logic Adds auto activation for purchase transactions Oct 16, 2018
model Fix null error on admin purchase page Oct 18, 2018
payment_processor Storage feature Jul 9, 2018
repository Fix to automatically sort careplans/relationships Oct 25, 2018
sql - FK link between chat_room & chat_message Oct 25, 2018
templates Fixes for UhX to UHX template Oct 11, 2018
test Refactored UHC > UHX May 30, 2018
tfa Fixes for UhX to UHX template Oct 11, 2018
.gitignore Refactored UHC > UHX May 30, 2018
CONTRIBUTING.md Fixes for UhX to UHX template Oct 11, 2018
LICENSE.md Added license.md file Apr 23, 2018
README.md Merge branch 'master' into develop Oct 25, 2018
api.js Fixes for UhX to UHX template Oct 11, 2018
app.js Fixes for UhX to UHX template Oct 11, 2018
config.empty.js Fixes for UhX to UHX template Oct 11, 2018
exception.js Fixes for UhX to UHX template Oct 11, 2018
package-lock.json - Package update to resolve vulnerability Oct 19, 2018
package.json - Package update to resolve vulnerability Oct 19, 2018
security.js Fixes for UhX to UHX template Oct 11, 2018
uhx.js Merge branch 'Subscription' into Subscription_Billing Aug 30, 2018
worker.js Refactored UHC > UHX May 30, 2018

README.md

Universal Health Coin API

Enabling easy access to UHX assets

What is the UHX API?

The Universal Health Coin (UHX) API provides a wrapper to wallets on the backend blockchain, allowing more novice end-users to interact with with third party providers of services and other wallets.

In short, the UHX API provides:

  • A simple OAUTH 2.0 token service allowing a "Log in with UHX" function
  • The ability to query, read, and post transactions to the UHX user wallets
  • The ability to acquire UHX tokens with a third party credit card processor

Getting Started

To get started with the UHX API you will need to install the following pre-requisites:

  • NodeJS 8.11 or later
  • PostgreSQL 9.4 or later
  • Python 2.7
  • OpenSSL

To setup / run:

  1. Clone the UHX API project. master contains the latest stable release and develop contains the latest development release.
    $ git clone https://github.com/UHCToken/uhx-api.git
    $ cd uhx-api
    $ git checkout develop
    
  2. Refresh the node libraries using NPM:
    $ npm update
    
  3. Create the UHX database:
    $ sudo su - postgres
    $ psql
    # CREATE USER uhx PASSWORD 'XXXXXXXX';
    # CREATE DATABASE uhx OWNER uhx;
    # \q
    $ exit
    
    Note: These instructions are using a Linux console, for environments with a user interface we suggest using PGAdmin.
  4. Install the UHX schema
    $ cat uhx.sql | psql -h localhost -U uhx -W --dbname=uhx
    
  5. Configure the API by copying the sample configuration file
    $ cp config.empty.js config.js
    
    Note: Ensure that your configuration parameters are correct before running the next step
  6. Run the unit tests for the API
    $ npm test
    
  7. Run the API
    $ node app.js
    
  8. Verify the service is running by navigating to the swagger documentation

Configure the API

The configuration file copied over uses example data and uses crypto testnets. To switch over to real cryptocurrency the configuration endpoints for each network need to be set in the configuration file and wallets need to be generated and set.

Git Workflow Used

If you're interested in contributing, see the CONTRIBUTING.md notes. You'll see several branches in this repository:

  • master - The master branch contains the latest stable release of the UHX API
  • develop - The develop branch contains the latest unstable development code for the UHX API
  • release/XXX - The release branches are branches which are used for maintenance of older releases of the UHX API. We tag each release as well.
  • feature/XXX - The feature branches are branches where third party developers typically stage new features to the UHX API. The UHX team typically prunes these once the feature is merged into develop
  • issue/XXXX - The issue branches are branches where third party developers typically stage bug fixes to reported issues on the UHX API. The UHX team typically prunes these once the bug fix is merged into develop