Skip to content

DFE-Digital/early-years-foundation-reform

Repository files navigation

Deploy to Development Deploy to Staging Deploy to Production

Help For Early Years Providers

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.

Dependencies

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.

Getting started

  1. Clone the repository
  2. Obtain master key
  3. Run bundle install to install the gem dependencies
  4. Run yarn to install node dependencies
  5. Copy the .env.development.example settings into the .env file
  6. Run bin/rails db:setup to set up the database development and test schemas, and seed with test data
  7. Run bin/dev to launch the app on http://localhost:3000

Using Docker

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 services
  • bin/docker-down stops any active services
  • bin/docker-rails console drops into a running development environment or starts one, containerised equivalent of bin/rails console
  • bin/docker-dev starts Procfile.dev, containerised equivalent of bin/dev
  • bin/docker-rspec -f doc runs the test suite with optional arguments, containerised equivalent of bin/rspec

Credentials & Environment Variables

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.

Deployment Pipelines

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].

Azure

Console access:

Monitoring

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 |
+---------+--------------+-------------------------------+--------------+

Hotjar

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 information
  • data-hj-allow to allow data that is automatically redacted

About

A way for content editors to compose the content to describe changes in the guidance for Early Years Child Care providers

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages 4