Skip to content
Source for theguardian.com
HTML JavaScript Scala CSS TypeScript Shell Other
Latest commit e64538f Jun 30, 2016 @alexduf alexduf committed on GitHub Merge pull request #13444 from guardian/dev-build-lifecycle
Dev build lifecycle / Autorefresh
Failed to load latest commit information.
.github Put contributing guideline hint in html comment Apr 21, 2016
admin-jobs Controllers need to be classes to be injected in the router Jun 22, 2016
admin Merge pull request #13322 from guardian/tbonnin-add-elasticsearch-hea… Jun 22, 2016
applications Migrate controllers away from objects, but keep objects for compatibi… Jun 30, 2016
archive Refactor Globals Jun 1, 2016
article Add the possibility to inject the Autorefresh Jun 30, 2016
commercial Migrate controllers away from objects, but keep objects for compatibi… Jun 30, 2016
common Merge pull request #13444 from guardian/dev-build-lifecycle Jun 30, 2016
data Update test fixtures Jun 7, 2016
dev-build Merge pull request #13326 from guardian/inject-admin-router Jun 21, 2016
dev Tidy up gulp config May 10, 2016
diagnostics Merge pull request #13444 from guardian/dev-build-lifecycle Jun 30, 2016
discussion Migrate controllers away from objects, but keep objects for compatibi… Jun 30, 2016
docs add ab test to show discussion message after poll submission Jun 23, 2016
facia-press Move Branding class and supporting classes Jun 7, 2016
facia Migrate controllers away from objects, but keep objects for compatibi… Jun 30, 2016
git-hooks this is isn't working properly and is making things worse. disable fo… Apr 13, 2016
grunt-configs remove password strength check for identity Jun 21, 2016
identity simplify configuration Jun 30, 2016
integrated-tests fronts.gutools is updated so reinstating the test Oct 13, 2015
nginx Add proxy pass and referer for idapi Apr 19, 2016
onward Merge pull request #13444 from guardian/dev-build-lifecycle Jun 30, 2016
preview migrate standalone application away from using Globals Jun 27, 2016
project migrate standalone application away from using Globals Jun 27, 2016
router give me stack traces! Apr 12, 2016
rss Refactor Globals Jun 1, 2016
sanity-tests/test Changed trait to sealed trait Jun 24, 2014
sport Migrate controllers away from objects, but keep objects for compatibi… Jun 30, 2016
standalone migrate standalone application away from using Globals Jun 27, 2016
static Merge pull request #13439 from guardian/narrow-reach-of-plista-switch Jun 30, 2016
tools notify when pasteup needs to be released Apr 7, 2016
training-preview migrate standalone application away from using Globals Jun 27, 2016
.editorconfig just trying this out Jul 28, 2015
.eslintrc Upgrade ESLint to v1 Sep 29, 2015
.gitignore Remove requirejs ignore May 10, 2016
.sass-lint.yml Remove Facebook styles from ignored list May 17, 2016
Gruntfile.js rename concat target May 24, 2016
IMAGES.md Prioritise master images during trail image picking Mar 15, 2016
LICENSE Update license year range to 2016 Jan 18, 2016
README.md Add gitter badge to README Jun 7, 2016
Vagrantfile Sync the .ivy2 directory Nov 19, 2013
browserslist restore US to browserslist Apr 29, 2015
cla-corporate.txt Add Contributor License Agreements to the project Apr 19, 2013
cla-individual.txt Add Contributor License Agreements to the project Apr 19, 2013
grunt-tc Remove ruby teamcity tasks Mar 22, 2016
install-dependencies.sh Remove more ruby/bundle references Mar 22, 2016
makefile Deploys radiator: clean out typings on uninstall Apr 12, 2016
npm-shrinkwrap.json Use karma-teamcity-reporter for test reports when running in teamcity Apr 7, 2016
package.json Use karma-teamcity-reporter for test reports when running in teamcity Apr 7, 2016
provision.sh Remove more ruby/bundle references Mar 22, 2016
sbt Remove more ruby/bundle references Mar 22, 2016
setup.sh Tiny fix to setup.sh Jun 13, 2016

README.md

Gitter

We're hiring!

Ever thought about joining us?
http://developers.theguardian.com/join-the-team.html

Frontend

The Guardian website frontend.

Frontend is a set of Play Framework 2 Scala applications.

Frontend is built in two parts, using Grunt for the client side asset build and SBT for the Play Framework backend.

Core Development Principles (lines in the sand)

These principles apply to all requests on www.theguardian.com and api.nextgen.guardianapps.co.uk (our Ajax URL)

On the server

  • Every request can be cached and has an appropriate Cache-Control header set.
  • Each request may only perform one I/O operation on the backend. (you cannot make two calls to the content API or any other 3rd party)
  • The average response time of any endpoint is less than 500ms.
  • Requests that take longer than two seconds will be terminated.

New developers

Welcome! To get set up, please follow the installation guide.

Fixes for common problems can be found here.

Client-side development

watch/reload

There is a make watch task available to build and watch for development changes.

make watch

Testing your JavaScript

You can run the Jasmine unit test suite with

make test

If you need to debug the tests in a browser, run the command

grunt test --no-single-run

and point your browser at http://localhost:9876.

Deploying

Deployment uses the Riff Raff application.

Debugging Play application

You can debug your local Frontend application, by attaching a debugger.

  • Start Simple Build Tool in debug mode by typing ./sbt --debug.
  • Build and run your application. See "Running" for steps.
  • Use a debugger to attach to the remote Java process, on localhost:1044.

Any IDE debugger should be compatible. In IntelliJ, add a new Debug Configuration, based on the Remote default. Ensure the Transport is Socket, the Debugger mode is Attach, and the port is set to 1044. Start a new Debug session, and your breakpoints should be active.

Additional Documentation

If you're new, you'll want to see what libraries we use in frontend.

Further documentation notes and useful items can be found in docs.

Something went wrong with that request. Please try again.