This is an application, written in Ruby on Rails (Version 7), based on the DFE-Digital template. It uses a Contentful workspace for the content, managed by the content editors in the Help For Early Years Providers service.
Optionally create .env
to override or set default variables.
Ruby version 3.2.x
Node version 20.11.x
PostgreSQL version 13.1
Yarn version 4.0.x
Suggest using asdf for local development.
- Clone the repository
- Obtain master key
- Run
bundle install
to install the gem dependencies - Run
yarn
to install node dependencies - Copy the .env.development.example settings into the .env file
- Run
bin/rails db:setup
to set up the database development and test schemas, and seed with test data - Run
bin/dev
to launch the app on http://localhost:3000
There are a number of convenience scripts to make working with Docker easier.
All containers for the project are named with the prefix reform_
.
bin/docker-build
creates tagged images for all the servicesbin/docker-down
stops any active servicesbin/docker-rails console
drops into a running development environment or starts one, containerised equivalent ofbin/rails console
bin/docker-dev
startsProcfile.dev
, containerised equivalent ofbin/dev
bin/docker-rspec -f doc
runs the test suite with optional arguments, containerised equivalent ofbin/rspec
We use rails credentials to manage secrets; obtain the master key from the Dev team.
To edit:
$ EDITOR=vi bin/rails credentials:edit
Currently encrypts the following secrets:
secret_key_base:
contentful:
environment:
space:
delivery_access_token:
preview_access_token:
user_password:
The contentful credentials can be overridden with environment variables:
CONTENTFUL_SPACE=
CONTENTFUL_ENVIRONMENT=
CONTENTFUL_DELIVERY_TOKEN=
CONTENTFUL_PREVIEW_TOKEN=
CONTENTFUL_MANAGEMENT_TOKEN=
The management token is not used in the application and each developer should have their own. It is used to run the contentful migration and upload tasks.
Visit the Github Container Registry.
Development is deployed automatically with the latest commit from main
.
Individual branches may also be used as the source for the deployment, so you can set up the application to review a specific feature not yet merged with main
branch.
Staging is deployed from this [workflow][azure-deploy-stage]. Production is deployed from this [workflow][azure-deploy-prod].
Console access:
- https://hfeyp-dev.scm.azurewebsites.net/webssh/host
- https://hfeyp-stage.scm.azurewebsites.net/webssh/host
- https://hfeyp-prod.scm.azurewebsites.net/webssh/host
Sentry is used to monitor production environments
$ brew install getsentry/tools/sentry-cli
$ sentry-cli projects list --org early-years-foundation-reform
+---------+--------------+-------------------------------+--------------+
| ID | Slug | Team | Name |
+---------+--------------+-------------------------------+--------------+
| 6274627 | eyf-reform | early-years-foundation-reform | Rails |
| 6274651 | eyf-recovery | early-years-foundation-reform | eyf-recovery |
+---------+--------------+-------------------------------+--------------+
This project uses Hotjar for user insight. Hotjar records user journeys and automatically redacts certain user information on recordings. All personally identifiable information should be redacted. In order to override the default settings the following classes can be added:
data-hj-suppress
to redact additional user informationdata-hj-allow
to allow data that is automatically redacted