Skip to content

General Information

Renzo van Wyk edited this page May 20, 2019 · 4 revisions

Quickstart Guide

Prerequisites:

nodejs, typscript, docker, docker-compose, mysql.

To run via docker:

  1. Configure the environmental variables in docker-compose.yml.
  2. Run npm run docker-run.
  3. API requests can be sent to 0.0.0.0:3000.
  4. To get the first admin token, send a POST request to 0.0.0.0:3000/token with the following JSON { "userName": "admin", "pssword": "admin" }.

To run locally:

  1. After downloading the project, rename sample.env to .env.
  2. Configure the options in .env.
  3. Run npm install.
  4. Run npm run watch-node.
  5. API requests can be sent to 127.0.0.1:3000.
  6. To get the first admin token, send a POST request to 127.0.0.1:3000/token with the following JSON { "userName": "admin", "pssword": "admin" }.

User Authorisation

HTTP requests are authorised via bearer tokens. After a token has been obtained through a POST request to the /token path, it has to be included as a bearer token in the headers of subsequent requests. For examples of how to do this via CURL requests, refer to the sections on sending requests to specific routes.

Knex Guide

Two KNEX configurations are available. They only differ in database seeds. Schemas and connection parameters are identical between the two configurations.

Development Configuration

This configuration seeds the database with example users, accounts, and transactions, as well as the initial Admin user and equity account entries. It is the default when running tests or an instance of the app locally. It can be switched to the production configuration by changing the value of NODE_ENV in .env to production.

Production Configuration

This configuration seeds the database with only the initial Admin user and equity account entries. It is the default when running continuous integration tests or building a docker image. It can be switched to the development configuration by changing the value of NODE_ENV in the respective yaml files to development.

Clone this wiki locally