/oncare-service

Oncare coding challenge

Primary LanguageTypeScript

About

Oncare Service

API Documentation

Postman API documentation: https://documenter.getpostman.com/view/5904643/UVeKp4jp

Installation

To clone the project:

https://github.com/Theshedman/oncare-service.git

cd into the oncare-service directory

cd oncare-service

create a .env file with actual values similar to the .env.sample file.

Using Docker

Make sure that Docker is installed in your system.

Build the docker image by running this command:

docker build -t oncare-service .

After building the docker, you can run it by executing this command:

docker run \
  -e DB_USER="" \
  -e NODE_ENV="" \
  -e PORT=9082 \
  -e DB_HOST="" \
  -e DB_PORT=5432 \
  -e DB_NAME="" \
  -e DB_PASSWORD= \
  -e REDIS_PORT= \
  -e REDIS_HOST="" \
  -e REDIS_PASSWORD="" \
  -e REDIS_USERNAME="" \
  -e JWT_SECRET="" \
  -p 9082:9082 \
  oncare-service

Running the application locally

install project dependencies

yarn install

compile Typescript files to Javascript (by continuously watching)

yarn tsc -w

open another terminal, and run the project

yarn start:dev

To run test

yarn test

Knex.js Configuration

To make migrations

knex migrate:make <migration-name>

To run all migrations

knex migrate:latest

To create seeds

knex seed:make <seed-name>

To run seeds on database

knex seed:run