Skip to content

Repository files navigation

FoodShot Banner

FoodShot is a medical-grade nutrition diary — not a meal tracker.

It uses Telegram as a zero-friction interface to build daily habits. Snap a photo ➔ Vision AI identifies the dish ➔ USDA calculates exact macros. Every meal becomes structured, exportable data — built for people who take their health seriously.

Features in Action

AI Food Recognition
Snap a photo and get precise USDA nutrition instantly.
Diabetes Mode
Calculates suggested insulin boluses based on your ICR/ISF.
Daily Report
View your calorie and macronutrient progress for the day.
Data Export & History
Export your medical diary to CSV for your doctor.

Disclaimer: The bot is an assistant, not a doctor. All calculations are transparent but serve as estimates. It does not replace professional medical advice.

Architecture

The simplified version. The real system has 6 layers — background job runners, a terminal admin panel, FSM state management, dual-source vision pipeline (OpenAI → Gemini fallback), dual-source nutrition pipeline (USDA → Nutritionix fallback), LLM observability via Langfuse, and Cloudflare Zero Trust routing. The diagram below doesn't do it justice.

See the full architecture

flowchart TD
    User([Telegram Client]) --> Webhook[FastAPI Webhook]
    Webhook --> Core[aiogram Dispatcher]
    
    Core --> Pipeline[Analysis Pipeline]
    Core --> Jobs[Background Jobs<br>daily_report, retention, broadcast]
    Core --> TUI[Admin TUI<br>Textual]
    
    Pipeline --> Vision[GPT-4o Vision<br>identify dish]
    Pipeline --> Nutrition[USDA REST API<br>calculate macros]
    
    Vision --> DB[(PostgreSQL<br>users, meals)]
    Nutrition --> DB
    
    Redis[(Redis<br>FSM state, rate limits)] -.-> DB
Loading

Built-in Operations Console

Nobody expects a full terminal dashboard in a food tracker.

FoodShot ships with an interactive TUI (powered by Textual) to manage the entire system locally or over SSH — grant/revoke Premium access, browse meal history, resolve FSM state conflicts, all without touching SQL.

Admin TUI Demo

Admin console docs

Getting Started

The fastest way — just open Telegram and try it:

Telegram Bot

Want to run it locally or self-host:

git clone git@github.com:soroqn1/FoodShot.git && cd foodshot
cp .env.example .env
# fill in your keys, then:
task install && task dev   # start webhook & services

Full setup guide — webhook mode, Cloudflare tunnel, migrations, all commands.


Contributing

Issues and PRs are welcome. For significant changes — open an issue first to discuss what you'd like to change. Tests for medical math are strictly required.


License

Business Source License 1.1 (BUSL-1.1)

You are completely free to clone, run, and modify this project for personal use, education. Commercial or production use is strictly prohibited without explicit permission.

Commercial use — contact me directly.

About

AI-powered nutrition diary and medical food logger. Snap a photo — get instant USDA macros.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages