Front-end service for TC Country portal - TC-Tool.
Supported by Initiative for Climate Action Transparency - ICAT.
Built using Node.js 18 and Angular 17.1.0 framework.
-
Download and install the Node.js 18 LTS version for your operational system.
-
Download or clone this repository.
-
Edit the environment variables in the files
environment.prod.ts
andenvironment.ts
insrc/environments
folder. See below for more details about the environmental variables needed. -
In the terminal, go to this repository's main folder.
-
Install the NPM dependencies (including Nest) with the command:
$ npm install --force
- Build the app:
$ ng build
- Run the app in a dev server. The application will be accessible at
http://localhost:4200/
$ ng serve
This is an example cloud installation using Docker and Google Cloud Plataform. The provided
Dockerfile
can be used for local or cloud installation with different services.
-
In GCP Console, go to Artifact Registry and enable the Artifact Registry API
-
In the Artifact Registry, create a new repository:
- Format: Docker
- Type: Standard
- Location: desired application location
- Encryption: Google-managed key
-
Download and install gcloud CLI.
-
Download or clone this repository.
-
Edit the environment variables in the files
environment.prod.ts
andenvironment.ts
insrc/environments
folder. See below for more details about the environmental variables needed. -
In the terminal, go to this repository's main folder.
-
Build your container in the Artifacts Register using the provided
Dockerfile
. The container path can be found on the Artifact Registry's repository page.$ gcloud builds submit --tag [CONTAINER PATH]
-
Go to Cloud Run and create a New Service:
- Choose the option
Deploy one revision from an existing container image
and select the container image updated in the previous step - Add a service name
- Select the application region
- Select
Allow unauthenticated invocations
in the Authentication option - In the Container section:
- Select Container port 80
- Choose the option
Noticed that some special permissions in GCP can be necessary to perform these tasks.
The environment variables should be declared in the files environment.prod.ts
and environment.ts
in src/environments
folder as follow:
Variable name | Description |
---|---|
baseUrlAPI |
Country Portal Service API URL |
baseUrlAuditlog |
audit log Service API URL |
baseUrlPMU |
PMU Portal Web Aplication URL |
videoURL |
Video source URL |
authBaseUrlAPI |
Auth Service API URL |
This application depends on PmuPortalService and CalculationEngine APIs.