How joydeepdas-01/bahikhata works
BahiKhata is an offline-first customer credit-ledger app for shop owners, available on web and Android. The main workflow is adding customers (individually or in bulk), tracking outstanding and paid balances, then preparing multilingual payment reminders that open in WhatsApp. Settings also provide appearance and reminder preferences, CSV backup/import, and safe local-data reset. The graph reflects documented capabilities where source excerpts are unavailable; those subsystem links are omitted when their wiring is not established by the sampled code.
Main entry points: App.tsx App shell · WhatsAppPreview.tsx Reminder composer · useCustomers.ts Ledger state · SettingsModal.tsx Settings panel
Components 21
App workflow
- App shell
src/App.tsx - Customer screens
src/components/CustomerList.tsx - Customer form
src/components/CustomerForm.tsx - Bulk add sheet
src/components/BulkPasteSheet.tsx
Ledger and storage
- Ledger state
src/hooks/useCustomers.ts - Customer model
src/domain/customer.ts - Due-date logic
src/domain/dateClassifier.ts - Customer repository
src/infrastructure/CustomerRepository.ts - IndexedDB ledger
Reminder workflow
- Reminder composer
src/components/WhatsAppPreview.tsx - Message templates
src/domain/templates.ts - Currency formatting
src/domain/amountFormatter.ts
Settings and import
- Settings panel
src/components/SettingsModal.tsx - Display preferences
src/context/DisplaySettingsContext.tsx - Browser local storage
- CSV import/export
src/domain/csvHelper.ts - TSV parsing
src/domain/tsvHelper.ts
Runtime platforms
- Android bridge
android/app/src/main/java/com/bahikhata/app/MainActivity.java - Capacitor app API
Other components
- Shop owner
Connections 28
- Shop owner → App shell: uses
- App shell → Ledger state: loads ledger state
- App shell → Customer screens: renders
- App shell → Customer form: opens form
- App shell → Bulk add sheet: opens bulk add
- App shell → Settings panel: opens settings
- App shell → Reminder composer: opens composer
- Ledger state → Customer repository: reads and writes
- Customer repository → IndexedDB ledger: reads and writes
- Ledger state → Customer model: uses types
- Ledger state → Due-date logic: classifies due dates
- Customer screens → App shell: invokes ledger actions
- Customer form → App shell: submits customer
- Bulk add sheet → App shell: submits customers
- App shell → Ledger state: updates reminder time
- Reminder composer → Message templates: parses message
- Reminder composer → Currency formatting: formats amount
- Reminder composer → Due-date logic: formats due date
- Reminder composer → Display preferences: reads reminder settings
- Reminder composer → WhatsApp: opens message link
- Settings panel → Ledger state: imports and clears data
- Settings panel → CSV import/export: imports and exports CSV
- Settings panel → Message templates: previews templates
- Settings panel → Display preferences: updates preferences
- Display preferences → Browser local storage: persists preferences
- Bulk add sheet → TSV parsing: parses pasted rows
- App shell → Capacitor app API: handles native back
- Capacitor app API → Android bridge: uses bridge