This repo is home to two services:
- A service that allows people to access their teaching qualifications (AYTQ)
- A service that allows employers to check teacher records (Check)
| Name | URL |
|---|---|
| Production | Deployed |
| Preprod | Deployed |
| Test | Deployed |
| Name | URL |
|---|---|
| Production | Deployed |
| Preprod | Deployed |
| Test | Deployed |
All environments have continuous deployment, the state of which can be inspected in Github Actions.
| Name | Description |
|---|---|
| Production | Public site |
| Preprod | For internal use by DfE to test deploys |
| Test | For external use by 3rd parties to run audits |
- Ruby 3.x
- Node.js 16.x
- Yarn 1.22.x
- PostgreSQL 13.x
- Redis 6.x
Both services are monolithic Rails apps built with the GOVUK Design System.
We keep track of architecture decisions in Architecture Decision Records (ADRs).
We create architecture views of the application using C4 diagramming method here
We use rladr to generate the boilerplate for new records:
bin/bundle exec rladr new titleInstall dependencies using your preferred method, using asdf or rbenv or nvm. Example with asdf:
# The first time
brew install asdf # Mac-specific
asdf plugin add azure-cli
asdf plugin add ruby
asdf plugin add nodejs
asdf plugin add yarn
asdf plugin add postgres
asdf plugin add redis
# To install (or update, following a change to .tool-versions)
asdf installIf installing PostgreSQL via asdf, you may need to set up the postgres user:
pg_ctl start
createdb default
psql -d default
> CREATE ROLE postgres LOGIN SUPERUSER;If the install step created the postgres user already, it won't have created one
matching your username, and you'll see errors like:
FATAL: role "username" does not exist
So instead run:
pg_ctl start
createdb -U postgres defaultYou might also need to install postgresql-libs:
sudo apt install libpq-dev
sudo pacman -S postgresql-libs
sudo pamac install postgres-libs
sudo yum install postgresql-devel
sudo zypper in postgresql-develIf installing Redis, you'll need to start it in a separate terminal:
redis-serverSetup the project (re-run after Gemfile or package.json updates, automatically restarts any running Rails server):
bin/setupRun the application on http://localhost:3000:
bin/devMain front end: http://localhost:3000/
Admin area: http://localhost:3000/support
Admin area login is defined by ENV['SUPPORT_USERNAME'] and ENV.fetch["SUPPORT_PASSWORD"] by default test \ test
The following feature flags are required for normal operation of the site and are set from seeds.rb as part of bin/setup:
FeatureFlags::Feature.create(name: :service_open, active: true)If you want to test and simulate sending emails locally, you need to be added
to the TRA digital Notify account. Then, go to
API integration > API keys > Create an API key and create a new key, such as
Myname - local test and set the type to Test - pretends to send messages.
Add this key to your local development secrets:
$ vim .env.development.local
GOVUK_NOTIFY_API_KEY=me__local_test-abcefgh-1234-abcdefghWhen you send an email locally, the email should appear in the message log in
the Notify dashboard in the API integration section.
Note: You can set GOVUK_NOTIFY_API_KEY=fake-key when running locally if you don't need to use Notify.
Edit .env.development.local and add a BigQuery key if you want to use BigQuery locally.
See DfE Analytics for information on how to get a key.
You also need to set BIGQUERY_DISABLE to false as it defaults to true in the development environment.
Read more about setting up BigQuery.
To run the linters:
bin/lintTo run the tests (requires Chrome due to cuprite):
bin/testsolargraph is bundled as part of the development dependencies. You need to set it up for your editor, and then run this command to index your local bundle (re-run if/when we install new dependencies and you want completion):
bin/bundle exec yard gemsYou'll also need to configure your editor's solargraph plugin to
useBundler:
+ "solargraph.useBundler": true,We have a helpful command you can run that will connect you to the right Azure resource.
You will need the Azure CLI installed and a PIM (Privileged Identity Management) request for production, preprod and test.
make test railsc
make preprod railsc
make production railsc
make review railsc PR_NUMBER=<PR_NUMBER>The review app needs to be deployed first. You can do this manually by tagging a PR with the deploy label.
Updating keyvault secrets is a manual process which will require elevated permissions via PIM for production access to Azure resources, the resource can be found in:
Review: s189t01-aytq-rv-app-kv
Test: s189t01-aytq-ts-app-kv
Preproduction: s189t01-aytq-pp-inf-kv
Production: s189p01-aytq-pd-app-kv