Telegram bot for language learning with spaced repetition, voice practice, and AI-powered feedback.
- Vocabulary Management - Add words manually or from curated word lists
- Spaced Repetition (SM-2) - Anki-like algorithm for optimal memorization
- Multi-language Support - English and Korean learning with Russian interface
- Voice Pronunciation - Record voice messages, get AI feedback via OpenAI Whisper
- Audio Playback - Listen to word pronunciations (gTTS with S3/MinIO caching)
- Review Sessions - Track progress with quality ratings
- aiogram 3.x - Modern async Telegram bot framework
- FastAPI - REST API with async support
- SQLAlchemy 2.0 - Async ORM with PostgreSQL
- i18n - Localized interface (Russian, English, Korean)
- Python 3.13+
- uv package manager
- PostgreSQL 17+
- Docker (for MinIO)
# Clone and enter project
cd lingooru
# Create and activate virtual environment
uv venv && source .venv/bin/activate
uv sync --all-groups# Copy example config
cp .env.example .env
# Edit with your credentials
$EDITOR .envRequired settings:
# Database
DB__HOST=localhost
DB__PORT=5432
DB__NAME=lingooru
DB__USERNAME=postgres
DB__PASSWORD=postgres
# Telegram
telegram__bot_token=YOUR_BOT_TOKEN
# OpenAI (for voice recognition)
openai__api_key=YOUR_OPENAI_KEY
# S3/MinIO (for audio caching)
S3__ENDPOINT_URL=http://localhost:9000
S3__ACCESS_KEY=minioadmin
S3__SECRET_KEY=minioadmin
S3__BUCKET_NAME=lingooru-audio# Start MinIO for audio storage
docker run -d \
--name minio \
-p 9000:9000 \
-p 9001:9001 \
-v ~/minio/data:/data \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data --console-address ":9001"
# Create bucket
docker exec minio mc alias set local http://localhost:9000 minioadmin minioadmin
docker exec minio mc mb local/lingooru-audio --ignore-existing
docker exec minio mc anonymous set download local/lingooru-audiouv run alembic upgrade head# Run Telegram bot
make bot
# Or run API server
uv run uvicorn main:app --host 0.0.0.0 --port 8000The bot uses inline keyboards for navigation. Main features:
| Button | Description |
|---|---|
| π Π£ΡΠΈΡΡ | Learn new words |
| π ΠΠΎΠ²ΡΠΎΡΡΡΡ | Review due words (spaced repetition) |
| π€ ΠΡΠΎΠΈΠ·Π½ΠΎΡΠ΅Π½ΠΈΠ΅ | Practice pronunciation with voice |
| π ΠΠ΅Π½Ρ | Main menu with stats |
- Add Words - From word lists or manually
- Learn - See word, translation, example; rate as Know/Hard/Forgot
- Review - Spaced repetition based on SM-2 algorithm
- Voice Practice - Record pronunciation, get AI feedback
make # Run all checks (fmt, lint, db, test)
make fmt # Format code with ruff
make lint # Lint with ruff and mypy (strict)
make test # Run pytest with coverage
make db # Validate migrationssrc/
βββ bot/ # Telegram bot
β βββ handlers/ # Message & callback handlers
β βββ keyboards/ # Inline & reply keyboards
β βββ locales/ # i18n translations (ru, en, ko)
β βββ middleware/ # User loading, i18n
βββ modules/
β βββ audio/ # TTS generation & S3 storage
β βββ srs/ # Spaced repetition (SM-2)
β βββ users/ # User management
β βββ vocabulary/ # Words, translations, user dictionary
β βββ voice/ # Voice transcription & feedback
βββ core/ # API core (routes, middleware, DI)
βββ db/ # Database config & sessions
βββ config.py # Application settings
tests/
βββ unit/ # Unit tests
βββ integration/ # API & database tests
βββ conftest.py # Shared fixtures
See CLAUDE.md for detailed development guidelines.
# Run all tests
make test
# Run by category
uv run pytest -k unit -v
uv run pytest -k integration -v
# Run specific module
uv run pytest tests/unit/modules/audio/ -vCoverage requirements: 80% line, 70% branch.
| Variable | Description | Default |
|---|---|---|
DB__* |
PostgreSQL connection | localhost:5432 |
telegram__bot_token |
Telegram bot token | - |
openai__api_key |
OpenAI API key | - |
S3__ENDPOINT_URL |
MinIO/S3 endpoint | http://localhost:9000 |
S3__ACCESS_KEY |
S3 access key | - |
S3__SECRET_KEY |
S3 secret key | - |
S3__BUCKET_NAME |
Audio bucket name | lingooru-audio |
LOGGING_LEVEL |
Log level | INFO |
MIT