This template provides clean start to create bot using aiogram.
- Aiogram
- Aiogram Dialog
- Dishka
- Pydantic
- FastAPI
I18n(TODO)- SQLAlchemy + asyncpg
- Alembic
- UV
- Ruff
- Docker
- PostgreSQL
- Redis
- Create
.envfile from.env.distand fill it. - Create
password.txtindbfolder and fill it. - Run docker
docker compose up --build -d - Run migrations with
docker compose exec -it db uv run alembic upgrade head
- Create
.envfile from.env.distand fill it. - Create
password.txtindbfolder and fill it. - Run
docker compose up --build -d db redis - Install dependencies with
uv sync - Create
.venvwithuv venv --seed - Activate virtual environment with
source .venv/bin/activate - Run migrations with
alembic upgrade head - Run bot with
python -m bot
- Set
USE_WEBHOOKto True in .env - Update
BOT_SECRET_TOKEN - Set
API_HOSTto your domain - Update
ORIGINSin.env - Start bot with
python -m bot
docker compose -f compose.yml -f compose.prod.yml up --build -d
alembic upgrade headalembic revision --autogenerate -m "<migration_name>"Some environment variables in the .env file have a default value of changethis.
You have to change them with a secret key, to generate secret keys you can run the following command:
python -c "import secrets; print(secrets.token_urlsafe(32))"