This repo contains the code for Account Components
- 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 NPM dependencies with
npm ci - Install Git Hooks with
npm run install-git-hooks - Run
cd solutions/integration-tests && npm cito install integration testing dependencies - Run
npm run run:allto start all the local servers and watch for changes. The frontend will be available athttp://localhost:6002, the stubs athttp://localhost:6003and the API athttp://localhost:6004.
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 locally and watch for changesnpm run generate-config-typesto generate TypeScript types from the App Config JSON schemanpm run build:apito build the APInpm run build:coreto build corenpm 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-validate:frontendto run SAM validation against the frontend CloudFormation templatenpm run sam-validate:stubsto run SAM validation against the stubs CloudFormation templatenpm run sam-validate:coreto run SAM validation against the core CloudFormation templatenpm run sam-validate:apito run SAM validation against the API 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 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 cfnlint:fixnpm run check-gh-actions:fix