Skip to content

amirphl/mozcoin-backend

Repository files navigation

setup environment

deployment

  • pull the master branch
  • run redis docker image:
    • docker compose up -d
    • docker logs mozcoin-backend-redis-1
    • docker inspect mozcoin-backend-redis-1 | grep -i ip
  • install new requirements:
    • python3 -m pip install -r requirements.txt
    • python3 -m pip install pytz --upgrade
  • update env vars
    • update redis IP
    • vim ~/.bashrc
    • source ~/.bashrc
    • sudo vim /etc/systemd/system/gunicorn.service
    • sudo systemctl daemon-reload
  • python3 manage.py migrate
  • python3 manage.py shell
    • Coin.objects.create(name='btc', verbose_name='bitcoin')
    • Coin.objects.create(name='eth', verbose_name='ethereum')
    • ...
  • gunicorn:
    • sudo systemctl daemon-reload
    • sudo systemctl restart gunicorn.service
    • sudo systemctl status gunicorn.service
  • celery:

TODO

  • Add ADA logo
  • auth:
    • ListCoins
    • RetrieveCoin
  • remove m,n from responses and database
  • google: free crypto price api
    • compatible price with trading view (use same exchange price)
    • "Our Free API has a rate limit of 50 calls/minute."
  • use queue for processing price predictions
  • redesign whole process:
    • parctice: other designs
  • atomic operations:
    • update num_mozcoins in CreatePrediction
  • make sure everything is UTC inside server
  • make sure everything is Local timezone inside client
  • different sterategies for prediction params
  • other celery libs:
    • django-celery-beats
    • django-celery-results
  • num gunicorn workers
  • organize imports and pylint
  • handle corner case of 51 to 60 in front (client side)
  • redis has a lot of celery keys
  • switch to postgres
  • celery:
    • CELERYD_OPTS="--time-limit=300 --concurrency=8"
    • CELERYD_USER="amirphl"
    • CELERYD_GROUP="amirphl"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published