Overview & Problem Statement
In Kenya, M-Pesa is the primary medium for personal and commercial financial transactions. However, tracking cash flow traditionally requires either manual record-keeping or connecting to third-party fintech applications that upload personal SMS records and financial statements to remote cloud servers.
This model poses acute privacy and security risks. GanjiPal was engineered under a strict zero-leak mandate: a personal financial tool that provides automated expense aggregation, budget warnings, and cash flow analysis while remaining 100% on-device, with zero cloud telemetry and zero internet access permissions.
Key Implemented Features
- Automated Receipt Parsing: Ingests M-Pesa SMS confirmation receipts, accurately separating transaction fees from principal amounts across PayBill, Buy Goods, P2P Transfers, and Cash Withdrawals.
- Integer Minor Units Math: All calculations execute with integers (100 cents = 1 KES), completely eliminating IEEE-754 floating-point rounding drift across running balances and budget forecasts.
-
Airgapped Privacy Guarantee: The Android manifest omits
android.permission.INTERNET, ensuring personal financial receipts can never leave the physical device. -
Deterministic SHA-256 Deduplication: Prevents duplicate records across multiple import passes by fingerprinting transactions using official confirmation codes or composite hashes backed by SQLite
UNIQUEconstraints. -
Protected Data Portability: Generates RFC 4180 CSV exports shielded against formula injection (sanitizing
=,+,-,@) and encrypted local JSON backups.
My Work & Engineering Contributions
I designed and developed the entire GanjiPal Android application and core domain parser:
- Executive Mobile Product Design: Engineered the complete Flutter design system with a warm ivory and deep forest green palette, featuring frosted hero balances, period cash-flow toggles (Today / Week / Month), and animated spending donut breakdowns.
-
Core Domain Parser: Authored the independent
pesatrack_corepure Dart package, implementing strategy pattern regex parsers for Kenyan mobile money formats. -
Native Telephony Bridge: Wrote the Android Kotlin
BroadcastReceiverandTelephonyProvidercursor bridge communicating across a typedMethodChannel. - Offline Persistence Layer: Engineered the SQLite database helper, indexing transactions, categories, and monthly budget limits with ACID compliance.
-
Mobile User Interface: Built the responsive Flutter UI utilizing Material 3, custom spending curves, and interactive category analytics with
fl_chart.
Technical Implementation & Architecture
The project is structured according to Clean Architecture principles, ensuring domain business logic remains fully decoupled from UI frameworks:
-
Pure Dart Domain Layer:
pesatrack_corecontains no Flutter or Android dependencies, allowing comprehensive unit test coverage with fast execution. - Repository Pattern: Abstract repositories manage data transactions between SQLite (sqflite) and UI presentation states.
- Batch Telephony Processing: Historical inbox imports process in chunked cursor batches, preventing UI thread jank or out-of-memory errors on devices with thousands of messages.
Engineering Challenges & Solutions
-
Challenge: Transaction Variation in SMS Formats: Safaricom M-Pesa receipts differ significantly between PayBill, Till numbers, reversals, and agent withdrawals.
Solution: Developed a strategy pattern parser evaluating regex patterns in priority sequence, with a continuous regression test suite verifying real transaction receipts. -
Challenge: Formula Injection in Financial Exports: Exporting raw transaction names (e.g.
=cmd|' /C calc'!A0) into CSV files could trigger remote code execution when opened in spreadsheet software.
Solution: Implemented RFC 4180 sanitization that prefixes unsafe leading formula characters with an apostrophe ('), neutralizing execution threats.