Building Kharcha: India's Zero-Friction UPI Expense Tracker
Managing personal finances in India's UPI-first economy is unique. We make dozens of micro-transactions daily—from the local chai tapri to Swiggy orders. Logging these manually in traditional expense trackers is tedious and friction-heavy.
That's why I built Kharcha: a native Android expense tracker purpose-built for India's UPI ecosystem.
The Problem with Existing Trackers
Most expense trackers require you to manually open the app and log every transaction. Some attempt to automate this using AI, which often leads to miscategorized expenses, hallucinations, and privacy concerns because your financial data is being sent to third-party LLM providers.
I wanted something different:
- Zero Manual Entry: It should automatically capture payments from GPay, PhonePe, Paytm, or CRED.
- Zero AI: The categorization should be 100% deterministic and rule-based.
- Absolute Data Ownership: It must be an offline-first app where data lives on the device, not strictly in the cloud.
How Kharcha Works
Automated UPI & SMS Capture
Kharcha reads push notifications and SMS banking alerts in real-time. To prevent double-counting (which is a notorious issue when you receive both a notification and an SMS for the same transaction), I implemented a smart deduplication system with a ±2 minute window.
Smart Spam Filter
Your SMS inbox is full of OTPs, recharge prompts, and loan ads. Kharcha silently ignores these before they even hit the parser, ensuring that your ledger is clean and accurate.
Ground-Truth Wallet Sync
Extracted SMS balances act as ground-truth checkpoints. If there's a discrepancy, Kharcha silently corrects your local wallet ledgers to match the actual bank balance.
Rules Engine
Instead of relying on an LLM to guess what "Swiggy" means, Kharcha uses a transparent rules engine. Swiggy → Food, Uber → Travel. You can add custom regex-based rules to auto-sort your niche merchants.
The Tech Stack
I chose a stack that prioritizes local performance and reliability:
- Framework: Flutter (Android 12+, minSdk 32)
- State & UI: Riverpod, go_router, Material 3, fl_chart
- Local DB: Drift (SQLite) — The definitive Source of Truth
- Cloud / Sync: Supabase (Postgres, Google Auth)
- Native Plugins:
flutter_local_notifications,local_auth
By utilizing Drift for local storage and Supabase strictly as a silent background sync target, Kharcha achieves true offline-first capability. Even if you're entirely offline, the app functions flawlessly. I also moved heavy chart calculations (like merchant rankings and GitHub-style heatmaps) into native SQLite aggregations to eliminate OOM crashes and keep the UI butter-smooth.
The Experience
I wanted Kharcha to feel native and personal. It features:
- Hinglish Daily Summaries: Localized 9PM daily check-ins ("Aaj ₹540 kharcha hue") and Sunday weekly recaps.
- GitHub-Style Heatmaps: To help you visualize your spending intensity visually.
- Privacy-First Export: You can export your database to CSV or JSON with merchant PII auto-hashed for safe spreadsheet analysis.
- Biometric App Lock: Fingerprint or PIN protection ensures your financial data stays private.
Check it out
Kharcha is available for Android (arm64). You can check out the website or grab the latest APK directly from the GitHub Releases page.
Building Kharcha has been a fantastic journey in Android systems programming, local-first architecture, and creating user-centric mobile applications. If you're tired of manually logging your UPI expenses, give it a spin!
More Essays
Building c2proof: C to Rust Migration with Verification
A verifier-first c2rust wrapper. Give it a flat C repo, and it outputs a compiling Rust port PR alongside a mathematical proof artifact.
systemsBuilding code2paper: Turn Any Codebase into an Academic Paper
A stdlib Python CLI and Claude Agent Skill to convert an entire codebase into a readable academic paper in Typst, LaTeX, PDF, and HTML.
systemsBuilding neet-cbt - Replicating the NTA Exam Interface, Offline
22 lakh students sit NEET every year. In 2027 it goes computer-based. I built the exact NTA interface as a free offline PWA so nobody practises it cold.