This is primarily an Angular app that runs through a node.js server. There are four main reasons for the node.js express server
- to serve the angular app when deployed in Kubernetes
- to proxy API requests to internally-facing backend API services, such as the DARTS API
- to handle auth / user session
- to provide a stubbed API for development
Running the application requires the following tools to be installed in your environment:
Install dependencies by executing the following command:
yarn
There are four different ways to develop locally:
To run darts-portal against node.js API stub:
yarn dev:darts-api-stub
To run darts-portal against staging API:
yarn dev:darts-api-stg
To run darts-portal locally against demo API:
yarn dev:darts-api-demo
To run darts-portal Angular & node.js frontend with darts-api:
yarn dev
The applications's home page will be available at https://localhost:3000.
Note this is running both node.js and Angular and expects the (darts-api) to also be running locally to function correctly
Run yarn:build
to build the project. The build artifacts will be stored in the dist/
directory. This compiles both the node.js server-side code and angular code.
Running the linting:
yarn lint
You can fix prettier formatting issues using:
yarn prettier:fix
Run yarn test
or yarn test:watch
to execute the unit tests via Jest.
--silent
flag reduces noise in console when running tests.
Run yarn test:functional
to execute the end-to-end tests using Cypress, this includes accessibility checks via axe-core (WCAG22AA standards).
Run yarn cypress
to open the cypress console, very useful for debugging tests.
Run yarn ng generate component component-name
to generate a new component. You can also use yarn ng generate directive|pipe|service|class|guard|interface|enum|module
.
Note the requirement for prefixing the ng
commands with yarn