Coder Social home page Coder Social logo

nb's Introduction

Installation

Local Dev

  1. clone repo then install packages using the command npm install

  2. Install PostgreSQL and Create DB for NB with a user that has full access to it. Helpful resource.

  3. 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;
  1. Run NB in separate terminals

    • Run backend using command npm run dev
    • run UI using command npm run serve
  2. 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.

Deploy NB (Production)

  1. SSH to the server ssh -i [YOUR_KEY].key [USER]@[HOST].csail.mit.edu

  2. Install NodeJS curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs Helpful resource.

  3. Install PM2 sudo npm install -g pm2 Helpful resource.

  4. Follow steps 1 & 2 from Local Dev (see above).

  5. Configure HTTPS on the server. Helpful resource.

  6. 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
  1. To generate UI bundle, run npm run build.

  2. To start NB, run the following command sudo pm2 start npm --name "NB" -- start.

  3. You should be able to access NB using [HOST].csail.mit.edu.

Useful PM2 Commands

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

nb's People

Contributors

alisaono avatar jumanafm avatar maryam-a avatar barryam3 avatar akshajk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.