This project turns receipt images into structured expense data, stores it in Supabase Postgres, and lets users ask natural‑language questions about their spending — now also accessible via Telegram.
Layer | Tech |
---|---|
LLM (receipt parsing & categorization) | meta‑llama/llama‑4 models API |
Text‑to‑SQL | sqlcoder-7b-2 via Cloudflare AI (HuggingFace: defog/sqlcoder-7b-2) |
OCR | Mistral OCR (fallback: tesseract) |
Backend API | Python + FastAPI + asyncio |
Database | Supabase Postgres |
Frontend | Next.js + Tailwind / shadcn |
Messaging | Telegram Bot integration via python‑telegram‑bot |




Method | Path | Purpose |
---|---|---|
GET |
/receipts/user/{user_id} |
list receipts by user |
POST |
/receipts/extract |
extract data only (preview) |
POST |
/receipts/save |
save structured receipt JSON |
POST |
/receipts/telegram_upload |
OCR + LLM extract → save via Telegram bot |
POST |
/query/ask |
NL query → SQLCoder → execute → summary |
git clone https://github.com/your-handle/trackit-ai
d
# ---------- backend ----------
cd trackit-ai/backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload # http://localhost:8000
# ---------- frontend ----------
cd ../frontend
npm install
npm run dev # http://localhost:3000
# ---------- telegram‑bot ----------
cd ../telegram-bot
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python main.py # runs the Telegram bot
backend/.env
GROQ_API_KEY=your_groq_key
GEMINI_API_KEY=your_gemini_key
SUPABASE_URL=https://xyz.supabase.co
SUPABASE_KEY=service_role_or_anon_key
PW_SALT=random_string
frontend/.env.local
NEXT_PUBLIC_API_URL=http://localhost:8000
telegram-bot/.env
TELEGRAM_BOT_TOKEN=your_bot_token