Skip to content
Source for theguardian.com
HTML JavaScript Scala CSS TypeScript Shell Other
Find file
Latest commit d2e8d9e May 3, 2016 @jamesgorrie jamesgorrie Merge pull request #12772 from guardian/video-playlist-tracking
add tracking component name to video playlist
Failed to load latest commit information.
.github Put contributing guideline hint in html comment Apr 21, 2016
admin-jobs use etags/if-none-match for all responses Apr 22, 2016
admin Use consistent routing for admin commercial pages Apr 29, 2016
applications adding comments May 3, 2016
archive use a sum ADT for with/without revalidation Apr 27, 2016
article Merge pull request #12722 from guardian/refactor-img-helper May 3, 2016
commercial Made class switches work with the refactored components May 3, 2016
common Merge pull request #12772 from guardian/video-playlist-tracking May 3, 2016
data Introduce crossword dateSolutionsAvailable field and add tests for it Apr 13, 2016
dev-build Merge branch 'master' into kc-masterclasses-switch May 3, 2016
dev point gulpfile config to correct place Apr 21, 2016
diagnostics remove crash metrics Apr 29, 2016
discussion use etags/if-none-match for all responses Apr 22, 2016
docs Removed global changes Apr 26, 2016
facia-press Split brain Apr 26, 2016
facia use a sum ADT for with/without revalidation Apr 27, 2016
git-hooks this is isn't working properly and is making things worse. disable fo… Apr 13, 2016
grunt-configs Assetmonitor grunt task: monitor all js and css files Apr 22, 2016
identity Merge branch 'master' into etags-everywhere Apr 26, 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 #12654 from guardian/etags-everywhere Apr 28, 2016
preview give me stack traces! Apr 12, 2016
project Explicit dependency on STS Apr 29, 2016
router give me stack traces! Apr 12, 2016
rss use etags/if-none-match for all responses Apr 22, 2016
sanity-tests/test Changed trait to sealed trait Jun 24, 2014
sport Merge pull request #12654 from guardian/etags-everywhere Apr 28, 2016
standalone Merge branch 'master' into kc-masterclasses-switch May 3, 2016
static Merge pull request #12770 from guardian/rkz-fix-gallery-logo May 3, 2016
tools notify when pasteup needs to be released Apr 7, 2016
training-preview Updated healthcheck for training preview as previous article no longe… Apr 14, 2016
.editorconfig just trying this out Jul 28, 2015
.eslintrc Upgrade ESLint to v1 Sep 29, 2015
.gitignore add pasteup release process Apr 8, 2016
.sass-lint.yml Merge pull request #12623 from guardian/new-webfonts Apr 21, 2016
Gruntfile.js update webfontjson task to point to new location Apr 21, 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 better heading Feb 11, 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 Remove more ruby/bundle references Mar 22, 2016

README.md

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.