This is the UI app for monitoring and tracking submissions to the DCP.
- Install
nvm
to install node.https://github.com/nvm-sh/nvm nvm install
To get the node version listed at:/.nvmrc
- Clone this repo, or remove your node_modules folder:
rm -rf node_modules
yarn install
ng serve -c=dev
(quickly check if UI is working, this will point to Ingest API in dev)
-
Run
nvm use
to set the used version to the one listed at:/.nvmrc
-
Run
ng serve
orng serve -c=[dev|staging|prod]
for a dev server pointing to the ingest api urls configuration in theenvironment.<env>.ts
. -
Navigate to
http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Please check ingest-kube-deployment
repo
Note: The Ingest-UI application was designed to source environment variables from environment files (e.g., environment.dev.ts). However, during deployment, these variables were not correctly sourced due to the deployment setup involving Docker and Helm. Specifically, the prepare_artifact.sh
script in the Dockerfile and Helm configuration override the environment variables, leading to inconsistencies between local development and deployed environments. This issue became evident when changes to the environment.*.ts files did not reflect in the deployed application. Thus, we need to change the Helm YAML files to achieve consistency with the deployed environment for the environment variables.
-
Environment Variables: The environment files (environment.*.ts) are updated with the necessary configurations. The
environment.env.ts
file contains placeholders for environment variables which are used in the application code. -
OIDC Interception: The
OidcInterceptor
uses these environment variables (e.g. SECURED_ENDPOINTS) to add security headers to HTTP requests, ensuring that API calls to secure endpoints are authorized. -
Docker Setup: During the Docker build process, the
prepare_artifact.sh
script runs in the second stage. This script replaces the environment placeholders in the built JavaScript files (main.*.js). -
K8s Deployment: The Helm upgrade command deploys the application to the Kubernetes cluster, sourcing configuration values from environment-specific YAML files (e.g., k8s/apps/dev.yaml). These values are set as environment variables in the running container.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
The versions of Angular, Node, TypeScript and RxJS are tightly coupled with each-other, as described by this table.
Furthermore, Angular 12 is only in Long-Term Support until 2022-11-12, source and Node 14 is only Maintained until 2023-04-30 source. This project should expect to be migrated to supported versions of Node and Angular as appropriate.