Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

tinkerhubco/docnest-server

Repository files navigation

DocNest

CircleCI

Description

Doctor Nest is built from nest for the doctors of tomorrow 🔥 🔥 🔥

Installation

$ npm install

Database Setup

# CREATE DATABASE docnest_dev;
# \c docnest_dev
# CREATE EXTENSION citext;
# CREATE EXTENSION pg_trgm;
# CREATE USER docnest WITH PASSWORD 'docnest';
# GRANT ALL PRIVILEGES ON DATABASE "docnest_dev" to docnest;

# CREATE DATABASE docnest_test;
# \c docnest_test
# CREATE EXTENSION citext;
# CREATE EXTENSION pg_trgm;
# CREATE USER docnest_test WITH PASSWORD 'docnest_test';
# GRANT ALL PRIVILEGES ON DATABASE "docnest_test" to docnest;
# \q

Database Migrations

Database migration uses the TypeORM migration it connects through the given config of ormconfig.js. Add NODE_ENV to run on different env, configurations were catch by config module by default

# creating migration
$ npm run migration:create --name MigrationName

# running up migration
$ npm run migration:up

# running down migration
$ npm run migration:down

Running the app

# development
$ npm run start

# staging mode
$ npm run start:staging

# production mode
npm run start:production

Test

# unit tests
$ npm run test