How cneuralnetwork/kharcha works
Kharcha is a private spending ledger: users add entries manually or import bank SMS, review parsed transactions, and use the ledger for budgets and insights. On Android, allowlisted inbox messages pass through the native reader and on-device parser; pasted messages use the same parsing flow. The app stores data locally and offers optional encrypted backup to a small API that stores ciphertext in Postgres. The graph reflects README-described flows and SOURCE INDEX references; some screen-level wiring is not shown in the sampled source.
Main entry points: LedgerProvider.tsx Ledger state · app App screens · sms.ts SMS ingestion · backup.ts Backup encryption
Components 19
Entry capture
- App screens
mobile/src/app - Android SMS reader
mobile/modules/kharcha-sms/android/src/main/java/dev/kharcha/sms/KharchaSmsModule.kt - SMS module bridge
mobile/modules/kharcha-sms/src/KharchaSmsModule.ts - SMS ingestion
mobile/src/lib/sms.ts - SMS parser
mobile/src/lib/parser.ts - Manual entry
mobile/src/app/manual.tsx - Paste and review
mobile/src/app/import.tsx
Ledger and views
- Ledger state
mobile/src/state/LedgerProvider.tsx - Ledger model
mobile/src/lib/model.ts - Local ledger storage
mobile/src/lib/database.ts - Browser ledger storage
mobile/src/lib/database.web.ts - Budgets and insights
mobile/src/app/(tabs)
Encrypted backup
- Backup controls
mobile/src/app/backup.tsx - Backup encryption
mobile/src/lib/backup.ts
Backup service
- Backup API
api/src/app.ts - Postgres store
api/src/store.ts - Postgres database
- API startup
api/src/index.ts
Other components
- Ledger user
Connections 23
- Ledger user → App screens: uses
README.md - App screens → Manual entry: adds entries
README.md - App screens → Paste and review: pastes messages
README.md - App screens → SMS ingestion: starts SMS scan
README.md - SMS ingestion → SMS module bridge: requests messages
mobile/src/lib/sms.ts - SMS module bridge → Android SMS reader: calls native reader
README.md - SMS ingestion → SMS parser: parses messages
mobile/src/lib/sms.ts - Paste and review → SMS parser: parses pasted text
README.md - SMS parser → Ledger state: offers parsed entry
README.md - Manual entry → Ledger state: submits entry
README.md - Ledger state → Local ledger storage: updates ledger
- Ledger state → Browser ledger storage: uses browser storage
README.md - Local ledger storage → Ledger model: uses types
mobile/src/lib/database.ts - Browser ledger storage → Ledger model: uses types
mobile/src/lib/database.web.ts - Ledger state → Budgets and insights: serves ledger data
- Ledger user → Backup controls: opts into backup
README.md - Backup controls → Backup encryption: backs up or restores
README.md - Backup encryption → Local ledger storage: exports snapshot
mobile/src/lib/backup.ts - Backup encryption → Backup API: sends ciphertext
README.md - API startup → Backup API: configures routes
api/src/index.ts - API startup → Postgres store: initializes store
api/src/index.ts - Backup API → Postgres store: reads and writes
api/src/app.ts - Postgres store → Postgres database: queries
api/src/store.ts