Node 16 is required to run this project. Assuming you have Node 16, install dependencies for all packages with Yarn:
yarnIt is recommended to install python using pyenv to easily switch between versions without depending on system installed python versions.
Python 3.9 and Poetry are required. If you are running Ubuntu 20.04, ensure that Python 3.9 is installed by running:
sudo apt install python-3.9 python3.9-devAssuming you have set up Poetry, install API dependencies:
cd api
poetry installAfterwards, create your api/.env file using the provided api/.env.example file:
cp .env.example .envFill out your .env file according to your local environment configuration. Ensure that the database you specify in DATABASE_URL exists.
import secrets
print(secrets.token_urlsafe())
# Sample Output: 1eE8JzMmpsS4Pz_GvbcDSl07T_QhDlqmb6_JhMz-lUIAdd Sample Output Value: 1eE8JzMmpsS4Pz_GvbcDSl07T_QhDlqmb6_JhMz-lUI and update DJANGO_SECRET_KEY
Finally, run migrations:
cd carbonpath
poetry run python manage.py migrateRedis is required to run this project. Update api/.env to point to your redis server. For example:
DJANGO_REDIS_URL=redis://127.0.0.1:6379/1You can run the web server this way:
PORT=3000 yarn webYou can run the dev server for the API this way:
cd api/carbonpath
poetry run python manage.py runserver 0.0.0.0:8000redis-serverAssuming redis server is already running:
cd api/carbonpath
poetry run celery -A config.celery_app worker --loglevel=info --beat