This repo contains the code for Account Components
- In GitHub create a personal access token which has
read:packagespermission and in the configuration file for your shell export a variable calledNODE_AUTH_TOKENwith the value of the personal access token - Copy
solutions/frontend/.env.sampletosolutions/frontend/.envand replace any placeholder values as appropriate - Copy
solutions/stubs/.env.sampletosolutions/stubs/.envand replace any placeholder values as appropriate - Copy
solutions/api/env.json.sampletosolutions/api/env.jsonand replace any placeholder values as appropriate - Install NVM or FNM and select the correct Node version by running
nvm useorfnm use - Install Docker
- Install Homebrew
- Install Brewfile dependencies with
npm run install-brewfile - Install dependencies with
npm run install-all - Install Git Hooks with
npm run install-git-hooks - Run
npm run run:allto start all the local servers. The frontend will be available athttp://localhost:6002, the stubs athttp://localhost:6003and the API athttp://localhost:6004. The frontend and stubs will watch for changes and rebuild on demand but the API will not and needs to be restarted for changes to take effect.
When updating the Node version you will need to update the following:
engines.nodefield in allpackage.jsonfiles- all
.nvmrcfiles (the version should correspond to the lowest version which matches theengines.nodefield in the associatedpackage.jsonfile) - Node version used by Lambda functions
- Node version used in Docker images
- ensure the base TSConfig installed as a development dependency in
package.jsonand used intsconfig.jsoncorresponds with the Node version being used e.g. for Node 24 use the base TSConfig@tsconfig/node24 - ensure the major version of
@types/nodeinstalled as a development dependency inpackage.jsoncorresponds with the Node version being used - where ESBuild is used (e.g. in Lambda
Metadatain CloudFormation templates) ensure that the configured target matches the target in the base TSConfig e.g. the base TSConfig@tsconfig/node24sets a target ofes2024and therefore the ESBuild target should bees2024too.
There are various commands which can be run manually and which may also be run by Git hooks and in CI:
npm run run:allto run the everything necessary to run the app locally and watch for changesnpm run run:frontendto run the frontend locally and watch for changesnpm run build:frontendto build the frontendnpm run run:stubsto run the stubs locally and watch for changesnpm run build:stubsto build the stubsnpm run run:apito run the API locallynpm run generate-config-typesto generate TypeScript types from the App Config JSON schemanpm run build:allto build everythingnpm run testto run Vitest testsnpm run test:watchto run Vitest tests in watch modenpm run test:coverageto run Vitest tests and report coveragenpm run check-typesto run TypeScript type checkingnpm run formatto run Prettier formattingnpm run eslintto run ESLintnpm run knipto run Knipnpm run tflintto lint Terraform filesnpm run cfnlintto lint CloudFormation templates with the file extension.cf.yamlnpm run sam-validateto run SAM validation against the CloudFormation templatenpm run check-gh-actionsto check GitHub Actions with Zizmornpm run detect-secretsto detect secrets which should not be in the repo. False positives can be ignored with commentsnpm run config:validateto validate the application's confignpm run api-specs:validateto validate the OpenAPI specsnpm run auditto check for NPM package vulnerabilities and check package signature integrity
If these commands detect issues it may be possible to fix them by running:
npm run format:fixnpm run eslint:fixnpm run knip:fixnpm run tflint:fixnpm run check-gh-actions:fix