-
clone repo then install packages using the command
npm install
-
Install PostgreSQL and Create DB for NB with a user that has full access to it. Helpful resource.
-
Add a config file for your database called config.js structured like below:
var config = {
db: {
name: 'YOUR_DB_NAME',
user: 'YOUR_DB_USERNAME',
pass: 'YOUR_DB_PASSWORD'
}
}
module.exports = config;
-
Run NB in separate terminals
- Run backend using command
npm run dev
- run UI using command
npm run serve
- Run backend using command
-
Access UI on https://127.0.0.1:8080/ . Note: Since we're using a self generated certificate for development, the browser will alert that you are running an insecure server. In Chrome type: thisisunsafe.
-
SSH to the server
ssh -i [YOUR_KEY].key [USER]@[HOST].csail.mit.edu
-
Install NodeJS
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs
Helpful resource. -
Install PM2
sudo npm install -g pm2
Helpful resource. -
Follow steps 1 & 2 from Local Dev (see above).
-
Configure HTTPS on the server. Helpful resource.
-
Create .env file with the following content
SSL_KEY=PATH_TO/privkey.pem
SSL_CERT=PATH_TO/cert.pem
SSL_CA=PATH_TO/chain.pem
PORT=443
-
To generate UI bundle, run
npm run build
. -
To start NB, run the following command
sudo pm2 start npm --name "NB" -- start
. -
You should be able to access NB using
[HOST].csail.mit.edu
.
sudo pm2 list # list all processes
sudo pm2 reload <ID|NAME|all> # reload after changes to the code
sudo pm2 del <ID|NAME> # delete process by id or name
sudo pm2 log < |NAME> # show log for all or by name
sudo pm2 log all # show all logs