Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

google/ioweb2015

Google I/O 2015 web app

Setup

Prerequisites

  • Go 1.4.

  • Optional: gcloud tool and app component to run and deploy GAE-based backend (hint: gcloud components update app).

    Once gcloud and app component are installed, you'll need to do a one-off configuration by executing the following command: gcloud config set project <project-id>. Project ID can be any non-empty string if you just want to run the app locally.

Setup

  1. git clone https://github.com/GoogleChrome/ioweb2015.git
  2. cd ioweb2015
  3. npm install
  4. gulp setup

If you plan on modifying source code, be a good citizen and:

  1. Install EditorConfig plugin for your favourite browser. The plugin should automatically pick up the .editorconfig settings.
  2. Obey the pre-commit hook that's installed as part of gulp setup. It will check for JavaScript and code style errors before committing to the master branch.

Running

Run gulp serve to start a standalone backend, while still enjoying live-reload. You'll need Go for that.

Normally the app is running in "dev" environment but you can change that by providing --env argument to the gulp task:

# run in dev mode, default:
gulp serve
# set app environment to production:
gulp serve --env prod
# or run as if we were in staging:
gulp serve --env stage

Not that this does not change the way the backend code is compiled or the front-end is built. It merely changes a variable values, which the app takes into account when rendering a page or responding to a request.

Running in stage or prod requires real credentials when accessing external services. You'll need to run a one-off gulp decrypt which will decrypt a service account private key.

You can also use GAE dev appserver by running gulp serve:gae. This is closer to what we're using in our webapp environment but a bit slower on startup. You'll need gcloud tool and app component to do this.

To change the app environment when using GAE SDK, provide --env argument:

# run in dev mode, default:
gulp serve:gae
# set app environment to production:
gulp serve:gae --env prod
# or run as if we were in staging:
gulp serve:gae