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
.env
file from.env.dist
and fill it. - Create
password.txt
indb
folder and fill it. - Run docker
docker compose up --build -d
- Run migrations with
docker compose exec -it db uv run alembic upgrade head
- Create
.env
file from.env.dist
and fill it. - Create
password.txt
indb
folder and fill it. - Run
docker compose up --build -d db redis
- Install dependencies with
uv sync
- Create
.venv
withuv venv --seed
- Activate virtual environment with
source .venv/bin/activate
- Run migrations with
alembic upgrade head
- Run bot with
python -m bot
- Set
USE_WEBHOOK
to True in .env - Update
BOT_SECRET_TOKEN
- Set
API_HOST
to your domain - Update
ORIGINS
in.env
- Start bot with
python -m bot
docker compose -f compose.yml -f compose.prod.yml up --build -d
alembic upgrade head
alembic 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))"