Finance Tracker
A private, mobile-first ledger that builds itself from bank SMS alerts, reconciles transfers and reversed card holds, and shows how your spending is pacing against the week.
- Period
- 2026 – Present
- Stack
- SvelteKit, Svelte 5, TypeScript, Supabase, PostgreSQL, Tailwind CSS, Gemini, Vitest, PWA, Vercel
SMS · bank alert
LKR 2,450.00 debited from card ending 4821 at KEELLS SUPER.↓ parsed · deduplicated · reconciled
Daily allowance left: LKR 1,700
I've tried a few finance trackers before, but most were bloated with features I didn't need, and I kept losing the habit of tracking within a few weeks each time. The fix here was automation: my bank's SMS notifications get caught by iPhone Shortcuts automations and pushed to a self-hosted webhook, so transactions get logged securely without me touching anything. No manual entry, no habit to maintain, I just log in later and see where the money went.
From SMS to Ledger
An iOS Shortcut forwards each alert to an authenticated SvelteKit webhook, and a bulk importer handles historical messages through the same path. Every message is stored untouched in a raw_messages table and deduplicated with a SHA-256 content hash, so retried or re-imported alerts never double-count. Because the original text is kept next to the normalised transaction, any number on the dashboard can be traced back to the message that produced it. Each bulk import carries a session ID, so a bad batch can be rolled back cleanly.
Parsing, With AI as a Fallback
Bank messages differ by institution and event type, and many carry forwarding junk or several alerts glued together. Parsing uses a strategy-pattern registry: each format (card debit, decline, transfer, ATM withdrawal, reversal, fee, interest, for HNB and NSB) is its own strategy, checked in priority order so specific events like declines win over generic purchases. Supporting a new bank means adding a strategy, not touching storage, reconciliation or analytics.
When a message won't parse, Gemini cleans it up and splits concatenated alerts, and the result goes back through the same parsers. Known formats skip the model entirely. The part I'm proudest of is a numerical sanity check: before accepting AI output, the app compares every number in the cleaned text with the original, and if the model introduced or changed an amount, balance or account number, the result is rejected and a local cleaner takes over. A model that tidies formatting is fine; one that invents money is not.
Reconciliation
The hard problem is deciding what a set of alerts actually means:
- Internal transfers appear as an outflow in one account and an inflow in another. Matching amounts within 120 seconds are paired and neutralised, so moving money between my own accounts counts as neither spending nor income.
- Authorization holds are placed on a card and later released. A reversal arriving within 72 hours voids the original, and unresolved pending holds are promoted to confirmed after a set period.
- Unusually large transactions are flagged and kept out of weekly spending analysis so they don't distort it.
Every automated match is recorded in a reconciliations audit table with a confidence value and a note, so the system explains itself. Foreign-currency purchases are converted using the actual balance change when it's available, falling back to historical rates, with sanity bounds that reject implausible exchange rates.
Insights Over Totals
The dashboard is built to be read at a glance: liquid cash, invested assets and liabilities are kept separate, since a single net-worth figure hides how much money is actually spendable. The main view shows weekly burn against budget and the daily allowance remaining, with days and weeks calculated in Asia/Colombo time so late-night alerts land on the right day. Analytics views surface what plain totals hide: ATM fees as a "friction tax", declined-transaction history, category trends and money moved into investments.
Testing and Limits
Correctness lives at the domain boundaries, so the Vitest suites cover parsers, reconciliation, currency conversion, importing, analytics and the AI sanitiser, including numerical-hallucination rejection and API-failure fallback.
It's a private tool, not a product. Parser coverage is limited to the bank formats I receive, fallback exchange rates are approximations of the bank's real settlement rate, and the schema assumes a single user. Opening it to others would need per-user ownership and stricter row-level policies.