Building a Telegram Bot for Health Tracking
I built a custom Telegram bot for health tracking instead of using existing apps, providing complete control over data privacy and feature implementation.
Why Telegram?
- Free Infrastructure: No hosting costs for bot interactions
- Well-documented API: Robust development framework
- Minimal Server Requirements: Telegram handles message routing
- Universal Access: Cross-platform without app store dependencies
How It Works
Daily Check-ins: 7 AM PST reminders for five habit metrics: weight training, cardio, diet adherence, sleep (8+ hours), and steps (5,000+).
Weekly Measurements: Monday check-ins for weight and waist circumference with progress tracking.
Daily engagement was chosen over weekly reporting for better habit reinforcement, goal awareness, and progress visibility.
Usage
Search @sehatmand_bot on Telegram. Commands: /start to register, /daily for check-ins, /weekly for measurements, /stats for user history.
Self-Hosting
Deploy privately with Docker:
- Create
.envfile:BOT_API_KEY=your_telegram_bot_token - Create empty
app.dbfile - Use docker-compose.yaml:
version: "3.8"
services:
sehat:
image: ghcr.io/manparvesh/sehat:main
volumes:
- ./app.db:/data/app.db
env_file:
- .env
restart: always
- Run:
docker compose up
Future Plans
- BMI tracking and trends
- Achievement streaks
- Better data visualization
- Custom reminder times
“Sehatmand” means “healthy” in Punjabi/Hindi