Skip to content

wegrotech/pack-n-trace

 
 

Repository files navigation

Pack-n-Trace

Inventory app with:

  • React/Vite frontend
  • Supabase database
  • Python-only Telegram bot integration

Frontend

npm install
npm run dev

Python Telegram Bot

Telegram integration is implemented only in python/telegram_bot.

Run locally

cd python/telegram_bot
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 8000 --reload

Environment variables (Python service)

  • SUPABASE_URL
  • SUPABASE_SERVICE_ROLE_KEY
  • TELEGRAM_BOT_TOKEN
  • TELEGRAM_WEBHOOK_SECRET
  • SUPABASE_EVENT_SECRET

Supabase trigger callback migration

Apply:

  • supabase/migrations/20260217_telegram_bot_setup.sql
  • supabase/migrations/20260218_telegram_event_triggers.sql

Set DB settings used by trigger callbacks:

alter database postgres set "app.settings.python_webhook_url" = 'https://<your-python-host>';
alter database postgres set "app.settings.supabase_event_secret" = '<shared-secret>';

Telegram webhook

Set webhook to Python endpoint:

curl -X POST "https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook" \
  -H "Content-Type: application/json" \
  -d "{\"url\":\"https://<your-python-host>/telegram/webhook\",\"secret_token\":\"<TELEGRAM_WEBHOOK_SECRET>\"}"

Removed TypeScript Telegram Endpoints

These no longer exist:

  • POST /api/telegram-webhook
  • POST /api/telegram-notify?action=*

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 95.0%
  • TypeScript 4.1%
  • PowerShell 0.5%
  • PLpgSQL 0.3%
  • CSS 0.1%
  • Batchfile 0.0%