Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

alphagov/di-report-a-death

Repository files navigation

Report a death *** Archived ***

This service is now mothballed and archived.

Report a death will be a citizen-facing service aiming to improve the end-to-end experience of dealing with death and the government.

Overview

Most of the tech used here is very standard across DI. We use Typescript Node lambdas, deployed using SAM. DynamoDB is used for persistence. Compared with most services, the main difference is that the frontend here is rendered using lambdas.

We're using a lambda per page approach, with a small amount of custom build logic to package the correct templates into each lambda. Assets are served from S3 using cloudfront.

Architecture

Architecture decision records start here

Running locally

First-time setup:

  • Install the latest Node (nvm suggested)
  • Install AWS SAM CLI (brew install aws-sam-cli)
  • Install jq (used by scripts/upload-assets.sh, brew install jq)
  • Install Docker Desktop

Run:

make local

Running tests:

cd src
npm run test --workspaces

Lint:

cd src
npm run lint

Deploy to dev

Named stack

Each developer gets their own named cloudformation stack in the dev account. This deploys to <name>.report-a-death.dev.account.gov.uk. To configure this, create a block in samconfig.toml that matches

[dev-<name>.deploy.parameters]
capabilities = "CAPABILITY_IAM"
confirm_changeset = true
resolve_s3 = true
stack_name = "<name>-rad"
s3_prefix = "<name>-rad"
region = "eu-west-2"

Then with valid AWS credentials:

DEV=<name> make deploy

Shared stack

There is also a shared stack. This can be deployed with

make deploy-dev

Adding a page

  • Copy an existing page. Make sure to use cp -a to preserve the symlink to common
  • Add the lambda function to the SAM template in template.yaml
  • Change the package name in package.json