-
Clone this repository
git clone https://github.com/rv602/open-source-sustainability/
cd open-source-sustainability
-
Install all the necessary dependencies
npm i
(for the node modules)Create a virtual environment (for the Mesa models)
virtualenv venv
Activate the environment
source venv/bin/activate
Install the python dependencies
pip install -r requirements.txt
-
Deploy the Mesa Models on Cloudflare tunnel
The Mesa models can be easily visualised on a web interface by running this command, and can be accessed on localhost on any port configured.
mesa runserver
This method is just restricted to get your model up and running in localhost. To have them deployed globally, we will be using Cloudflare Tunnels.
You need to install Cloudflare tunnels CLI via the following command.
-
Mac
brew install cloudflare/cloudflare/cloudflared
-
Linux
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared-linux-amd64.deb
-
Windows
PS C:\Users\Administrator\Downloads\cloudflared-stable-windows-amd64> .\cloudflared.exe --version
Once you are done installing the Cloudflare CLI, you can use this command to deploy your models.
cloudflared tunnel --url http://localhost:{portNumber}
This will result in a URL, which you have to update in the
iframe
.Now that you have all things set up, you can have the project up and running by
npm run dev