This is the frontend for Single View 2.0, a monorepo comprising micro frontends taken from the @mtfh scope and repurposed for Single View.
If any command fails, try closing and reopening the terminal, then try again.
nvm install 16
nvm alias default 16
npm install -g npm
npm install --global yarn
To allow the Google authentication to work locally, you need to alias local.hackney.gov.uk to 127.0.0.1 in your local hosts file. This allows the Google authentication token to be accepted as you're on a subdomain of hackney.gov.uk.
Open your hosts file, which on Linux and macOS can be done by running:
sudo open /etc/hosts
On Windows the hosts file can be found at c:\Windows\System32\Drivers\etc\hosts
In the hosts file, add the line:
127.0.0.1 local.hackney.gov.uk
From the root directory in the terminal, run:
yarn install-all
This may take some time to run the first time.
You will also need the concurrently package:
yarn install concurrently
Create a .env
file in the apps/single-view
directory
Ask a code owner to get the correct .env file contents in order to run the frontend.
To give the cypress tests the necessary permissions to run:
Create a .env
file in the apps/common
directory
Populate it like so:
AUTH_ALLOWED_GROUPS=single-view-uat-access,cypress-users
Run the application with yarn start
Load http://local.hackney.gov.uk:9000
in your browser
You can change which API you're pointing to from the .env
file in apps/single-view
Run yarn start
and in a separate terminal run yarn cypress:open
If a new variable needs to be introduced ensure that you store it in AWS param store using this naming convention /single-view/{env}/{env-name}
,
Also the variable needs to be declared in the following files:
By default, Husky will run a lint check before each commit and prevent the commit if this fails.
These failures can often be resolved automatically by opening a terminal, cd
-ing into the /app/single-view directory, then running yarn lint:fix
After each commit, CircleCI will run the cypress tests and lint checks.