Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Hybrid rendering application for the Performance Platform using Backbone and D3
Branch: master
Pull request Compare This branch is 3120 commits behind alphagov:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
assets/images
config
features
log
spec
styles
vendor
.gitignore
.travis.yml
CONTRIBUTING.md
Gemfile
Gemfile.lock
Gruntfile.js
LICENSE
README.md
jenkins.sh
package.json
start-app.sh

README.md

Spotlight

Hybrid rendering app for the GOV.UK Performance Platform using Backbone and D3. JavaScript is shared between the client and server, and the app makes use of progressive enhancement to provide a great experience in every browser.

Installation

This app runs inside the Performance Platform development environment, not in the standard GDS development VM.

Install dependencies:

bundle install
sudo npm install -g grunt-cli@0.1.9
sudo npm install -g supervisor@0.5.6
npm install

Building and running the app

Development

If you're using our dev environment then cd /var/apps/pp-development and bowl performance. Once you've set up your DNS, http://spotlight.perfplat.dev will work. This will use backdrop as a data source.

If you want to run the app with stubs then cd /var/apps/spotlight and grunt. Once you've set up your DNS, http://spotlight.perfplat.dev will work. This will use stubs as a data source.

Otherwise, if not on the VM...

cd <spotlight_dir>
NODE_ENV=development_no_vm grunt

This will create a development build of the assets and then run the app at http://localhost:3057.

The app uses node-supervisor and grunt-contrib-watch to monitor changes, automatically restart the server and recompile Sass.

If you want to test with png rendering run the screenshot-as-a-service app first in the appropriate environment.

Running tests

Command line

Tests are divided into ones that work on both client and server (test/spec/shared) and ones that are server-only (test/spec/server) and client-only (test/spec/client).

grunt test:all runs all three of these tests in sequence:

  • grunt jasmine_node executes shared and server Jasmine tests in Node.js.
  • grunt jasmine executes shared and client Jasmine tests in PhantomJS.
  • grunt cucumber executes Cucumber features through PhantomJS.

bundle exec cucumber --profile sauce executes Cucumber features through SauceLabs (no Grunt task yet).

Browser

When the app is running in development mode, Jasmine tests for shared components are available at /tests. The specrunner gets automatically recreated on server start and when the specfiles change. Due to a bug in grunt-contrib-watch, new spec files are not currently detected automatically. When you add a new spec file, either restart the app or run grunt jasmine:spotlight:build.

Debugging locally

Install node-inspector on your VM with sudo npm install -g node-inspector@0.5.0 and run it with node-inspector.

On the VM:

Start the app with node --debug app/server.js.

Visit http://spotlight.perfplat.dev:8080/debug to view the console.

Or on your machine

Start the app with:

node app/server.js \
--env=development_no_vm

Visit http://localhost:8080/debug to view the console.

Production

grunt build:production to create a production release.

NODE_ENV=production node app/server.js to run the app in production mode.

Status

Build Status

Dependency Status

Something went wrong with that request. Please try again.