Skip to content
forked from alphagov/frontend

Serves the homepage, transactions and some index pages on GOV.UK

License

Notifications You must be signed in to change notification settings

nsabri1/frontend

 
 

Repository files navigation

GOV.UK Mainstream, Home & Search Frontend

Application to serve some mainstream formats and the homepage for GOV.UK.

##test

Live examples

Formats

Simple smart answer

Transaction start pages:

Hard-coded routes

Licence finders

Some examples:

Transaction done pages

Transaction done with survey pages

Standard survey:

Assisted digital satisfaction surveys:

Calendars

Misc

URL Related views
http://www.gov.uk/school-term-holiday-dates
http://www.gov.uk/pay-council-tax
http://www.gov.uk/find-covid-19-lateral-flow-test-site
http://www.gov.uk/rubbish-collection-day
http://www.gov.uk/apply-council-tax-reduction
http://www.gov.uk/apply-for-disabled-bus-pass
http://www.gov.uk/apply-free-school-meals
_base_page
local_transaction/search
http://www.gov.uk/register-offices
http://www.gov.uk/ukonline-centre-internet-access-computer-training
http://www.gov.uk/find-theory-test-centre
http://www.gov.uk/id-scan-eu-settlement-scheme
_base_page
place/show
http://www.gov.uk/provide-journey-contact-details-before-travel-uk publication_metadata
_base_page
show
http://www.gov.uk/contact-the-dvla/y/ flow
http://www.gov.uk/check-a-passport-travel-europe _publication_metadata
_base_page
transaction/show
http://www.gov.uk/renew-driving-licence-at-70
http://www.gov.uk/check-mot-history
http://www.gov.uk/mot-testing-service
http://www.gov.uk/order-coronavirus-rapid-lateral-flow-tests
http://www.gov.uk/check-legal-aid
_base_page
transaction/show

Nomenclature

  • format: our phrase for a type of content
  • scope: each type of calendar (eg daylight saving, bank holidays) is known as a scope. A scope has its own view templates, JSON data source and primary route.

Technical documentation

Frontend is a Ruby on Rails application that renders the citizen-facing part of formats stored in the Content Store. It looks up the passed-in slug in the Content Store.

It also serves the homepage as a hard-coded route.

Calendar JSON data files are stored in lib/data/<scope>.json, with a divisions hash for separate data per region (united-kingdom, england-and-wales, scotland or northern-ireland).

Each scope's data file contains a list of divisions, containing a list of years, each with a list of events:

{
  "title": "UK bank holidays",
  "description": "UK bank holidays calendar - see UK bank holidays and public holidays for 2012 and 2013",
  "divisions": {
    "england-and-wales": {
      "title": "England and Wales",
      "2011": [{
        "title": "New Year's Day",
        "date": "02/01/2011",
        "notes": "Substitute day"
      }]
    }
  }
}

The division title attribute is optional. If this is not present the slug will be humanized and used instead.

Dependencies

Running the application

If you are using docker to run the application (which is advised) it will be available on the host at http://frontend.dev.gov.uk/

To run the application standalone, run static and execute the following command:

PLEK_SERVICE_STATIC_URI=http://127.0.0.1:3013 ./startup.sh --live

which uses a local copy of static and content from production.

Note that you will have to have GOV.UK Mapit running locally. A valid dataset will have to be loaded for Mapit or postcode lookups will not succeed. This is part of the standard GOV.UK data replication steps.

To run in a full development stack (with DNS, all apps running etc.) use./startup.sh.

Running the test suite

bundle exec rake runs the test suite.

Additional information for calendars

Send the calendars to the publishing-api:

bundle exec rake publishing_api:publish_calendars

If you're using govuk-docker, you may need to govuk-docker-up on publishing-api in a separate shell. You may also need to run the rake task a couple of times if you encounter timeouts.

Search indexing is performed automatically on data sent to publishing api.

A rake task has been created to generate the bank holidays JSON for a given year. They need to be then inserted, and modified to take into account any additions/modifications made by proclamation.

Run the rake task like this:

bundle exec rake bank_holidays:generate_json[2016]

Canonical sources

Licence

MIT Licence

About

Serves the homepage, transactions and some index pages on GOV.UK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 69.0%
  • HTML 20.3%
  • JavaScript 8.0%
  • SCSS 2.5%
  • Other 0.2%