Skip to content
Source for theguardian.com
HTML JavaScript Scala CSS Shell TypeScript Other
Find file
Failed to load latest commit information.
admin-jobs Add test logback configurations
admin Use replaceAll
amp using remote instead of remote-3
applications And another
archive Add test logback configurations
article Merge pull request #11922 from guardian/body-block-elements
commercial links fixed
common Remove the credentials reminder switch
data world record of data files
dev-build amp pages are requested via amp.guardian.com or ?amp=1 query parameters
dev var rename
diagnostics Add test logback configurations
discussion Recommendation button for 'more replies' comment should not be disabled
docs Merge branch 'master' into amp-list-overflow
facia-press Add support for inlined embeds on link snaps
facia Merge pull request #11932 from guardian/kc-paid-container-conditions
git-hooks move dev make stuff out of dev, add to top level make/package.json, a…
grunt-configs update videojs ima plugin
identity Removed inline and add width.
image Increase log line exceptions from 3 to 15 to improve diagnosing of is…
integrated-tests fronts.gutools is updated so reinstating the test
nginx Support BrowserSync in nginx dev config
onward Fix another test
preview Add test logback configurations
project Merge branch 'master' of github.com:guardian/frontend into body-block…
router Increase log line exceptions from 3 to 15 to improve diagnosing of is…
rss Increase log line exceptions from 3 to 15 to improve diagnosing of is…
sanity-tests/test Changed trait to sealed trait
sport Add test logback configurations
standalone Revert "Revert "Introducing Toast: new liveblog autoupdates""
static Merge pull request #11962 from guardian/mobile-minute-logo-resize
tools move dev make stuff out of dev, add to top level make/package.json, a…
training-preview Add missing logback config for training-preview
.editorconfig just trying this out
.eslintrc Upgrade ESLint to v1
.gitignore Remove jspm and SystemJS
.jscsrc Tidy up lint config
.scss-lint.yml Lint Sass
CONTRIBUTING.md Added email verification to ID API
Gemfile Merge branch 'master' of github.com:guardian/frontend into styleguide
Gemfile.lock Outbrain isFront check
Gruntfile.js Revert "Move omniture to standard js"
IMAGES.md We do not know if there is a video at the top of the body.
LICENSE Update license year range to 2016
README.md better heading
Vagrantfile Sync the .ivy2 directory
browserslist restore US to browserslist
cla-corporate.txt Add Contributor License Agreements to the project
cla-individual.txt Add Contributor License Agreements to the project
grunt-tc Relocate bower registry creation to npm setup stage
hologram_config.yml adding initial button styles and hologram setup
install-dependencies.sh use make
makefile nuke build artefacts before compiling
npm-shrinkwrap.json Merge pull request #11513 from guardian/redo-liveblog-blocks
package.json New JS load infrastructure
provision.sh Got rid of 3rd party image service for now, tests are over.
sbt Remove ivy-sbt folder
setup.sh Fix AWS config and credentials

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.