Skip to content

Development Environment Setup & Deployment Instructions

Jun Zheng edited this page Oct 27, 2017 · 2 revisions
Author(s): Jun Zheng (junthehacker)
Date: October 27th, 2017
When contributing, please add your name to authors list, and update the date.
  • Missing database setup instructions (please contribute if anyone have time).
  1. Required Software
  2. Development Environment Setup
  3. Deployment Environment Setup

Required Software

  • Node.js, latest LTS version recommended.
  • NPM, match your Node.js version.
  • Less.js.
  • File watcher for Less.js [development environment only].

Node.js

Linux

It is recommended for you to use NVM (Node Version Manager). Run the following command to install NVM.

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

After successful installation, restart terminal, run nvm install --lts to install the latest LTS release.

macOS & Windows

Simply download the installer on https://nodejs.org/en/.

NPM

NPM (Node Package Manager) should already been installed. Run nvm -v to verify.

Less.js

Linux, macOS & Windows

We use Less for all stylesheets, so you have to install Less.js. Run the following command to install Less.js globally.

$ npm install less -g

Run lessc -v to verify your install.

jun@192:~/shared$ lessc -v
lessc 2.7.3 (Less Compiler) [JavaScript]

Install less-plugin-clean-css plugin to support minifying CSS output.

npm install -g less-plugin-clean-css

File Watcher for Less.js

You can choose from different file watchers for Less.js, less-watcher and less-watch-compile all works.

If you are using JetBrains IDE, then you are all set.

Development Environment Setup

Node.js

  • Clone the repository, and cd into it.
  • Run npm install to install all dependencies.

File Watcher for Less.js

Simply setup your Less watcher to compile all .less files to .css. If you are using less-watch-compile, the two main.less files are the ones you wish to always compile upon change.

If you are using JetBrains IDE, just use the file watcher tool.

Run

node app.js

http://localhost:8080 💯

Deployment Environment Setup

Same as development environment, but you do not need File Watcher for Less.js part, instead, run one-time compile.

lessc --clean-css public/app/styles/chatroom/main.less public/app/styles/chatroom/main.css && \
lessc --clean-css public/app/styles/ice/main.less public/app/styles/ice/main.css