Source for theguardian.com
HTML JavaScript Scala CSS Shell Java
Latest commit 89e4c62 Jul 29, 2016 @gtrufitt gtrufitt committed on GitHub Merge pull request #13781 from guardian/rio-badge
Update rio badge
Failed to load latest commit information.
.github Put contributing guideline hint in html comment Apr 21, 2016
admin-jobs Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
admin remove unecessary case class Jul 28, 2016
applications Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
archive Use WithTestWsCLient in tests Jul 28, 2016
article Merge pull request #13773 from guardian/sport-liveblogs Jul 29, 2016
commercial Merge pull request #13761 from guardian/video-fix Jul 28, 2016
common Merge pull request #13772 from guardian/remove-new-header-dummy-tests Jul 29, 2016
data add useful comment and update test data Jul 29, 2016
dev-build Merge pull request #13757 from guardian/commercial-ad-reporting Jul 28, 2016
dev Merge branch 'master' of github.com:guardian/frontend into atomic-css Jul 12, 2016
diagnostics Move the client logging check to client-side Jul 29, 2016
discussion Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
docs Add steadypage docs Jul 28, 2016
facia-press Remove use of WS in Healthcheck Jul 28, 2016
facia Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
git-hooks this is isn't working properly and is making things worse. disable fo… Apr 13, 2016
grunt-configs remove flash media player Jul 20, 2016
identity Remove use of WS in WsFormstackHttp Jul 28, 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 Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
preview Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
project Upgrade redis client to 3.1 Jul 26, 2016
router migrate router Jul 15, 2016
rss Remove use of WS in Healthcheck Jul 28, 2016
sanity-tests/test Changed trait to sealed trait Jun 24, 2014
sport Remove use of WS in Healthcheck Jul 28, 2016
standalone Refactor FrontJsonFapi and FaciaController to remove WS.url in Secure… Jul 28, 2016
static Merge pull request #13781 from guardian/rio-badge Jul 29, 2016
tools use latest package Jul 15, 2016
training-preview Use WithTestWsCLient in HealthCheck tests Jul 28, 2016
.editorconfig just trying this out Jul 28, 2015
.eslintrc lint Jul 13, 2016
.gitignore use latest package Jul 15, 2016
.nvmrc actaully let's go to 6 Jun 28, 2016
.sass-lint.yml Remove linter config Jul 19, 2016
Gruntfile.js remove flash media player Jul 20, 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 link to applications wiki page Jul 18, 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
makefile Merge branch 'master' of github.com:guardian/frontend into de-ts Jul 13, 2016
npm-shrinkwrap.json use latest package Jul 15, 2016
package.json use latest package Jul 15, 2016
provision.sh Remove more ruby/bundle references Mar 22, 2016
sbt Remove more ruby/bundle references Mar 22, 2016
setup.sh be slightly more linux friendly Jul 21, 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.