How asimansari-git/billprods-ai works
BillProds AI is a bill and product tracker with receipt scanning and a financial assistant. The primary workflow is: a user submits receipt files through the PWA, the frontend sends them to the API for AI processing, and bills and extracted products are stored for later viewing and analysis. Separate capabilities cover authentication, categories, notifications, subscriptions, and backup import/export. The graph follows sampled calls and documented architecture; several backend router-to-service links and unsampled feature internals are not shown because their wiring could not be verified.
Main entry points: routers API routers · database.py Database session · App.tsx App shell · apiService.ts API client
Components 24
PWA client
- App shell
frontend/App.tsx - Main views
frontend/views - Auth context
frontend/contexts/AuthContext.tsx - Receipt intake
frontend/components/AddBillModal.tsx - Share target
frontend/hooks/useShareTarget.ts - PWA worker
frontend/public/service-worker.js - API client
frontend/services/apiService.ts - Category editor
frontend/components/CategoryManagerModal.tsx - Notification poller
frontend/components/NotificationPoller.tsx
Backend API
- FastAPI app
backend/app/main.py - API routers
backend/app/routers
Domain services
- Authentication
backend/app/services/auth_service.py - Bill operations
backend/app/services/bill_service.py - AI processing
backend/app/services/ai_service.py - Product management
backend/app/services/product_service.py - Category rules
backend/app/services/category_service.py - Assistant tools
backend/app/services/chat_tools - Subscriptions
backend/app/services/billing_service.py
Persistence and integrations
- Domain models
backend/app/models - Database session
backend/app/core/database.py - PostgreSQL
- Email service
backend/app/services/email_service.py
Other components
- User
- Google Gemini
Connections 30
- User → App shell: uses
- App shell → Auth context: checks session
- App shell → Main views: renders
- App shell → Receipt intake: opens intake
- User → PWA worker: shares files
- PWA worker → Share target: signals and caches
- Share target → App shell: delivers files
- Receipt intake → API client: submits scans
- Main views → API client: requests data
- Category editor → API client: updates categories
- Notification poller → API client: polls notices
- API client → FastAPI app: sends requests
- FastAPI app → API routers: dispatches
- API routers → Authentication: authentication
- API routers → Bill operations: bill operations
- API routers → AI processing: scan requests
- API routers → Product management: product requests
- API routers → Category rules: category requests
- API routers → Assistant tools: assistant requests
- API routers → Subscriptions: subscription requests
- Bill operations → Database session: queries and writes
- Database session → PostgreSQL: persists
- Bill operations → Domain models: uses entities
- Authentication → Domain models: reads and writes
- Authentication → Email service: sends verification
- AI processing → Google Gemini: extracts receipt data
- Product management → Database session: manages products
- Category rules → Database session: stores rules
- Assistant tools → Database session: accesses user data
- Subscriptions → Database session: updates subscription