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
$ npminstall
Copied!
Run locally:
1
$ npm start
Copied!
and go to 127.0.0.1:8080 in your browser to test it localy