Backend API for Hapi Plants system. Build on top of Nest.js (Node Express/ Typescript)
Other stacks used:
- TypeORM . A Conprenhensive and Advance ORM library for typescript.
- Chance JS. This library used to generate fake date in the database seeder.
- PubNub SDK. PubNub is a Realtime Data Streaming And Communication Platform.
Domain is the entitiy we manage, it represent a specific data encapsulated in its own end-point. Documentation for each domain route/endpoint is available here:
Prerequisites:
- NodeJS (v.8.9.0 LTS recommended)
- MySQL
Steps:
-
Create new MYSQL database e.g
hapiplant
-
Configure
ormconfig.json
file in the project root directory, if the file doesn't exist you can copyormconfig.json.example
Changeusername
,password
, anddatabase
according to your local MYSQL configuration. -
Install Typescript and TypeORM
$ npm install typescript, typeorm -g
This command will install all project dependecies, and install typescript
compiler and typeorm cli
in the global environment (OS)
-
Install The Project Package
From the project root directory run this command in the terminal:
$ npm install
$ npm start
or with autoreload demon:
$ npm run start:watch
$ npm run start:prod
$ npm run seed