Skip to content
Austyn Guo edited this page Apr 24, 2016 · 8 revisions

Detailed Windows, Mac, *nix dev setup instructions

These instructions are a more detailed version of what you'll find the project README

Installing Node

The simplest way is with one of Node's provided downloadable installation packages available for all the Operating Systems mentioned above. If you're stout of heart and think you'll be developing and/or contributing to other node applications in the future, you might consider installing Node using NVM, which allows you to run multiple versions of Node side by side. (that page also assumes you're on a mac or linux machine).

Installing & Running Mongo

The best way to install Mongo is using their guides located here but there's a lot of stuff you probably won't need unless you run in to trouble.

Mac Install

The easiest way to install Mongo is using homebrew. To install homebrew, scroll all the way to the bottom of that page to where it says "Install Homebrew" and paste that line into a terminal window. Once homebrew is installed, type into the terminal:

brew update && brew install mongodb

Once that's done you'll need to make a data directory in a location of your choosing so Mongo will know where to put the database we'll need.

mkdir path/to/data
# eg
mkdir ~/data

You can make that folder anywhere you want, so long as you remember it because we'll need to send it to Mongo momentarily.

Next, we need to start Mongo (as a service) to give the application somewhere to send the data we make.

mongod --dbpath <path to data directory>

Now Mongo should be running happily in the background, waiting to hear from our app.

Windows

To install Mongo, just head over to their downloads page and select the windows installer appropriate for your processor architecture, 32 bit or 64 bit if that means nothing to you just open up PowerShell or the Command Prompt (use PowerShell) and paste(Alt -> Space -> E -> P) the following:

wmic os get osarchitecture

That should settle that.

Once your download is complete, run the installer and everything should be fine, just keep track of the directory it's installed in. By default, it should live in C:\Program Files\ or equivalent. Once installation is complete you will need to start/run Mongo. From PowerShell you need to make a directory to store the data in so simply:

> mkdir data

You can put it anywhere you like just make sure to keep track of it for when we start Mongo with:

> & 'C:\Program Files\Mongo 2.6\bin\mongod.exe' --dbpath C:\path\to\data 

You can set Mongo up to run as a service, for that you can head over to here. Otherwise, just open up another PowerShell window and on we go. To stop Mongo, just press Ctrl + C in the PowerShell window it is running.

Linux

If you use Linux, this is probably not worth repeating here, just head over to Mongo's installation guide if you need assistance.

Installing Memcached

Installing memcached is as simple as:

brew update && brew install memcached

on OSX machines. For *nix use your package manager:

apt-get update
[sudo] apt-get install memcached

Unfortunately, Windows users will have to fend for themselves on this one but the application will still run without Memcached (on the default port, fyi). If there is a way of running Memcached on your Windows box that doesn't involve a VM or similar, please feel free to add it here.

To run Memcached, just open a terminal tab or window and type memcached assuming the executable has been added to your path. If not, go to your machines default installation path and run the binary from there. There isn't any output from the program that is sent to stdout so don't worry if it looks like nothing is happening.

Dev Setup

Assuming you've gotten this far with no trouble, you can now follow the steps in the README under "Getting Started". cd into the application directory and type npm install. Again, you'll see a bunch of text fly by while all of your project-specific dependencies are installed (they're defined in the file package.json, if you're curious)

After that, type node server.js from the project root. If all goes well, the last line on the terminal should say Express server listening on port 3000. Once you see that, you can view the app by going to http://localhost:3000 in your browser.