Want to run FoodShot locally to test it or record a demo? Here is the full setup:
- Docker and Docker Compose
- Taskfile (
go-task) - Python 3.11+
- Poetry
- Cloudflare Tunnel (
cloudflared) or ngrok (for exposing local webhook, optional)
git clone <repo_url> && cd foodshot
cp .env.example .envEdit .env and fill in your keys (Telegram Token, OpenAI, etc.).
You can start the app in two ways: Webhook mode or Polling mode.
Start the database and Redis, then run the bot locally via polling:
task install
task pollStart dependencies and FastAPI locally:
task install
task devThen expose the webhook using a tunnel (like Cloudflare):
task tunnelCopy the public https:// URL generated by your tunnel and update .env:
WEBHOOK_URL=https://<your-tunnel-url>/webhookRestart the bot (task dev), and it will automatically register the new webhook URL with Telegram.
Don't forget to run migrations to initialize your database tables:
task db:migrateFoodShot uses Taskfile for common operations:
task lint/task format— run Ruff linter/formatter.task test— runpytesttest suite.task db:makemigrations "message"— create a new Alembic migration.task ops— launch the interactive Operations TUI Console.task broadcast— broadcast release updates to users.
We maintain rigorous tests for critical components, especially the medical math:
task test