Skip to content

Installation

Brian Redd edited this page Oct 1, 2016 · 7 revisions

Install c++ Compiler

Mac OSX

If you have XCode installed you can skip this step. If not, then you have a couple of options. You can install XCode (approximately 4GB) within the Apple App Store or just the required Command Line Tools. To install only the Command Line Tools, follow the following instructions:

  1. Launch the Terminal, found in /Applications/Utilities/
  2. Type the following command string
    xcode-select --install
  3. A popup will appear that asks: “The xcode-select command requires the command line developer tools. Would you like to install the tools now?” confirm by selecting 'Install'
  4. After the install, verify you have the Command Line Tools by executing the following command
    xcode-select -p

If a directory path is returned you are all set. If you receive an error, or would like a more detailed explanation please take a look here.

Linux (Ubuntu & Debian)

Verify you have a c++ compiler with this command
dpkg --list | grep compiler

If you see something like 'gcc-4.8' in the list, you should be set. If not, execute the following command:
sudo apt-get install gcc-4.8

If all else fails, refer to this site: http://gcc.gnu.org/install/

Windows

Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator). If this doesn't work please visit Microsoft's Node.js Guidelines for Windows for additional tips.

Install NVM

Mac OSX and Linux

NVM is a simple bash script to manage multiple active node.js versions. It allows you to switch between versions in a breeze. This tool is not required for development, however it is recommended.

  1. To install nvm, you can use the install script using cURL
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
  2. Restart the terminal session by closing and reopening it
  3. Verify nvm was installed correctly by executing the following command:
    nvm --version

Note: On OSX, if you get nvm: command not found after running the install script, your system may not have a [.bash_profile file] where the command is set up. Simply create one with the following command and run the install script again.
touch ~/.bash_profile

If you encountered any issues or want to perform a custom installation, please see the official nvm page.

Windows

Unfortunately, nvm is not available for Windows but alternatives do exist, like nvm-windows. Click here to download the installer. If you have Node already installed, you will need to uninstall it before running the nvm-windows installer. Please refer to the nvm-windows page if you have any questions.

Install Node and NPM

  1. With nvm, install node with the following command
    nvm install 4.4.2
  2. Make sure 4.4.2 is the current version
    nvm use 4.4.2
  3. Next, verify node was installed correctly
    node -v
  4. Verify npm was installed correctly
    npm --version

If you would like to check out some other use cases with nvm take a look at the nvm page or this short blog post.

Install Git

If you already have git installed then you can skip this step. To verify, try executing the following command
git --version

*Note: If you installed OSX's Command Line Tools then git should be installed

If you received an error, go here to download and install git. Once git is installed make sure it's configured by executing the following commands

git config --global user.name "Your Name"
git config --global user.email youremail@youremaildomain.com

Clone and Install Augeo

In your desired directory, clone the repository with the following command. Make sure to change directories, cd augeo, after the clone.
git clone https://github.com/bpred754/augeo.git

*Note: If you're running Windows, you will first need to execute:
npm install bcrypt --msvs_version=2015

Install app dependencies with:
npm install

Install Foreman globally - Foreman is a manager for Procfile-based applications
npm install -g foreman

Install Bunyan globally - Bunyan is a JSON logging library for node.js services
npm install -g bunyan

Configure Environment Variables

For this application, a Procfile is being used to start the app with declared environment variables. In the root directory of the application, open the file named environment.env and add the missing information.

If you do not have a MongoDB instance then I suggest creating a sandbox DB at mLab, or if you prefer, you can install MongoDB to your machine and run it locally.

Refer to the Interface Setup section below on how to obtain the missing information for the Github, SendGrid, and Twitter sections.

Configure Unit Test Execution

Open environment.env and update the TEST field to true. In the root directory of augeo, execute the test cases with the following command:
nf run npm test -e environment.env

*Note: It might be more convenient to create a separate .env for your unit test execution (e.g., test.env). In this case, make sure to substitute your test environment configuration file into the command above.

Start Augeo

Finally, when everything is configured and all the test cases are passing, start the server with the following command from the augeo root directory:
nf start -e environment.env

Access the login screen with: http://127.0.0.1:8080/login. *Note: Make sure the TEST field in environment.env is set to false.

Since Augeo utilizes browserify, it is helpful to spawn 2 separate terminal instances to watchify both client side javascript and css changes. So, in total you should have 3 terminal sessions:

  1. nf start -e environment.env
  2. npm run watch-js
  3. npm run watch-css

Interface Setup

Github

To obtain the necessary Github information for the environment.env file and to successfully use the Github components of Augeo, please follow the steps below:

  1. If you do not have a Github account, create one here
  2. Once signed up and logged in go to your OAuth Applications in your profile's Developer Settings section
  3. Click Register a new Application in the top right of the screen
  4. The application name can be anything you want since it will only be used for development purposes and won't be used in production. For example:
    brianredd-augeo-dev
  5. Put https://www.augeo.io for the Homepage URL
  6. Give a short description, such as: Github app for Augeo development
  7. Put http://127.0.0.1:8080/github-api/callback for the Authorization callback URL
  8. Press 'Register Application'
  9. Update Augeo's environment.env file

SendGrid Email

Calls to SendGrid's email API are disabled for local development. However, it can be enabled by switching the environment variable ENV to prod. Just beware that this will enable other features that are supposed to be disabled for local development. To develop with SendGrid's API, you will need to create an account at SendGrid's website and then update the environment.env file with your information.

Twitter

Developing with the Twitter API requires access tokens. To obtain Twitter access tokens follow the steps below:

  1. If you do not have a Twitter account go here and create one
  2. Next, you will need to go here and sign in to create a Twitter application
  3. Press the 'Create New App' button
  4. The name can be anything you want since it will only be used for development purposes and won't be used in production. For example:
    brianredd-augeo-dev
  5. Fill in a brief description, like:
    Twitter app for Augeo development
  6. Put in a placeholder for the Website field
    https://augeo-placeholder.placeholder
  7. Leave the Callback URL field blank
  8. Read and Agree to the Developer Agreement
  9. Press 'Create your Twitter Application'

After creating your new Twitter application make sure the permissions are set to read, write, and direct messages. Finally, generate and note the Consumer Key, Consumer Secret, Access Token, and Access Token Secret. This information will need to be updated in the Twitter section of the environment.env file.