Local development
Prerequisites
| Requirement | Detail |
|---|---|
Node 12.21.0 |
Pinned in |
Python 3 |
|
Chrome |
Supplied by Puppeteer for headless unit tests; a real Chrome for development. |
Repository access |
|
|
The repository README references |
Setup
nvm use # pin Node 12.21.0
npm install # also installs Husky hooks via the postinstall script
Then generate the environment file — this is the step people forget:
./deployment/setenv.sh <ENV_NAME> [DOMAIN] [CONFIG_DIR] [ENV_FILE_NAME]
# example, pointing at the `exp` dev environment
./deployment/setenv.sh exp "dev.payability.com" "$PWD/deployment"
npm start runs setenv.sh for you with whatever environment name is currently
committed in package.json, then ng serve:
npm start
|
The environment name in the |
To switch backend later, re-run setenv.sh with a different name (staging,
apps, …). ./deployment/checkenv.sh prints which environment you configured last.
Details of what the script generates: environments.
Commands
| Command | Does |
|---|---|
|
|
|
ESLint over |
|
Prettier write over |
|
Karma in watch mode. |
|
Karma once — prefer this in agent and CI loops. |
|
Headless with coverage and JUnit/Cobertura reports. |
|
Angular builds. The prod/test variants go through |
|
Cypress interactive / headless. |
|
Start the app then run Cypress against it ( |
|
Prepare an EVA-aware environment and serve. |
|
The above, plus open the EVA dev server in a second terminal tab. |
Ports
Google SSO only works on ports registered with the Google client. From the repository README:
http://localhost:4200 (default)
http://localhost:4300
http://localhost:4400
http://localhost:4500
http://localhost:4600 (used by EVA)
http://localhost:5000
http://localhost:8082
|
Serving on any other port breaks login: the Google client id
( |
Note 4600 is EVA’s dev server port, so do not use it for this application when running both.
Incognito mode is not supported
Stated explicitly in the repository README. The application depends on
localStorage, sessionStorage and a cross-subdomain cookie for the EVA token —
see caching and persistence.
Running against a local EVA
Parts of the UI are rendered by EVA. To develop against a local EVA checkout:
npm run start-with-eva
which expands to:
export EVA_API_CUSTOM_URL=http://localhost:4600
./deployment/setenv.sh exp dev.payability.com "$PWD/deployment" environment.with-eva
# … then serves this app and, via `ttab`, runs `npm run start-with-ia` in ../eva-fe
So it expects an eva-fe checkout as a sibling directory.
npm run connect-to-eva does the environment preparation and serves this app only —
use it when EVA is already running.
Two behavioural differences on localhost:
-
The EVA auth token travels in the iframe URL (
?auth=<jwt>) instead of a cookie on the shared parent domain. -
Iframe origin checks treat
localhostas always allowed.
Both are in iframe messaging and EVA. A bug that only reproduces locally is often one of these.
EVA_API_CUSTOM_URL is honoured by deployment/set-env.ts:
evaApiUrl: '${process.env.EVA_API_CUSTOM_URL ? process.env.EVA_API_CUSTOM_URL : process.env.EVA_API}/',
Husky hooks
Installed by npm install (the postinstall script runs husky install).
| Hook | Runs |
|---|---|
|
|
|
|
|
Do not bypass with |
Feature flags locally
Build flags come from environment.featureFlags, which setenv.sh regenerates —
so editing it by hand is temporary. For local experimentation prefer the runtime
console at /admin/feature-flags (needs the DEV permission), which stores
overrides in sessionStorage.
In non-production builds the resolved flag table is printed to the console once per page load. See feature flags.
Useful development tooling
| Tool | Detail |
|---|---|
Redux DevTools |
Instrumented unconditionally. The fastest way to understand any screen — every meaningful transition is a named action. |
|
Runtime flag console for this app and EVA. |
Iframe message log |
|
Request ring buffer |
Last 50 requests in |
|
Which environment you last configured. |
SonarLint (optional)
The repository README documents connecting an IDE to SonarCloud:
-
Generate a token in SonarCloud (
My Account→Security). -
Install the SonarLint extension (it requires Java).
-
In VS Code user settings:
"sonarlint.connectedMode.connections.sonarcloud": [ { "connectionId": "payability", "organizationKey": "payability", "token": "GENERATED_TOKEN" } ]
WebStorm instructions are a // TODO in the README.
First-run failures
The recurring ones, with fixes, are in troubleshooting.
The short version: almost every "it will not build" is a missing
setenv.sh run or the wrong Node version.