How shwet46/vyom-app works
VYOM is an AI business partner for small-shop merchants. Merchants use the web app to review sales opportunities, manage campaigns and credit, and use voice or camera workflows; the backend applies detection and safety rules, invokes AI where useful, and persists domain data. A Telegram bot provides customer-facing credit and festival-shop interactions, while background jobs refresh detections and dispatch work. The README documents these major connections; sampled source confirms selected entry points and handlers, but unsampled route and service internals limit finer call-level detail.
Main entry points: v1 REST API · app.py Telegram bot · App.tsx Merchant PWA · api.ts API client
Components 22
Merchant app
- Merchant PWA
apps/web/src/App.tsx - API client
apps/web/src/services/api.ts - Voice copilot UI
apps/web/src/components/VoiceAssistantModal.tsx - Khata scanner UI
apps/web/src/components/KhataScannerModal.tsx
Backend services
- REST API
apps/api/src/vyom/api/v1 - Application runtime
apps/api/src/vyom/main.py - Live events
apps/api/src/vyom/core/sse.py - AI capabilities
apps/api/src/vyom/ai - Safety guardrails
apps/api/src/vyom/services/guardrails.py - Background jobs
apps/api/src/vyom/worker/jobs.py
Business intelligence
- Opportunity detection
apps/api/src/vyom/services/detection - Proactive engine
apps/api/src/vyom/services/proactive_detection/engine.py - Festival intelligence
apps/api/src/vyom/services/festival - Campaign dispatch
apps/api/src/vyom/services/campaign_dispatch.py
Customer channels
- Telegram bot
apps/api/src/vyom/bot/app.py - Bot credit flows
apps/api/src/vyom/bot/handlers/khata.py - Bot shop flows
apps/api/src/vyom/bot/handlers/catalog.py
Platform services
- MongoDB
apps/api/src/vyom/db
Other components
- Merchant
- Shop customer
- Sarvam AI
- Telegram
Connections 29
- Merchant → Merchant PWA: uses
- Merchant PWA → API client: requests data
apps/web/src/App.tsx - Merchant PWA → Voice copilot UI: opens copilot
apps/web/src/App.tsx - Merchant PWA → Khata scanner UI: opens scanner
apps/web/src/App.tsx - Voice copilot UI → API client: sends voice
apps/web/src/services/api.ts - Khata scanner UI → API client: uploads scans
apps/web/src/services/api.ts - API client → REST API: calls REST
- Application runtime → REST API: mounts routes
apps/api/src/vyom/main.py - REST API → Opportunity detection: requests detection
- REST API → Proactive engine: requests analysis
- REST API → Safety guardrails: checks actions
- REST API → AI capabilities: invokes AI
- REST API → MongoDB: reads and writes
- REST API → Live events: publishes events
apps/api/src/vyom/api/v1/webhooks.py - AI capabilities → Sarvam AI: calls AI models
- Background jobs → Opportunity detection: runs sweeps
apps/api/src/vyom/worker/jobs.py - Background jobs → MongoDB: updates state
- Background jobs → Campaign dispatch: dispatches campaigns
apps/api/src/vyom/worker/jobs.py - Campaign dispatch → Safety guardrails: validates sends
- Campaign dispatch → Telegram bot: dispatches messages
apps/api/src/vyom/services/campaign_dispatch.py - Telegram bot → Bot credit flows: registers handler
apps/api/src/vyom/bot/app.py - Telegram bot → Bot shop flows: registers handler
apps/api/src/vyom/bot/app.py - Shop customer → Telegram: messages
- Telegram → Telegram bot: routes updates
- Bot credit flows → MongoDB: reads and writes ledger
apps/api/src/vyom/bot/handlers/khata.py - Bot credit flows → AI capabilities: requests OCR
apps/api/src/vyom/bot/handlers/khata.py - Bot shop flows → Festival intelligence: offers festival kits
- Festival intelligence → Opportunity detection: informs opportunities
- Telegram bot → Live events: broadcasts events