Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Getting Started

Minh T. Nguyen edited this page Jul 9, 2015 · 13 revisions

Instructions for new developers

You can develop on Linux or Mac, though these instructions are easier for Mac.

Step 1: Get tools

Do these steps in order.

Python 2.7

  • Linux: Try running python2.7 to see if you already have it. If not, go to the Python site, download, and install.
  • Mac: Nothing to do; it's already installed.

Java 7

  • All platforms: Try java -version to see what you have. If you don't see "version 1.7" then download from Oracle and install.

Git

  • Ubuntu Linux: sudo apt-get install git
  • Mac or other Linux: Go to the Git site, download, and install. Close any existing terminal windows.

make

  • Linux: Nothing to do; it's already installed.
  • Mac: Go to http://developer.apple.com/downloads, download Command Line Tools for XCode, and install. You will need to obtain a (free) Apple developer ID in order to download.

Closure Compiler and Library

  • All platforms:
    • Make a local clone of the Closure library in your $HOME directory by typing:

        git clone https://github.com/google/closure-library.git closure
      

      The directory $HOME/closure should now exist.

    • Download the compiler zip file and unzip it in $HOME/closure (ignore the warning about overwriting README).

      • $HOME/closure/closure/goog and $HOME/closure/compiler.jar should now exist.

App Engine SDK 1.8 for Python (note, some versions below 1.7.6 have bugs!)

  • All platforms:
    • Download the SDK zip file.
    • In your $HOME directory, unzip the zip file.
    • $HOME/google_appengine/dev_appserver.py should now exist.

py.test (optional, but recommended)

  • All platforms: In a terminal window, type: sudo easy_install-2.7 pytest

Google JS Test

  • Linux: See instructions for Ubuntu or general instructions.

  • Mac: Go to the downloads folder and download gjstest-kegs.tar.gz. Unpack it in /usr/local with the following commands:

    cd /usr/local
    sudo tar xvfz ~/Downloads/gjstest-kegs.tar.gz
    
    • This will put libraries in /usr/local/Cellar and add symlinks to /usr/local/lib and /usr/local/bin. You may need to add /usr/local/bin to your $PATH.

Step 2: Get the code

  • Make a local clone of the code repository (this assumes you want to put the code in a directory called googlecrisismap):

      git clone https://github.com/google/googlecrisismap.git
    

Step 3: Build the app

Go into the googlecrisismap directory you created in Step 2 and type make.

Step 4: Test the app

To run all the tests: make test

You can run a single JS test continuously (~3-4 times per second) while you edit. For example: tools/ctest map_model_test

Step 5: Try the app!

  • Type: tools/run or, if you have made code changes, rebuild and run by typing make run

  • In an Incognito window, visit http://localhost:8000/.maps in a browser.

  • The first time you visit the page, you will see a list of test sign-in options. Choose either an 'alpha.test' or 'beta.test' user and click 'Sign in'.

  • Dismiss the welcome pop-up.

  • You will need to set up a domain before you can create a map. Click the red 'Create map' button and then click the 'Setup alpha.test' (or beta.test) button.

  • Click 'OK' on the domain administration popup.

  • Click 'Create map' to start editing a new map.

Clone this wiki locally