Song Vault is a Python Telegram bot for repertoire management. It uses python-telegram-bot, uv, SQLAlchemy, Alembic, Postgres, and S3-compatible chart storage (MinIO in local development).
The MVP is complete. The current repository baseline is the finished admin-operated repertoire bot plus documentation for follow-on feature planning in docs/features/.
- Async Telegram bot skeleton with polling
- Button-first Telegram navigation (reply keyboard + inline actions)
- Admin-only repertoire CRUD flow
- Rich song metadata fields: capo and time signature
- Stored
arrangement_notesfield for backup/domain compatibility (currently non-user-facing) - Admin-only chart upload flow with one active chart per song
- Chart retrieval by song ID
- Admin-only repertoire backup export/import (ZIP with chart binaries)
/startas the only typed entry/reset path; all other user actions stay in buttons- Postgres-backed persistence and Alembic migrations
- Ruff, mypy, pytest, pre-commit, and GitHub Actions
-
Copy environment configuration:
cp .env.example .env
-
Set
TELEGRAM_BOT_TOKENin.env. -
Build and start the full local stack (Postgres, MinIO, bucket init, and bot):
docker compose up -d --build
-
Follow logs:
docker compose logs -f bot
-
Install dependencies:
uv sync --dev
-
Start infrastructure only:
docker compose up -d db minio minio-init
-
Run migrations and start bot:
uv run alembic upgrade head uv run song-vault
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run pytest
TEST_DATABASE_URL=postgresql+asyncpg://song_vault:song_vault@localhost:5432/song_vault uv run pytest tests/test_postgres_integration.py
uv run pre-commit run --all-filesThe repository includes a GitHub Actions workflow at .github/workflows/docker-publish.yml that builds and pushes the app image to Docker Hub on:
- pushes of Git tags matching
v*
The published Docker tag is the same as the Git tag that triggered the workflow (for example, pushing v1.2.3 publishes the Docker tag v1.2.3).
Set these GitHub Actions secrets:
DOCKERHUB_USERNAMEDOCKERHUB_TOKEN(Docker Hub access token)
Optional repository variable:
DOCKERHUB_IMAGE(defaults to<DOCKERHUB_USERNAME>/song-vault)
To roll a published tag out to production, see deploy/README.md.
TELEGRAM_BOT_TOKEN: bot token from BotFatherADMIN_TELEGRAM_USER_IDS: comma-separated Telegram user IDs allowed to modify repertoireDATABASE_URL: SQLAlchemy async database URLTEST_DATABASE_URL: optional SQLAlchemy async Postgres URL used for migration/persistence integration testsLOG_LEVEL: application logging levelBOT_POLL_INTERVAL: long-polling interval in secondsCHART_STORAGE_ENDPOINT_URL: S3-compatible endpoint URLCHART_STORAGE_REGION: object storage region (default:us-east-1)CHART_STORAGE_BUCKET: chart bucket nameCHART_STORAGE_ACCESS_KEY_ID: object storage access keyCHART_STORAGE_SECRET_ACCESS_KEY: object storage secret keyCHART_STORAGE_USE_SSL: use HTTPS for storage (true/false)CHART_STORAGE_FORCE_PATH_STYLE: force S3 path-style addressing (true/false)