Skip to content

Coordination Description Mapping

License

Notifications You must be signed in to change notification settings

UN-OCHA/hpc-cdm

This branch is 175 commits ahead of, 2 commits behind develop.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

57feace · Feb 5, 2025
Jun 14, 2024
Apr 26, 2022
Dec 19, 2024
Feb 5, 2025
Jul 12, 2024
Feb 5, 2025
Jun 2, 2023
Aug 5, 2020
Jul 14, 2020
Sep 5, 2022
Jun 2, 2023
Jun 2, 2023
Apr 15, 2024
Jan 26, 2022
Feb 4, 2025
Oct 31, 2023
Jun 14, 2024
Jul 15, 2021
Nov 29, 2023
Apr 21, 2022
Nov 29, 2023
Jun 2, 2023
Jun 2, 2023
Sep 26, 2024
Feb 4, 2025
Feb 4, 2025
Oct 25, 2024
Dec 19, 2024

Repository files navigation

UN-OCHA HPC Monorepo

This project was generated using Nx.

Building & Running CDM and FTS Admin

Autoloading dev server with in-browser dummy model

To run the CDM app using the in-browser dummy model, run the following command:

npm run start hpc-cdm

To run the FTS Admin app using the in-browser dummy model, run the following command:

npm run start hpc-ftsadmin

Then navigate to to http://localhost:4200/

Autoloading dev server with live API

To run the app and connect to an API server (either the local dev server or a real live server):

  • Configure the file .env.json with appropriate values for the API you will be interacting with
  • Run one of the following commands:
    • CDM
    npm run start hpc-cdm -- --configuration=dev-live
    • FTS Admin
    npm run start hpc-ftsadmin -- --configuration=dev-live

Then navigate to to http://localhost:4200/

Production server within docker

  • Build the image:
    docker build -t hpc-cdm .
    (building FTS Admin is not supported yet)
  • Configure the file .env.json with appropriate values for the API you will be interacting with
  • Run the docker container:
    docker compose up -d
    

Docker compose will run the image and map port 80 of the image to 4200 of the host, to match the ports when running using the other methods above.

So visit to http://localhost:4200/ test the image is running correctly.

Adding a client to HID

To be able to test login locally, you need to have a client ID that matches hpcAuthClientId in your .env.json file stored in the HID database. It doesn't matter what the secret is as we use the OAuth Implicit Flow / Simple Authentication Process. You can insert an entry into the database by running the following:

# launch the MongoDB Shell
docker exec -it hid_api_db_1 mongo
# Run these in the shell
> use local;
> db.client.insert({"id": "cdm-local", "name": "CDM", "url": "http://localhost:3000", "redirectUri": "http://localhost:3000/", "loginUri": "http://localhost:3000", "secret": "<something>"})
> exit;

License

Copyright 2020 United Nations Office for the Coordination of Humanitarian Affairs

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.