- Python 3.8+
- Poetry
- PostgresQL (Other DB is supported, but it's a pain in the ass to migrate as
aerich
makes it not flexible.)
- Clone the repo
- Have these on your environment variable or in
.env
file
DEBUG=<bool>
SECRET=<str>
API_KEY=<str>
BNSITE_SESSION=<str>
DB_URL=<str>
- Install the repo with poetry
poetry install [--no-dev]
- Populate the database
poetry run aerich upgrade
poetry run python populate.py
# or
poetry shell
aerich upgrade
python populate.py
- Run it.
poetry run uvicorn bnstats:app
# or
poetry shell
uvicorn bnstats:app
# or, if you want to use gunicorn
gunicorn -w 4 -k uvicorn.workers.UvicornWorker bnstats:app
- Run cronjob every 1-2 hours.
cron.sh
cd <PathToProject>
<PoetryEnv>/bin/python <PathToProject>/populate.py -d 1
crontab
# Every 30 minutes
*/30 * * * * cron.sh
Look at Uvicorn's deployment docs.
Find and delete kicked BNs when the listing changesStar rating graph + label + avgSpecific timespan optionMove database update routine out of applicationScoring system- Update tests