A service for filling in the content of documents, storing them and, through integration with a wallet credential issuer, providing the links needed to load those documents into the GOV.UK Wallet.
We recommend using nvm to install and manage Node.js versions.
To install nvm, run:
brew install nvm
Then, to install and use the required version of node using nvm, run the following commands:
nvm install
nvm use
Make sure Docker is running, and you’re connected to the GDS VPN before starting the services.
Install the dependencies with:
npm install
Lint and format the code with:
npm run lint
npm run format
Build the assets with:
npm run build
Unit test the code with:
npm run test
Create a copy of the example environment variable file:
cp .env.example .env
This app uses LocalStack to run AWS services (DynamoDB, S3 and KMS) locally on port 4561.
To start the LocalStack container and emulate the services, run:
npm run localstack:up
Running locally requires running this application together with a stub of the authorization server, such as this one.
To configure this stub to work with the Document Builder, run:
./configure_auth_stub.sh <your_aws_profile>
Both repositories must be in the same directory for the script to work.
To start the application, run:
npm run start
To start in development mode, run:
npm run dev
Go to http://localhost:8001/select-app.
You must be logged into the Mobile Platform
devAWS account.
You can deploy the application to the dev AWS account by following these steps:
Before a stack is deployed for the first name, an SSM parameter must be created to hold the OIDC client ID:
aws ssm put-parameter --name "/<your-stack-name>/Config/OIDC/Client/Id" --value "TEST_CLIENT_ID" --type StringThe usual non-production deployment client ID is TEST_CLIENT_ID.
Run the script to build and push the Document Builder docker image, specifying an image tag and the name of your AWS profile
for the Mobile Platform dev AWS account (which can be found in your ~/.aws/credentials file):
./build-and-deploy-image.sh <your-chosen-tag> <your-mobile-platform-dev-profile> This will build the docker image, log into ECR, push the image to ECR, and update the template.yaml to specify this
image for the Document Builder ECS task.
If using your own deployed version of the Example CRI and Auth Stub, the following mapping values in the template must be updated:
Mappings:
EnvironmentVariables:
dev:
CredentialIssuerUrl: "<your-cri-stack-name->example-credential-issuer.mobile.dev.account.gov.uk"
OidcIssuerEndpoint: "https://<your-auth-stub-stack-name->.mobile.dev.account.gov.uk"sam build && sam deploy --capabilities CAPABILITY_IAM --stack-name <your_stack_name>