Did you know that GitHub supports table of contents by default 🤔
This is the Telegram Bot.
- Python 3.12 & Poetry
- Aiogram 3 & aiogram-dialog
- Formatting and linting: Ruff, pre-commit
- Deployment: Docker, Docker Compose, GitHub Actions
-
Install Python 3.12
-
Install Poetry
-
Install project dependencies with Poetry.
poetry install
-
Set up pre-commit hooks:
poetry run pre-commit install --install-hooks -t pre-commit -t commit-msg
-
Set up project settings file (check settings.schema.yaml for more info).
cp settings.example.yaml settings.yaml
Edit
settings.yaml
according to your needs.
Set up PyCharm integrations
- Ruff (plugin).
It will lint and format your code. Make sure to enable
Use ruff format
option in plugin settings. - Pydantic (plugin). It will fix PyCharm issues with type-hinting.
- Conventional commits (plugin). It will help you to write conventional commits.
- Run the database if you have not done it yet
- Run the Redis server if needed:
docker compose up -d redis
- Run the bot:
poetry run python -m src.bot
We use Docker with Docker Compose plugin to run the service on servers.
- Copy the file with settings:
cp settings.example.yaml settings.yaml
- Change settings in the
settings.yaml
file according to your needs (check settings.schema.yaml for more info) - Install Docker with Docker Compose
- Build a Docker image:
docker compose build --pull
- Run the container:
docker compose up --detach
- Check the logs:
docker compose logs -f
- Run
poetry update
to update all dependencies - Run
poetry show --outdated
to check for outdated dependencies - Run
poetry add <package>@latest
to add a new dependency if needed
- Run
poetry run pre-commit autoupdate