Search…
42AI / Subnational Carbon Budget Assessment
A django WebAPI and a React app to show a map of subnational carbon budget assessments
Team Name: 42AI
Participants: Amric Trudel, Arthur Lanter, Pablo Clement, Eric Parisot
Node: Paris, France (HEC Paris - Ecole 42)
Discord channel: https://discord.gg/9y3AQuf

Corresponding Prompt:

Submission summary

Our participation in the Open Climate Collabathon, 16-17 nov 2019. Our prompt was "Subnational Carbon Budget Assessments"
We decided to separate Backend and Frontend, using two servers communicating through APIs. This configuration allows us to work separately on both architecture sides, in case we want to improve or change the stack of one of them.
This structure with APIs from the backend is also in the spirit of the Collabathon. In deed, on the long term, data generated by the model could be accessible through APIs for other projects.

Code submission:

GitHub - 42-AI/open_climate_collabathon at dev
GitHub

Demo example:

Backend Installation | Django API

Python3 and pip3 required Go to /dev_django
Install:
1
$ pip install -r requirements.txt
Copied!
Run locally
1
$ python manage.py migrate
2
$ python manage.py createsuperuser
3
$ python manage.py runserver
Copied!
and go to 127.0.0.1:8000 in your browser to test it localy
To use another IP address and serve on your network, simply add it to ALLOWED_HOSTS in settings.py and run with:
1
$ python manage.py runserver IP
Copied!

Frontend Installation | React app

nodeJS and npm required
Go to /dev_react

install:

1
$ npm install
Copied!

Run locally:

1
$ npm start
Copied!
and go to 127.0.0.1:8080 in your browser to test it localy

edit API fetching:

Frontend is fetching map's data from 'http://127.0.0.1:8000/api/maps/USA?format=json' You can edit this parameter in app/containers/App.jsx on line 17.

TODO:

Select between 1.5 and 2 °C target
show data graph
add more countries and a world map
Last modified 1yr ago