This is an official repository for the Tangible Climate Futures
project for the (Advanced) Distributed Systems Prototyping SS23
course at TU Berlin. The description and the structure of our project, together with a detailed structure of implemented JSON objects, can be found in our wiki.
Project Developers:
Our Project can be deployed in multiple ways, including full-Docker deployment, developer deployment, and on the Google Cloud Platform (using Terraform).
Setup:
sudo apt update && sudo apt install git
).git clone https://github.com/Corgam/SS23_ADSP_TCF
).cd SS23_ADSP_TCF
) and run the .sh script (Ubuntu: sh setup.sh
, do not use sudo).frontend/src/environments/
folder, fill in the Firebase API keys for web applications in files: environment.ts
and environment.development.ts
(For a detailed guide follow: https://firebase.google.com/docs/projects/api-keys?hl=en). Remember to enable Email Authentication inside Firebase.npm run setup
command inside the root folder, this will install all necessary npm packages.Note: We use .sh
script for automatic setup. In case of errors, or manual installation, follow the steps descripted in the setup.sh
file.
The full-Docker deployment is the recommended way for using the application, where all of the components are deployed as individual Docker containers. If you are a developer, you can use the Developer Deployment described in the section below. While we have tested this deployment on a clean Ubuntu 22.04 LTS (Jammy Jellyfish, 64-bit)
, it should work on all machines with Docker installed.
cd SS23_ADSP_TCF
and run npm run deploy
, which will deploy all necessary Docker containers (including FE, BE, and all microservices). Make sure that the Docker Service is running (docker ps
).Notes:
localhost:40000
with Swagger Docs at localhost:40000/docs
localhost:8080
localhost:27017
inside a Docker Containerlocalhost:50000
with Swagger Docs at localhost:50000/docs
The developer deployment (or reduced-Docker) is a deployment recommended for developing the project. All components, except MongoDB, are deployed locally (no Docker containers) allowing for easier development (live reloading). This deployment was tested on a clean Ubuntu 22.04 LTS (Jammy Jellyfish, 64-bit)
.
npm run dev:all
to run all components as the dev version (live reloading) as background processes. The MongoDB will be still deployed as a Docker container, thus make sure that the Docker Service is running (docker ps
).Notes:
localhost:40000
with Swagger Docs at localhost:40000/docs
localhost:8080
localhost:27017
inside a Docker Containerlocalhost:50000
with Swagger Docs at localhost:50000/docs
This cloud deployment will deploy our complete project on GCP using Terraform. It is intended to be used as a production-ready deployment, thus making the project publicly available.
GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/key.json
frontend/src/environments/
folder, fill in the Firebase API keys in files: environment.ts
and environment.development.ts
deploy
directory using cd deploy
terraform init
terraform apply
, you can access the app under the provided above URLs.terraform destroy
.Once the project is set up, and the MongoDB container is running, you can execute some helpful scripts:
Note: Make sure you have the MongoDB instance running.
To seed the database with random documents, use the following command python3 scripts/mongo/main.py seed
Options:
--num-documents <int>
- the number of documents to seed (default 10).--mongo-url <string>
- the URL to the database (default mongodb://localhost:27017/datastore
)python3 scripts/mongo/main.py seed --num-documents 20 --mongo-url mongodb://localhost:27017/mydatabase
To clean up the database, simply run the following command python3 scripts/mongo/main.py cleanup --mongo-url <string>
python3 scripts/mongo/main.py cleanup --mongo-url mongodb://localhost:27017/datastore
Here is a list and description of all npm scripts included in the main package.json
file:
npm run setup
- Installes all necessary npm packages, for both the FE and BE.npm run setup:frontend
- Installes all necessary npm packages for just the FE.npm run setup:backend
- Installes all necessary npm packages for just the BE.npm run setup:python
- Installes all required Python libraries for the Python Microservice.npm run deploy
- Deploys the whole app in Docker containers, including FE, BE, MongoDB, and Python Microservice.npm run deploy:mongo
- Deploys just the MongoDB Docker container.npm run dev:backend
- Deploys the MongoDB and Python Docker containers and the dev version (live reloading) of the BE.npm run dev:frontend
- Deploys the dev version (live reloading) of the FE.npm run dev:ds
- Deploys just the Python Microservice as the dev version (live reloading).npm run dev:pub
- Deploys just the BE as the dev version (live reloading).npm run dev:all
- Deploys the whole app as the dev version (live reloading) as background processes.