Hackney - Report a Repair
How to start the application
$ rails server
How to run the test suite
$ rspec spec
PhantomJS is required on the host machine when running the test suite:
$ brew cask install phantomjs
The application is configured using environment variables. On production these
should be set directly on the server. In development these can be managed by
dotenv: create a
.env.local file in the
root of the application containing environment variable assignments.
The following environment variables are required to run the site:
HACKNEY_API_URL- the root of the Hackney Repairs API which is used by the site. Development and staging use the same credentials and they can be sourced from the Hackney team or from the environment variables of the staging Heroku account
HACKNEY_API_TOKEN- the API token for the Hackney Repairs API. Development and staging use the same credentials and they can be sourced from the Hackney team or from the environment variables of the staging Heroku account
ENCRYPTION_SECRET- secret used to prevent parameter tampering. Generate one with e.g.
The app should run successfully without these environment variables:
GOOGLE_ANALYTICS_ID- The tracking code for a Google Analytics account
HOTJAR_ID- The tracking code for a Hotjar analytics account
HOTJAR_VERSION- The Hotjar Snippet Version i.e. the version of the Hotjar tracking code being used
ROLLBAR_ACCESS_TOKEN- The access token for the rollbar account used to monitor system errors
ROLLBAR_ENV- Defines which environment rollbar errors are logged to. By default this is
Rails.envand doesn't need to be set in development but on the staging server this should be set to 'staging'.
HTTP_AUTH_PASSWORD- Set these to protect the site with HTTP Basic Authentication
FLIPPER_AUTH_PASSWORD- As above, but for feature flag UI
RACK_SERVICE_TIMEOUT- Set this to control the point at which
Rack::Timeouttimes-out an HTTP request. This is used to ensure that the app times out before Heroku automatically kills the connection and displays its own, less friendly, error message. Defaults to 15 seconds.
APPOINTMENT_LIMIT- Set this to override the maximum number of appointments returned from the
AppointmentFetcherservice. Defaults to 15.
ONE_ACCOUNT_URL- Set this to override the URL that redirects users to One Account in the event that Report a Repair is disabled (see feature flagging below).
The following feature flags can be used. The first time these are used, they should be created via the Flipper UI:
service_disabled- Enabling this flag disables the service completely. All pages will return a message prompting users to call the Repairs Contact Centre. This is to be used when Hackney back-end systems are unavailable.
This application is hosted on Heroku and configured with webhooks so that when GitHub receives a push to origin/develop it will automatically attempt a staging deployment, and when it receives a push to origin/master it will automatically attempt a production deployment.
Services (job queues, cache servers, search engines, etc.)