Happy Rabbit is a service that inspires kids to perform activities on a regular basis by earning carrots. Happy Rabbit experience is powered by gamification and behavioural psychology. We are confindent that your children will have lots of fun making boring math, learning chess, jogging or helping parents with household.
- Admin and API: API and Admin
- telegram bot: python-telegram-bot + dramatiq+periodiq + redis
- storage:
- Admin powered by Postgres
- Google Spreadsheet for activity records
- CI/CD: deployment Dokku + GitHub Actions template
Check the example bot that uses the code from Main branch: t.me/happy-rabbit
Design of the project is wrapped in google-doc.
- Admin panel (thanks to Django)
- Background jobs using Dramatiq and crontab scheduling with Periodiq.
- Production-ready deployment using Dokku
- Telegram API usage in pooling or webhook mode
The fastest way to run the bot is to run it in pooling mode using SQLite database without Periodiq workers for background tasks. This should be enough for quickstart:
git clone https://github.com/Rustem/kz-geekabitz-happy-rabbit
cd django-telegram-bot
Create virtual environment (optional)
python3 -m venv happy-rabbit-venv
source happy-rabbit-venv/bin/activate
Install all requirements:
pip3 install -r requirements.txt
Create .env
file in root directory and copy-paste this:
DJANGO_DEBUG=True
DATABASE_URL=sqlite:///db.sqlite3
TELEGRAM_TOKEN=<ENTER YOUR TELEGRAM TOKEN HERE>
Run migrations to setup SQLite database:
python manage.py migrate
Create superuser to get access to admin panel:
python manage.py createsuperuser
Run bot in pooling mode:
python manage-bot.py
If you want to open Django admin panel which will be located on http://localhost:8000/admin/:
python manage.py runserver
If you like docker-compose you can check full instructions in our Wiki.
Read Wiki page on how to deploy production-ready.