Skip to content

Latest commit

 

History

History
94 lines (59 loc) · 3.26 KB

express-stack.md

File metadata and controls

94 lines (59 loc) · 3.26 KB

Installfest Step 2: Node.js and Express Stack

Most of the coding work we do in weeks 4 - 5 will be driven by the back end web development framework Express. We'll install express as we go, on a project-by-project basis. For now, we'll install other tools we'll use along with Express.

Plan overview:

  1. Install Node.js, a platform for back end web development with the JavaScript programming language.
  2. Install JSHint and its Sublime Text packages to get realtime JavaScript syntax hints.
  3. Install MongoDB, the database we'll use with our Node.js and Express stack.

Node.js

  1. Install Node.js with homebrew by running the following command in the Terminal.
brew install node
  1. Run the Terminal command which node to check that Node.js was installed. The Terminal command node changes your Terminal into a Javascript REPL ("Read Evaluate Print Loop"), like the right hand side of repl.it. Type control+C twice to quite out of the REPL and return to the normal Terminal commands.

  2. Run the Terminal command which npm to check that npm is installed. The Node Package Manager, used through various npm commands, is a lot like Homebrew, except we'll use it for Node.js-specific tools instead of for general Mac tools. NPM packages are often called "node modules."

Nodemon

Nodemon (short for "node monitor") will make our node.js workflow more efficient.

Install nodemon globally with the following command:

npm install -g nodemon

JSHint for Sublime Text

It's time to install another Sublime Text package! (If you need a refresher on how to do this, you can go back to the Mac Dev Tools installFest.

  1. Select Package Control: Install Package to bring up the list of available packages. Select SublimeLinter from the list, and Package Control will install it for you.

  2. Repeat the step above to install the packages "SublimeLinter-jshint".

  3. Install jshint by typing the following in a terminal:

npm install -g jshint

MongoDB

MonogDB is a popular noSQL database. We'll use it to store data with our Node.js and Express stack.

  1. Use Homebrew to update all of our brew packages.
brew update
  1. Run brew install for MongoDB
brew install mongodb
  1. Then we'll need a directory for MongoDB to save data.
sudo mkdir -p /data/db
  1. Finally we'll want to make sure we have permission to read and write to this directory.
sudo chown -R $USER /data/db
  1. Run two commands to check whether the install worked. You should see a file path after each command.
which mongod
which mongo

RoboMongo

RoboMongo is a GUI (Graphical User Interface) tool to let us see the data in our Mongo databases.

  1. Go to robomongo.org and download the free (community) edition.
  2. Install it

ON TO STEP 3: PHP AND POSTGRES