Backend service for ICAT Climate Action Assessment Tool for Transport Sector - TraCAD.
Supported by Initiative for Climate Action Transparency - ICAT.
Built using Python 3 and FastAPI framework.
-
Download and install the Python 3 for your operational system.
-
Download or clone this repository.
-
In the terminal, go to this repository's main folder.
-
Install the Pip dependencies with the command:
$ pip3 install -r requirements.txt
- Run the app:
$ uvicorn main:app --reload
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.
-
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.
After the application installation, the API Documentation is available in the application URL + /docs/
with Swagger.
This application provides API service to CountryPortalService application.
The complete dependency diagram of TraCAD Country and PMU applications:
TraCAD - CountryPortalService is Affero GPL licensed.