- Install nodejs v5.x.x, npm, mongodb & pm2
- Install all required dependencies
- configure enviroment (If default configuration is not suitable)
- run mongodb
- run the script
Install pm2 globally
$ npm install pm2 -gInstall package with minimal required project dependencies:
# Download dependencies and build frontend part
$ git clone https://github.com/garage-it/SmartHouse.git
$ cd SmartHouse
$ npm installTo start mongodb as a service:
$ sudo service mongodb start- To start backend:
$ npm startStart options:
- --mock -will start broker with mock data
- --port -will start backend on specified port (8080 is default)
- --node -will start jobs via node, but not pm2
- --log -start process in node mode and out broker logs
Example (start backend with mock data and console output):
$ npm start -- --mock --log- To get help (list of all commands & options) :
$ npm run index- To stop backend:
$ npm stop- To get status:
$ npm run statusTo override default configuration (listed below):
- set custom environment variables
- create .evn file based on .env.example
* MONGO = 'mongodb://localhost/db'
* SH_PATH_FRONTENT_DIST = './node_modules/smart-house-frontend/dist'
* PATH_BACKEND_CMD = './node_modules/smart-house-backend'
* PATH_BROKER_CMD = './node_modules/smart-house-broker'
* PORT='80'
* MQTT_PORT='1883'
* MQTT_HOST_NAME='localhost'
* MQTT_USER_NAME='USERNAME'
* MQTT_PASSWORD='PASSWORD'