How covaimetertaxi-byte/cmt-vendor-portal works
This is a taxi-vendor portal for vendor access, ride dispatch, invoice creation, and company setup. The main workflow is vendor sign-in, entering a passenger number and choosing an immediate or scheduled dispatch, then optionally creating a bill from pasted ride text or manually. Billing supports preview, PDF download, and WhatsApp sharing; settings store company details locally. Source excerpts establish the billing parser, Firebase-backed vendor checks, and local profile storage. Some App wiring and unsampled views are only represented where the tree and sampled usage support them.
Main entry points: App.tsx Portal shell · vendorAuth.ts Session validation · BillingView.tsx Invoice editor · LoginView.tsx Vendor sign-in
Components 19
Vendor access
- Vendor sign-in
src/components/LoginView.tsx - Session validation
src/services/vendorAuth.ts - Firebase setup
src/config/firebase.ts - Firestore vendors
Ride dispatch
- Portal shell
src/App.tsx - Ride details
src/App.tsx - Dispatch feedback
src/App.tsx - SMS / WhatsApp
Billing
- Invoice editor
src/components/BillingView.tsx - Receipt parser
src/utils/textParser.ts - Invoice data
src/types/billing.ts - PDF export
src/components/BillingView.tsx
Company and offline
- Company settings
src/components/SettingsView.tsx - Profile storage
src/utils/storage.ts - Browser storage
- Offline indicator
src/components/OfflineIndicator.tsx - Offline cache worker
public/sw.js
Other components
- Vendor
- Browser
Connections 20
- Vendor → Portal shell: uses
- Portal shell → Vendor sign-in: shows
- Vendor sign-in → Session validation: checks credentials
- Portal shell → Session validation: checks session
- Portal shell → Session validation: logs out
- Session validation → Firebase setup: gets database
- Session validation → Firestore vendors: reads / updates
- Portal shell → Ride details: renders
- Ride details → Dispatch feedback: updates
- Ride details → SMS / WhatsApp: opens dispatch
- Portal shell → Invoice editor: shows billing
- Invoice editor → Receipt parser: parses pasted text
- Invoice editor → Invoice data: edits
- Invoice editor → PDF export: generates export
- Portal shell → Company settings: shows settings
- Company settings → Profile storage: saves profile
- Profile storage → Browser storage: reads / writes
- Browser → Offline cache worker: intercepts requests
- Offline cache worker → Browser: serves cached response
- Portal shell → Offline indicator: renders status