The Guardian website frontend.
Frontend is a set of Play Framework 2 Scala applications.
* A Mac or Linux pc
* Installed Node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
You'll need a config file called /etc/gu/install_vars with the following content :-
STAGE=DEV
INT_SERVICE_DOMAIN=gudev.gnl
EXT_SERVICE_DOMAIN=
And one called ~/.gu/frontend.properties, ( alternatively /gu/etc/frontend.properties ) with the following content :-
content.api.key=XXXX
content.api.host=http://XXXX
pa.api.key=XXXX
Get the correct key and host from another developer on the project.
Assuming you have checked out this project, open a console and change directory into the root of the project.
Start Simple Build Tool (sbt) by running ./sbt011 --no-proxy
Once sbt is running (it may take a while first time) then compile the project by typing compile
(also can take a while first time)
Switch project by typing project dev-build
Now start the local server by typing run
(this too will take long the first time)
Now test you are up and running by hitting the following URLs:
- http://localhost:9000/books
- http://localhost:9000/media/2012/dec/05/newspaper-editors-sign-up-leveson
- http://localhost:9000/news/gallery/2012/dec/04/24-hours-in-pictures-gallery
To use in Eclipse, use the eclipsify
command. This will create Eclipse
project and settings files which can be imported using the Import Existing
Project options in Eclipse.
To use in IntelliJ, see https://github.com/mpeltonen/sbt-idea
Further information on using the Play console is available here.
Virtualisation provides for robust development environments and a controlled
system dependency solution. See the instructions in README.vagrant.md
for
using Vagrant virtualisation with this project.
The available endpoints are listed in conf/routes
of each application and
typically include:
/management
: Operations support as per standard webapp guidelines. See guardian-management./pages/<path>
: Serve the Guardian URL at<path>
if supported by this application./assets/<file>
: A convenience for DEV machines. Assets are CDNed in PROD and would not be available on DEV./<path>
: A synonym for/pages/<path>
as a convenience for DEV machines.
Deployment uses the Magenta library.
Invoke sbt011
with a --no-proxy
parameter to directly download artifacts.
Further documentation notes and useful items can be found in dev
.