Zero-effort, automated personal finance and UPI tracking tailored for Indian digital payments.
Interception of SMS and push notifications from PhonePe, Google Pay, Paytm, and Indian banks (UCO, SBI, HDFC, ICICI, etc.) with real-time cloud synchronization, intelligent cross-source deduplication, and an interactive financial dashboard.
Explore Features • Architecture • Tech Stack • Quick Start • Android App • API Docs
Overview
Traditional expense managers demand manual typing after every coffee, commute, or grocery bill. Spendly automates this entirely:
- You tap and pay via PhonePe, Google Pay, Paytm, or NetBanking.
- Spendly's native Android service intercepts the incoming SMS or payment notification in the background (even if the app is closed).
- The built-in heuristic parser extracts the amount, transaction type (debit/credit), vendor/merchant, and available balance.
- Intelligent deduplication prevents double-counting when both push notifications and bank SMS arrive for the same payment.
- Real-time metrics and dynamic visualizations update automatically across your mobile app and desktop dashboard.
- SMS BroadcastReceiver (
SmsReceiver.java): Catches debit and credit alerts from Indian banks (SBI, HDFC, ICICI, UCO, Axis, PNB, etc.) instantly upon arrival. - Push Notification Listener (
PaymentNotificationListener.java): Catches real-time payment notifications from PhonePe, Google Pay, and Paytm even if bank SMS alerts are delayed or absent. - Historical Device SMS Sync: One-tap native sync reads previous financial messages from your device inbox and populates your historical expenditure timeline.
- Cross-Source 10-Minute Window: Prevents duplicate records when an app notification and a bank SMS arrive for the same purchase.
- Credit vs. Debit Classification: Distinguishes incoming P2P transfers (e.g., "Money received: ₹500 from Rahul") as Income, avoiding false expenses.
- Anti-Spam & Marketing Filter: Automatically rejects cashback promos, lottery alerts, coupon ads, and recharge spam.
- Cryptographic Hashing: Unique payload hashes ensure safe batch ingestion and database integrity.
- 100% Real Database Analytics: Every figure, chart, and breakdown is calculated live from MongoDB Atlas aggregation pipelines.
- Dynamic Metric Cards: Track Total Expenses, Total Income, Daily Average Spend, and Gateway-specific volumes.
- Horizontally Scrollable Cashflow Chart: Mobile-responsive bar chart showing monthly trends with auto-scroll to the current month and hover/tap expense tooltips.
- Dynamic Category Donut: Visual classification across Food & Dining, Shopping, Travel, Bills, Investments, and UPI transfers.
- Spending Calendar Heatmap: Monthly view highlighting high-spend days and net flow pills.
- Fluid Hybrid Web App: Ultra-fast responsive interface built with React 19, Tailwind CSS, and Vite.
- Standalone Android APK: Bundled with Capacitor 6 for native hardware access, runtime permission handling, and persistent background listeners.
- Customizable Profile: Persistent in-app name customization stored locally.
flowchart TD
subgraph MobileDevice["Android Device (Spendly App)"]
A1["Incoming PhonePe / GPay / Paytm Push Notification"] -->|PaymentNotificationListener| B["Native Android Layer"]
A2["Incoming Bank SMS (SBI, HDFC, UCO, etc.)"] -->|SmsReceiver| B
A3["Device SMS Inbox (Bulk Sync)"] -->|Capacitor SMS Plugin| B
A4["Manual Expense / Quick SMS Paste"] -->|React Webview UI| C["Web Client Layer (React 19)"]
B -->|HTTP POST JSON| D["Spendly REST API Client"]
C -->|HTTP POST JSON| D
end
subgraph CloudInfrastructure["Cloud Backend & Storage (Render + Atlas)"]
D -->|Express.js Router| E["transactionController.js"]
E -->|Regex Heuristics & Merchant Parsing| F["Categorization Engine"]
F -->|Time Window & Hash Matching| G["Deduplication Filter"]
G -->|Mongoose ODM| H[("MongoDB Atlas Database")]
H -->|Aggregation Pipelines| I["Analytics Endpoint (/api/analytics)"]
end
subgraph ClientDashboard["Dashboard & Reporting"]
I -->|Live Feed| J["Metric Cards (Expense/Income/Avg)"]
I -->|Monthly Aggregates| K["Spending & Cashflow Chart"]
I -->|Category Shares| L["Category Donut Breakdown"]
I -->|Daily Ledgers| M["Calendar Spend Matrix"]
end
| Layer | Technology | Purpose |
|---|---|---|
| Frontend Framework | React 19 + Vite 8 | High-performance reactive user interface |
| Styling & Assets | Tailwind CSS 3.4 + Lucide Icons | Clean, modern neo-morphic dashboard aesthetic |
| Mobile Runtime | Capacitor 6 | Hybrid web-to-native Android runtime bridge |
| Native Android | Java, Android SDK 34 | BroadcastReceiver, NotificationListenerService |
| Backend API | Node.js + Express 5 | RESTful services, deduplication, and analytics |
| Database | MongoDB Atlas + Mongoose | Cloud document database with indexed transaction models |
| Cloud Hosting | Render | Live API deployment (https://spendly-kokn.onrender.com) |
Expense-Tracker/
├── Spendly.apk # Ready-to-install Android APK (~4MB)
├── Personal_Expenses_Tracker_Guide.docx # Architecture blueprint documentation
├── README.md # Project documentation
├── package.json # Workspace management
│
├── backend/ # Express.js REST API & Database Service
│ ├── config/
│ │ └── db.js # MongoDB Atlas connection handler
│ ├── controllers/
│ │ └── transactionController.js # Ingestion, parsing, deduplication & analytics
│ ├── models/
│ │ └── Transaction.js # Mongoose schema with unique indexes
│ ├── routes/
│ │ └── transactionRoutes.js # REST endpoints definition
│ ├── .env.example # Environment template
│ ├── package.json # Backend dependencies
│ └── server.js # Express entrypoint & healthcheck server
│
└── frontend/ # React 19 + Tailwind CSS + Capacitor Android
├── android/ # Native Android Studio Gradle project
│ └── app/src/main/
│ ├── AndroidManifest.xml # Android permissions & service registrations
│ └── java/.../expensetracker/
│ ├── MainActivity.java # Capacitor bridge & runtime permission requests
│ ├── SmsReceiver.java # Background SMS broadcast listener
│ └── PaymentNotificationListener.java # Background notification listener
├── src/
│ ├── components/
│ │ ├── AddExpenseModal.jsx # Manual transaction entry dialog
│ │ ├── CalendarCard.jsx # Interactive monthly calendar with daily metrics
│ │ ├── CategoryDonut.jsx # Category distribution donut chart
│ │ ├── Header.jsx # User profile, quick actions & sync buttons
│ │ ├── MetricCards.jsx # Top overview KPI cards (Expense, Income, etc.)
│ │ ├── MobileNav.jsx # Bottom tab bar for mobile viewports
│ │ ├── Sidebar.jsx # Collapsible desktop sidebar
│ │ ├── SmsSyncModal.jsx # SMS inbox sync & parser tester modal
│ │ ├── SpendingChart.jsx # Dynamic horizontally scrollable cashflow chart
│ │ └── TransactionList.jsx # Filterable live transaction ledger
│ ├── services/
│ │ ├── api.js # Axios/fetch client for backend API
│ │ ├── parser.js # Indian banking & UPI regex parsing engine
│ │ └── smsService.js # Capacitor native SMS reader interface
│ ├── App.jsx # Root application component & global state
│ └── main.jsx # React DOM entrypoint
├── capacitor.config.json # Capacitor app identifier & asset configuration
├── tailwind.config.js # Tailored color palette & theme extensions
└── vite.config.js # Vite bundler & reverse proxy configuration
- Node.js:
v18.0.0or higher - npm:
v9.0.0or higher - MongoDB Atlas account (or local MongoDB daemon)
- (Optional for Android build): Android Studio (JBR 17+) and Android SDK 34
# Navigate to the backend directory
cd backend
# Install dependencies
npm install
# Configure environment variables
cp .env.example .envEdit backend/.env with your configuration:
PORT=5000
MONGODB_URI=your_mongodb_connection_stringStart the backend server:
npm startThe server will boot at http://localhost:5000.
# In a new terminal, navigate to frontend
cd frontend
# Install dependencies
npm installConfigure frontend/.env:
# Point to local server for development:
VITE_API_URL=http://localhost:5000/api
Run the local Vite dev server:
npm run devOpen http://localhost:5173 in your browser.
Spendly includes a pre-built APK ready for immediate deployment. Connect your Android phone with USB Debugging enabled:
adb install -r Spendly.apkcd frontend
# 1. Build the production web bundle
npm run build
# 2. Sync web assets with the native Android project
npx cap sync
# 3. Compile the debug APK using Gradle wrapper
cd android
.\gradlew.bat assembleDebugThe compiled APK will be generated at:
frontend/android/app/build/outputs/apk/debug/app-debug.apk
cd frontend
npx cap open androidOnce Android Studio opens, select your physical device or emulator and click Run (▶).
For uninterrupted background tracking:
- SMS Permission: On first launch, grant permission to read SMS messages.
- Notification Access: Enable Notification Access for Spendly in Android Settings (
Settings -> Apps -> Special App Access -> Notification Access). This activatesPaymentNotificationListener. - Battery Optimization: On OEM skins (MIUI, ColorOS, OxygenOS, OneUI), set Spendly's battery policy to "Unrestricted / Don't optimize" to prevent the OS from killing background broadcast receivers.
Transactions are managed through Mongoose (backend/models/Transaction.js):
{
amount: { type: Number, required: true },
type: { type: String, enum: ['expense', 'income'], required: true },
category: {
type: String,
enum: [
'Food & Dining', 'Shopping & Retail', 'Transportation',
'Bills & Utilities', 'Entertainment', 'Health & Medical',
'Saving & Investment', 'Salary & Income', 'UPI & Bank Transfer',
'Other Payment'
],
default: 'Other Payment'
},
date: { type: Date, default: Date.now },
source: { type: String, enum: ['sms', 'notification', 'manual'], default: 'manual' },
sender: { type: String, trim: true },
description: { type: String, trim: true },
hash: { type: String, unique: true, index: true }
}| Method | Endpoint | Description | Sample Payload / Params |
|---|---|---|---|
GET |
/ |
API status landing page | — |
GET |
/api/health |
Server and database health check | — |
GET |
/api/transactions |
Fetch all transactions ordered by date descending | ?limit=50 |
POST |
/api/transactions |
Ingest single transaction with auto-deduplication | { amount: 250, type: "expense", category: "Food & Dining", sender: "PhonePe" } |
POST |
/api/transactions/batch |
Bulk insert transactions from device sync | [ { amount: 120, ... }, { amount: 450, ... } ] |
DELETE |
/api/transactions/:id |
Delete a specific transaction by ID | — |
DELETE |
/api/transactions |
Flush all transactions | — |
GET |
/api/analytics |
Aggregated metrics, cashflow breakdown, and category shares | — |
POST |
/api/transactions/cleanup |
Execute deduplication scan and spam purge | — |
Spendly's rule engine supports all major Indian payment ecosystems:
- Banks: State Bank of India (SBI), HDFC Bank, ICICI Bank, UCO Bank, Axis Bank, Bank of Baroda (BOB), Punjab National Bank (PNB), Canara Bank, Kotak Mahindra.
- UPI Apps: PhonePe (
com.phonepe.app), Google Pay (com.google.android.apps.nbu.paisa.user), Paytm (net.one97.paytm). - Currency Tokens:
₹,Rs.,Rs,INR(handles comma separations and float values). - Date Patterns:
DD-MM-YYYY,DD/MM/YYYY,DD-Mon-YYYY,YYYY-MM-DD. - Balance Extraction: Extracts remaining balance strings (
Avl Bal Rs.XX.XX) when provided by the bank.
- Background SMS & notification interception
- Intelligent 10-minute cross-source deduplication
- Real-time analytics dashboard & horizontal cashflow chart
- Native Android packaging via Capacitor
- Multi-account user authentication (JWT / OAuth2)
- Category-based monthly budget limits with push warning alerts
- CSV / PDF export for tax and financial reports
- Lightweight on-device ML model for instant unrecognized merchant classification
This project is licensed under the MIT License. You are free to modify, distribute, and utilize it for personal or commercial projects.