Wiki

Clone wiki

scl-manips-v2 / docu / scl-web

Setting up SCL Web

We shall assume you have already downloaded scl and set stuff up.

Dependencies and Build System

  • To begin, we set up the following:
$ sudo apt-get install nodejs nodejs-legacy npm
# Alternatively : Run me if you get errors install bower/gulp/other js packages later
$ sudo apt-get install --reinstall --purge nodejs nodejs-legacy npm
  • Next install bower (this is a javascript package manager.. aka. the apt-get of js)
# If you get errors while doing this, make sure you install nodejs-legacy and/or reinstall/purge nodejs and npm
$ sudo npm install -g bower
  • Next install gulp (this is a javascript build system.. aka. the cmake of js)
# If you get errors while doing this, make sure you install nodejs-legacy and/or reinstall/purge nodejs and npm
$ sudo npm install -g gulp
  • For more details about what's going on, look at the README from the scl_web application SCL Web App

Your first app

  • Now we'll go ahead and create a new app from scratch.
  • First install the server side libraries (used by node) using npm.
    • Note: this installs the libraries into the local dir
# Make a dir for your app
$ cd scl.git/applications-web && mkdir scl_test_web
# Copy over the npm (apt-get) package manifest. We will use this to install stuff into this dir (bcoz js uses subdir paths)..
$ cp ../scl_web/package.json ./
# Install the packages specified in the manifest into this local dir..
$ npm install
# This should have set up a bunch of stuff in the node_modules subdir
$ ls node_modules
  • NOTE: Node.js searches for this directory, "node_modules". It will start in the current directory (relative to the currently-executing Javascript file in Node) and then work its way up the folder hierarchy, checking each level for a node_modules folder.
  • Now we'll install the front-end packages (js and css that runs in the client brower) using bower
    • Note: this installs the libraries into the local dir
$ bower install
# This should have set up a bunch of stuff in the bower_components subdir
$ ls bower_components

Updated