/aiogram_bot_template

Aiogram 3.x bot template using PostgreSQL (asyncpg) with SQLAlchemy + alembic.

Primary LanguagePythonMIT LicenseMIT

aiogram_bot_template

System dependencies

  • Python 3.11+
  • Docker
  • docker-compose
  • make
  • poetry

Deployment

Via Docker

  • Rename .env.dist to .env and configure it
  • Rename docker-compose.example.yml to docker-compose.yml
  • Run make app-build command then make app-run to start the bot

Via Systemd service

  • Configure and start PostgreSQL
  • Configure and start Redis (» Read more)
  • Rename .env.example to .env and configure it
  • Run database migrations with make migrate command
  • Configure telegram-bot.service (» Read more)

Development

Setup environment

poetry install

Update database tables structure

Make migration script:

make migration message=MESSAGE_WHAT_THE_MIGRATION_DOES

Run migrations:

make migrate

Update translations

  1. Parse new used localization keys to update translations files (make i18n locale=TRANSLATION_LOCALE)
  2. Write new translations in .ftl files by translations/TRANSLATION_LOCALE
  3. Restart the bot

Used technologies: