Telegram bot for monitoring available group classes at Zdrofit fitness centers with automatic notifications.
- Telegram Integration - Manage filters and notifications through Telegram
- Class Monitoring - Automatic availability checks every 60 minutes
- Flexible Filters - Filter by gyms, trainers, class types, time and weekdays
- Notifications - Instant alerts when free spots appear
- Year Wrap - Spotify-Wrapped style yearly stats, auto-sent every 31 December (or anytime via
/wrapped) - Security - Password encryption for all users
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the bot
python main.pyCronTrigger(minute="/5") - every 5min CronTrigger(minute="0,30") - every 30min CronTrigger(minute="0", hour="/2") - every 2h
| Command | Description |
|---|---|
/start |
Start page |
/login |
Login to your Zdrofit account |
/filters |
Manage filters |
/bookings |
View bookings |
/past_classes |
View past classes |
/wrapped |
Your year in review (fitness stats) |
/logout |
Logout |
# Start the bot
sudo docker compose build --no-cache && sudo docker compose up -d
# View logs
sudo docker compose logs -f zdrofit-bot
# Stop the bot
sudo docker compose down# Build the image
sudo docker build -t zdrofit-bot .
# Run the container
sudo docker run -d \
--name zdrofit-bot \
--restart unless-stopped \
-e TELEGRAM_BOT_TOKEN=your_token \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/app/logs \
--env-file .env \
zdrofit-bot# Run all tests
python -m unittest discover tests/ -v
# Run specific module
python -m unittest tests.test_filters -v- users - User credentials
- user_filters - Saved filters
- bookings - Booked classes
sqlite3 data/zdrofit.db
# Commands:
.tables # List tables
.schema users # Show table structure
SELECT * FROM users; # View data
.exit# Commands:
manage_db init # Init database
manage_db stats # Show database statistics
manage_db reset # Reset database statefrom src.database.db import Database
from src.database.models import User, UserFilter
db = Database()
# Add user
user = User(telegram_id=123, zdrofit_email="[email protected]", zdrofit_password="pwd")
db.add_user(user)
# Save filter
filter = UserFilter(user_id=123, club_id=7, zone_id="10", timetable_id="20")
db.add_filter(filter)
# Get available classes
classes = db.get_unnotified_classes(user_id=123)src/
├── api/ # Zdrofit API client
├── database/ # SQLite operations
├── scheduler/ # Periodic checks
├── telegram_bot/ # Telegram handlers and notifications
└── utils/ # Utilities and logging
- Support all Zdrofit fitness clubs across Poland
- Implement auto apply feature
- Implement pause feature
- Send notification to customers
- Add motivation messages/bages for X attended trainings
- Implement training reminder
- Add end year wrap stats and info
- Diff users by type: free/paid
- Integrate with payment system
- Add subscription
- Check changes in schedule
- Check adding new classes
- Export to Google Calendar
- Web interface
- Telegram Mini App
Environment variables in .env:
TELEGRAM_BOT_TOKEN- Bot tokenLOG_LEVEL- Logging level (DEBUG/INFO/ERROR)
Configuration files:
config/config.py- Main settings.crypto_key- Encryption key (do not commit!)
ps aux | grep -E "python|main.py" | grep -v grep
kill -9 <process id>