GithubHelp home page GithubHelp logo

scedwar / spotlight Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alphagov/spotlight

0.0 1.0 0.0 24.06 MB

Hybrid rendering application for the Performance Platform using Backbone and D3

License: MIT License

JavaScript 89.11% HTML 5.07% Shell 0.02% CSS 5.80%

spotlight's Introduction

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.

Once you've got a machine that has the required system-level dependencies, you can install application dependencies with:

npm install

Building and running the app

Development

Full stack: if you're using our development environment then you can run all our apps in one go and use a real database for development. As a bonus, this will let you test the image fallbacks using the screenshot-as-a-service app.

cd /var/apps/pp-development
bundle install # install bowler
bowl performance

Just Spotlight: if you want to only run this app, that's fine too.

cd /var/apps/spotlight
grunt

Perhaps you want to run just the Spotlight app and connect to a different data source. You can do that by creating your own config file in /config/config.development_personal.json that mimics /config/config.development.json with a different backdropUrl property. It'll be ignored by Git.

Once you've set up your DNS, http://spotlight.perfplat.dev will connect to the app (which is running on port 3057).

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

Running tests

Command line

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

grunt test:all runs all three of these tests, as well as linting the codebase:

  • grunt jasmine_node executes shared and server Jasmine tests in Node.js
  • grunt jasmine executes shared and client Jasmine tests in PhantomJS
  • grunt shell:cheapseats executes feature tests using cheapseats

In the 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 where the app runs with sudo npm install -g [email protected] and run it with node-inspector.

Start the app with node --debug app/server.js and visit http://spotlight.perfplat.dev: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.

Heroku

If you want to deploy the app to Heroku, follow these instructions.

The app runs on Heroku using a custom buildpack for Grunt.js support:

heroku create spotlight-demo-feature --buildpack https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
heroku config:set NODE_ENV=development npm_config_production=false
git push heroku your-branch-name:master
heroku open

If you want the Heroku app to be password-protected, set config variables as follows, before pushing the code.

heroku config:set BASIC_AUTH_USER=xxxx
heroku config:set BASIC_AUTH_PASS=xxxx
heroku config

App status

Latest tag

Build status

Dependency status

spotlight's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.