A personal spending tracker that reads the bank's notification emails and turns them into a dashboard its owner can trust.

Live and in daily use by one person. Private, so there is no public link.

Walkthrough · VideoOne row is re-tagged and the month tells the truth, then a tour of everything built around it

Project facts

Role
Owner, product designer and builder, working alone with Claude as a partner
Timeline
July to October 2026, still in daily use
Built with
  • Cowork
  • Claude Code
Stack
  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • Vercel Edge
  • GitHub Actions
  • GitHub API via Octokit
  • IMAP via imapflow
  • JSONL in Git
  • Resend
  • Yahoo Finance
  • CoinGecko
AI inside
  • Claude Opus 5, for the research briefs only
01

Why

The bank sends an email for every card purchase, however small. That is a complete spending log already sitting in the inbox, and as a pile of emails nobody can read it. Rido reads those emails, sorts each purchase into a category and shows spending by day, week, month and year. It is a personal tracker for one person in Indonesia, in Rupiah, with an Indonesian interface.

The brief was one question: how much has been spent this period, on what, and is that normal? The answer had to arrive in under 3 seconds and stay up to date by itself.

Four constraints came with it: no external database, free tiers only, a single user and a private repo. One rule of tone sat above them all: awareness, never guilt.

Hero: the summary screen in a browser window with the same screen on a phone in front, beside the line 'Every rupiah, read straight from the inbox'.
01The month as one number, on a laptop and on a phone
The inbox, measured

Messier Than It Looks

Before any spec was written, the real inbox was analysed. It changed several things that had seemed obvious.

  • 2,487 bank emails from 29 March 2024 to 3 August 2026, including 2,303 charges, 164 reversals and 13 failed transactions. An early count of about 1,900 was wrong, because reading mail by thread undercounted by about 22%.
  • Two email layouts, three amount formats and eight currencies, across three cards.
  • About 38% of card charges are e-wallet top-ups. The email records the top-up, not what the wallet buys later, so counting both double-counts and ignoring both loses the money.
  • Identical charges are real. The owner does make the same purchase twice in a day, so removing duplicates by content would silently delete real spending.

A proof of concept of 139 rows, with 0 parse failures, came before the full extraction.

Journey banner: six steps from a bank email to the corrected month, ending at Rp 7.546.690.
02From a bank email to a number worth trusting, in six steps
02

One Tap, and the Month Tells the Truth

Every picture and film on this page tells one small story, on a demo ledger. It is Tuesday 13 October 2026, 09.41. The month so far reads Rp 12.521.690, which is Rp2,4jt above a normal month. Rp 5.000.000 of that is a brokerage top-up. No rule recognised it, so the app filed it under Lainnya ("other"), in plain sight, instead of guessing a category.

One tap re-tags it as a transfer. The month now reads Rp 7.521.690, Rp2,6jt under a normal month. Then Rp 25.000 of cash, typed in and saved, makes it Rp 7.546.690. Nothing was deleted to get there.

Before and after: the month card at Rp 12.521.690 and at Rp 7.521.690, joined by the one re-tagged row of Rp 5.000.000.
03One re-tagged row is the whole difference between the two months
  1. Open it. Ringkasan, the summary, shows the month as one number, how it compares with a normal month, the categories, a calendar of the month and the latest transactions.
  2. Answer what it asks. When the same merchant charges the same amount twice within minutes, a card raises it as a question: fine, or flag it.
  3. Follow the odd number. Tapping a category opens the explorer already filtered to it.
  4. Correct it once. The detail sheet lists every field the bank sent. A new category is one tap.
  5. See the month move. Back on the summary, the total, the pace and the trend have moved together.
  6. Add what the card never saw. The add button takes an amount, defaults to cash and saves.
  7. Look further. Recurring needs against income, a projection, net worth, a live portfolio, a trading desk, daily habits and the goals they feed.
Correct

Follow the Odd Number, Fix It Once

A suspected double charge is a question, never a verdict. An odd category is a way in: the explorer opens already filtered, the detail sheet shows everything the bank sent, and one tap on a new category corrects the month. Each step of that correction, as stills, is in the Gallery.

04 · VideoFrom the odd category to the corrected month
Triptych: three phones showing the uncategorised row, the category picker and the corrected month.
05It files what it knows, the owner corrects what it could not, and the month reads as it really was
The suspected double charge card: Erafone, Rp 1.249.000, charged twice four minutes apart, with two buttons, Wajar and Tandai. With a little of the page around it.
06A double charge is raised as a question, with two answers
Add

Cash, Typed and Saved

The card never sees cash. The add button takes an amount, defaults to cash and saves, and the month updates.

07 · VideoA cash entry, typed and saved
Beyond the month

A Plan, a Portfolio, Habits and Goals

Around the one number grew a monthly plan that works out what is already paid from the ledger itself, a projection driven by the owner's own assumptions, net worth, a live portfolio with delayed prices labelled as delayed, habits with grace days, goals that can count down as well as up, and a trading desk that researches and records but never trades. Each screen is in the Gallery.

Bento: six tiles for the calendar heat-map, categories, the monthly plan, habits, the trading scorecard and the live portfolio.
08Six features, one calm system
On a phone

The Same Dashboard, Smaller

Phone first for a check on the go, laptop for the longer look. It is the same dashboard on both, responsive.

09 · VideoThe same correction and cash entry, in the phone layout
03

One Repo, Two Writers, No Database

Rido has no server of its own and no database. Free services do the work, and a private Git repo holds every byte of data. Two things write to that repo: a scheduled job that reads the bank's emails, and the app itself when the owner types something. Every write is a commit, and every commit to the main branch rebuilds the site.

Read the map from the top left. The bank emails the owner for every card purchase. Three times a day a GitHub Actions job, a script GitHub runs on its own machines on a timer, opens the mailbox over IMAP, the standard protocol mail apps use to read a mailbox. It parses each new email and commits the rows. The push rebuilds the Next.js app on Vercel. The owner opens the app through a password gate that runs on Vercel's Edge: small servers that answer before the app itself does. Anything typed in the app goes to an API route, which commits to the same repo through the GitHub API.

System map: the bank and the broker email Gmail; a GitHub Actions ingest job reads it over IMAP and commits rows to the private repo; a Claude routine pushes briefs that a merge job validates and commits; every push rebuilds the Next.js app on Vercel, which the owner reaches through an Edge gate and whose API routes commit typed changes back to the repo; market feeds give quotes and Resend sends alerts and the digest.
10Two writers, one store: the mail job and the app both commit to the repo, and every push rebuilds the site
Stack

Why This Stack

Each layer was chosen against an obvious alternative. Running cost: nothing beyond a subscription the owner already had.

LayerChoiceWhy this, and not the obvious alternative
Web appNext.js 16 (App Router), React 19, TypeScriptServer components read the data files directly, so reading a page needs no API call
InterfaceTailwind CSS v4, Lucide icons, charts drawn by handNo chart or component library: a smaller bundle and one visual language
TablesTanStack Table and TanStack VirtualThe explorer holds thousands of rows, and only the visible ones are in the page
URL statenuqsThe period and the projection's assumptions live in the address, so a view is a link
Datesdate-fns, date-fns-tzEvery time is the bank's own WIB time (UTC+7), never the email's arrival time
GateNext 16 proxy.ts on Vercel's EdgeThe one place that guards pages and API routes with a single rule
StoragePlain files in Git: JSONL for logs, JSON for documentsReadable, comparable line by line, versioned and free
Writes, deployedGitHub REST API through OctokitVercel's filesystem is read-only, so a write becomes a commit
SchedulerGitHub Actions, Node 22It has Git, real network access to the mailbox and minutes of runtime
Mail inIMAP through imapflow, with an app passwordThe first transport's OAuth token died every 7 days; an app password does not expire
Mail outResendPlan alerts and the daily research digest, from the Actions
Market dataYahoo Finance, CoinGecko and two free fallbacksAll free, and each has a fallback, because none is reliable alone
AIClaude Opus 5, as scheduled routinesNo cost per run on a subscription already paid for, and it writes research only
Testsvitest, plus source-lint guardsRules that matter fail the build instead of living in comments
HostingVercelFree, and a push is already what every write produces
04

The Repo Is the Database

All data is 20 files and folders in one data/ folder, 5.1 MB in all. The ledger alone holds 2,876 rows as of 20 October 2026. Logs are JSONL, JSON Lines: one record per line, so adding a row means adding a line, and Git shows exactly which line arrived. Only one module, store.ts, reads or writes that folder, so swapping the files for SQLite or Postgres later means changing one file.

Files

One Job per File

FileWhat it holdsWritten by, and how it changes
transactions.jsonlThe ledger: one card purchase, reversal or cash entry per lineThe mail job and the add sheet. Append-only, never edited
category-overrides.jsonThe owner's corrections, row id to categoryThe correction route. Applied when a row is read
duplicate-review.jsonThe owner's answer on each suspected double chargeThe duplicate route
merchant-rules.jsonMerchant patterns and the category each one meansBy hand. Applied when a row is read, so a fixed rule fixes history
categories.jsonThe taxonomy: 10 spending categories and 3 system onesBy hand. Fixed
meta.jsonThe sync watermark, settings, fallback exchange ratesThe mail job and the settings route. Shared, so the route reads before it writes
accounts.json, budget.jsonBalances the owner types, and the monthly planTheir routes. The whole document is replaced
holdings.json, trading.jsonPositions (never a value), watchlist, plans, journalTheir routes and the broker's emails. Fills dedupe on the broker's order number
habits.json, habit-log.jsonl, goals.jsonHabits, check-ins and goalsTheir routes. The check-in log is append-only
equity.jsonlWhat the investments were worth, one row a dayThe mail job. A second run that day overwrites its own row
Caches and the screenLast known good prices and daily bars, the daily ranked screen, and the list of what the broker sellsThe mail job. Each keeps its last good file when a fetch fails or comes back thin
research/Briefs, backtests, the replay and the record of what was emailedThe merge job and the monthly backtest
One row

One Ledger Row, With Demo Values

This is the row from the story: the Rp 5.000.000 top-up that no rule recognised. Real rows carry the same fields. The bank's short name, which prefixes two of them, is written here as <bank>.

FieldDemo valueWhy it is there
id<bank>_19a2f4c07be35d18Built from the email's message id, so one email can never become two rows
gmailMessageId19a2f4c07be35d18The key every dedupe checks
typechargeA charge or a reversal. Failed transactions and statements never become rows
date2026-10-09T10:12:44+07:00The bank's own time, in WIB
signedIDR5000000Whole rupiah, signed: a reversal is negative, so a total is one sum
currency, amountOriginalIDR, 5000000What the email said, before any conversion
isEstimated, fxRatefalse, nullA foreign amount is converted at a stored rate and flagged as an estimate
merchant, rawDescriptorTopup RDN Sekuritas, TOPUP RDN SEKURITASA cleaned name for people, and the bank's own words for rules to match
categoryuncatNo rule matched, so it shows as Lainnya. Nothing is guessed
categoryLockedfalseA locked row keeps its category when the rules change
excludeFromSpendfalseStored, but worked out again from the category every time the row is read
paymentMethod, source<bank>-cc, <bank>-emailWhere the row came from
cardLast44821The demo card
reversalOfnullA reversal is a row of its own, never paired with its charge
Rules

What the Data Model Enforces

  • Identity is the message id, never the content. The row id is built from the email's message id, so reading the same email again can never add a second row, and two identical purchases on one day both survive.
  • Money is whole rupiah. Integers only: no floating point, no sen.
  • A reversal is its own row with a negative amount. Totals are a plain sum, so 164 reversals net out with no pairing logic.
  • Append-only, with sidecars. A correction, a duplicate verdict and a rule change never edit the ledger. Each lives in its own small file beside it and is merged when the ledger is read.
  • One door to the data. Every read and write goes through store.ts, and every total goes through listTransactions().
05

From a Bank Email to a Ledger Row

The mail job runs at 04.30 WIB Tuesday to Saturday, just after the US market closes, so the trading desk is current by morning. It runs again at 06.00, and at 08.00 WIB as a backstop. Every run is idempotent: running it again changes nothing. It also runs by hand, with dry, verify and backfill switches, and from the app's Sync sekarang ("sync now") button. That button fires a repository_dispatch, GitHub's way of letting an outside caller start a workflow, much like a webhook. Two runs never overlap.

Each run asks Gmail for mail from the bank's known senders since a watermark, the time of the newest email already imported, minus 120 seconds. The overlap is on purpose: the dedupe removes it. The mailbox is opened as All Mail, read-only, because an archived notification is still a purchase. Reading is the only permission the feature has ever needed.

Ingestion in fifteen steps: trigger, open the mailbox, search since the watermark, map the id, the guard, skip known messages, classify by subject, parse, read the amount, categorise, sign and append, check for an unknown sender, the best-effort steps, commit and push, and the rebuild.
11Fifteen steps and no AI: a run can repeat and add nothing
Two id spaces

One Number, Written Two Ways

The ledger keys every row on Gmail's REST id, a lowercase hex string, because that is what the first transport returned. IMAP reports the same message as X-GM-MSGID, a 64-bit decimal: the same number in another base. The conversion is one line of arithmetic, and a wrong guess is expensive. On an append-only file it would import more than 2,600 old emails a second time.

So the code takes four precautions. It refuses to guess on an all-digit value, because "12345678" is legal in both bases. It refuses a mail server that would report a different kind of id. It aborts a run that lists mail and recognises none of it while the ledger holds a real history. And a verify run proved the mapping against the ledger before the first real import.

Parse and file

Reversals First, Guesses Never

The subject decides what an email is, and the order matters: a reversal's subject also says Transaction Notification, so reversal is tested first. Failed transactions and statements are ignored. The body is HTML only. It is stripped to text and read by one set of regular expressions that covers both email layouts and three amount formats, and in Indonesian numbers a dot separates thousands and a comma marks decimals. The time kept is the bank's own field, never the moment the mail arrived. A charge or reversal that cannot be read is flagged for review, never written half-read.

Categorising is rules, and the first match wins: the owner's own rules, then the seed rules by priority, then a default for QR payments. Anything left is uncat, shown in plain sight as Lainnya.

After the rows

Best Effort, Then Commit

New rows are sorted by time and appended, and the watermark moves. The same window is then searched by subject as well. A notification whose subject matches but whose sender is not on the list fails the run, after the known rows are saved. It only detects: taking rows by subject would let any email with the right subject write to the ledger.

The same run then refreshes the price cache, the broker's tradeable list, asset logos, daily bars and the daily screen. It reads the broker's trade emails into the journal, gives any position without a stop its watch levels, records what the investments are worth and checks the plan alerts. Each step is best effort: one failing never stops the next. Then the bot commits data/, and pulls with rebase before it pushes, up to three tries, because a run lasting minutes can find main moved under it. A mail failure is raised again as the very last step, so the run still goes red without having skipped anything.

The broker's emails arrive in the same mailbox. Fills, the completed buys and sells, become journal entries, deduped on the broker's own order number and dated by when the email arrived, since the email's date field is when the order was placed. Other notices are read too: cash in and out, cancelled orders, and a rejected stop-loss order, which marks a position as unprotected.

06

A Tap, a Commit, a Rebuild

Here is the correction from the story, traced through the code: the owner re-tags the Rp 5.000.000 top-up from Lainnya to Transfer & Isi Saldo.

The life of one request in seven lanes, phone, Edge gate, route, pure core, GitHub API, repo and Vercel: a tap sends a PATCH, the gate checks the cookie, the handler finds the row, the pure rule validates it, the GitHub API commits the overrides file, the push rebuilds the site, and the next read moves the month from Rp 12.521.690 to Rp 7.521.690.
12One correction in eight steps, and the ledger line is never touched
  1. Tap. The detail sheet sends PATCH /api/transactions with the row id and the new category.
  2. Gate. proxy.ts checks the signed cookie on the Edge. Without it an API call gets a 401 as JSON, never a login page.
  3. Thin handler. The route parses the body and finds the row through listTransactions(). It holds no rules of its own.
  4. Pure rule. applyOverride() checks the category against the taxonomy and compares it with the parser's original. Setting a row back to what the parser said clears the override instead of storing a redundant one.
  5. Commit. Deployed, Octokit reads the file's current sha, Git's fingerprint of one version of a file, on main, and commits the new category-overrides.json against it. Run locally, the same payload is written straight to disk, through the same validation.
  6. A new commit. category-overrides.json changes on main. transactions.jsonl does not.
  7. Rebuild. The push rebuilds the site. Until the new build is live, the running one still serves its own snapshot, so the route answers pendingRefresh: true and the sheet keeps its own saved state instead of refreshing into old data.
  8. Read again. The next render applies the overlay. The row reads Transfer, it no longer counts as spending, and the month drops from Rp 12.521.690 to Rp 7.521.690.

Every route that changes data has this shape: parse, validate in the pure core, then commit or write. Four variations are worth telling.

  • Cash. POST /api/transactions builds a full row with a random id. Deployed, it reads the ledger at the head of main, appends one line to that and commits, so a row the mail job added a minute earlier is kept.
  • Settings. meta.json is shared with the mail job, which moves the watermark several times a day. The settings route reads the file at the head of main before it writes, because writing back a stale copy would roll the watermark back and either re-read months of mail or skip new mail.
  • Habits. Check-ins are batched in the browser. A tap shows at once, and the queue is sent after 1,200 ms of quiet or when the tab is hidden: eight habits at breakfast are one request, one commit and one rebuild, not eight.
  • Sync sekarang. POST /api/sync reads no mail itself. It starts the mail job.
Read path

What a Row Means Is Decided When It Is Read

A page is a server component: it runs on the server and reads the files directly, with no API in between. store.ts parses the ledger once and keeps two cached copies, the rows as parsed and the rows with the overlay applied. Any write clears both, or a page would keep serving the old ledger.

The overlay decides what each row means at the moment it is read. For every row, a manual correction wins, then a locked row keeps its category, then the current merchant rules apply, then the stored value. Whether the row counts as spending is then worked out from that category and the owner's e-wallet setting, never trusted from the file. Pure functions compute the month, the normal-month comparison and the calendar from the result and hand plain data to the screen.

Why at read time: the ledger is append-only, so a rule that was wrong used to stay wrong forever. One e-wallet rule had kept 1,049 rows out of every total, and fixing the rule changed nothing while rules only ran when mail was read in. Now fixing a rule fixes history without rewriting a line. Before the switch, running the current rules over the whole ledger moved 3 rows out of about 2,600, all of them corrections made minutes earlier. That is what made the change safe.

07

Market Data and Email With No Paid API

Market data

Free Feeds, Each With a Fallback

  • Server-side only. GET /api/quotes prices the holdings, the watchlist and the open plans. Yahoo sends no CORS headers, the permission a browser needs to read another site's answer, and calling it from the browser would also put the owner's own IP address into its rate limit.
  • Sources. Stocks come from Yahoo Finance's chart API, one request per symbol, five at a time. Every coin comes from one CoinGecko call. Dollars to rupiah come in three tiers: Yahoo, then an open exchange-rate feed, then a fallback rate in meta.json, so the page always has a number. A rate older than 24 hours is labelled a fallback.
  • The 8 s deadline. 4 s per request and 8 s for the whole route, however many symbols. Whatever has not answered by then falls back to its last known good price, flagged as stale. The route never returns an empty set that the screen would draw as Rp 0.
  • Caching. A price stays fresh in memory for 60 s while markets are open and 15 minutes while they are closed, and the last known good copy is never thrown away on an error. The mail job commits a price cache on every run as the seed for a freshly started server, and the response is cached for 60 s at the CDN, the network of caches in front of the site.
  • Checked before saved. A new holding's ticker is tried once before it is stored, so a typo cannot be saved and show "-" forever.
  • Daily bars come from Yahoo first and a second free source for US symbols. Two traps were paid for: that source returns a year of someone else's bars for a ticker it does not carry, so the symbol is confirmed first, and its rows come back newest first while every indicator reads oldest first.
  • Logos are downloaded and committed. Drawing them from a CDN told that CDN which stocks were held, on every page view. The files also sit behind the gate, because their names alone are the holdings list.
  • Honest labels. Stock prices are about 15 minutes late, so the page shows the time and never says "live".
Desktop screenshot. Investasi: total portfolio value, an allocation bar across three markets, and each holding with its gain or loss.
13A live portfolio across three markets, priced by free feeds
Email out

Two Emails, Two Rules

Both go through Resend's API from GitHub Actions, which can reach any address on the internet. The AI routine never sends anything.

Plan alertsDaily research digest
Sent byThe mail job, on every runThe research merge job
Built fromThe owner's own entry, target and stop, against prices fetched seconds earlierThe day's validated brief, rendered by code
Uses AINo: rule checks onlyThe brief was written by AI. The email is not
Will not send whenThe quote is stale or older than 18 hours, or the same breach already alerted in the last 7 daysThe recommendations are unchanged, or the brief is older than the last one sent

Alerts have no AI in them because a skipped or failed brief must never silence a stop-loss. The digest has a fingerprint because the job once sent whenever the brief file changed, and every rerun of the routine changes it: three reruns that only reworded the prose sent three extra emails for one set of trades. The fingerprint is symbol, market, entry band, stop and target, sorted. The record of what actually reached Resend is written only after a successful send, and the merge job sends before it commits, so that record ships in the same push as the brief.

08

AI Writes Research, Code Decides What Ships

AI has one job in Rido: writing trading research. It never reads the mail, never categorises, never computes a total, never sends an alert and never places an order. Everything it writes passes three doors made of code before it reaches the page or the inbox.

Two lanes. The AI lane: the ingest job builds the screen, a Claude routine writes one JSON brief to a claude branch, the merge job takes only the research folder, a validator refuses a malformed brief, code applies the rules and ranks and sizes the ideas, the page and the digest show them, the owner decides, and a monthly replay grades the result. The alert lane, with no AI: every ingest run sets watch levels, checks the owner's levels against fresh prices, refuses stale quotes and repeats, and emails through Resend.
14Claude writes the brief, code decides what ships, and the alerts never wait for either
The AI layer
ModelClaude Opus 5, run as two scheduled Claude Code routines: daily at 07.00 WIB, and a weekly deep dive on Sunday at 18.00 WIB. Pinned to Opus 5 after another model's usage limit stopped one run eight seconds after it started
Why a routine, not an API callNo cost per run on a subscription already paid for, and it runs whether or not the laptop is on
What it readsA clone of the repo: the written trading method and the daily ranked screen. Its sandbox cannot reach the price feed, so the mail job computes the screen for it. The prompt lives on the routine, not in the repo
What it writesOne JSON brief, a market summary and zero or more ideas, pushed to a claude/* branch. It cannot push to main
Guardrail 1: the doorThe merge job takes only data/research/ from the branch, keeps main's record of what was sent, and refuses a brief dated older than the one on main
Guardrail 2: the validatorA malformed brief fails the job, so yesterday's brief stays on the page
Guardrail 3: rules in codeApplied every time the brief is read. US stocks only. A symbol must be in the broker's own catalogue, which overrides the model's claim. Reward at least 2 times the risk. A stop closer than 1.8 ATR (average true range, how far the price usually moves in a day) is dropped, and under 2 ATR is warned. Theses stop at 200 characters, the summary at 900. The raw file stays on disk as the audit record
Ranking and sizingCode ranks ideas by reward-to-risk times confidence and funds them down the list against free capital. Ideas past the money are printed as alternatives, not additions
How quality is checkedA monthly replay grades every shipped idea by what the price did next. The journal links each trade to the brief that named it. The scorecard compares closed trades with holding the index and refuses a verdict under 20 trades. A ten-year backtest tests the rules themselves
What AI never doesRead the mail, categorise, compute totals, alert, or place an order. No broker on offer has a retail order API, and the owner places every order by hand
When it failsNothing breaks. The page keeps the last valid brief, the alerts keep running because they never depended on it, and a brief with no ideas is a valid answer
The desk

It Grades Itself

Ten years of prices were asked whether the desk's rules deserved it: 970 symbols, from 1 September 2016 to 1 September 2026, net of costs. Holding the index returned +13.2% a year. The desk's first rules returned +1.3%. Only a 3R target paid, at +14.1%, and stops at 1 ATR lost 46.3% a year. In the research document's own words: "Buying SPY and sleeping beat every variant tested, net of costs."

Those numbers carry their own caveats: today's symbol list flatters the strategies by about 1.6% a year, prices carry no dividends, ten years is one bull cycle, and the winner is the best of about 24 variants.

So the page grades itself. The scorecard compares every closed trade with holding the index over the same days, refuses a verdict below 20 closed trades, and says so outright when the index won. None of this is financial advice: it is one person's tool checking its own rules.

The trading scorecard: a banner saying the index won, then expectancy, win rate, total result, the index's return, profit factor, drawdown and exit discipline. With a little of the page around it.
15The scorecard leads with the verdict: the index won
Film moment: four open positions with price lines, stops and targets.
16Open positions, each with its stop and target
09

How It Fails, and What Each Failure Left Behind

The same few principles recur across the code.

  • Idempotent by construction. Row ids come from message ids, broker fills dedupe on the order number, and a second value snapshot on the same day overwrites its own row. Running anything twice adds nothing.
  • Look before writing to anything append-only. A dry run previews, a verify run proves the id mapping, and the guard stops a run that recognises nothing.
  • Best effort never blocks what matters, and a failure is raised again at the end, so the run still goes red.
  • Refuse to write a thin file. The broker's catalogue and the daily screen keep yesterday's file rather than commit a partial fetch.
  • Last known good beats blank. Quotes, exchange rates, daily bars and the brief all fall back to the previous good value, labelled as such.
  • Never overlap. Each workflow runs one at a time, and the push rebases and retries.
Incidents

Seven Failures, Seven Fixes

WhenWhat happenedWhat changed
27 Aug 2026A long run found main moved under it. The push was rejected and the whole sync was lostPull with rebase and retry the push, up to three times
Up to 9 Sep 2026The first mail transport's OAuth token died every 7 days, because its consent screen sat in testing. 11 runs failed in a row, and because a failed step ended the job, the stop-loss alert email was silent for six daysMail moved to IMAP with an app password. Every later step became best effort, and the mail failure is raised again last
9 Sep 2026, the IMAP moveIMAP ids are decimal and the ledger's are hex: a wrong mapping would have imported more than 2,600 emails againA refusal to guess, a server capability check, the abort guard and a verify run
14 Sep 2026A research retry from a day-old clone rolled the brief back, and both the old and the restored brief were emailedThe merge keeps main's newer brief, and the sender refuses any brief older than the last one sent
22 Sep 2026The bank changed its sender address. Every run "succeeded" with 0 rows for a weekA subject search that fails the run on an unknown sender, without ever taking rows by subject
The bars cacheA double quote in an inline script closed the shell string early. The step "succeeded" on every run while the cache was never written onceThe symbol list became a file, and the step reports how many symbols it actually cached
OngoingYahoo answers 429, too many requests, on every host for hours at a timeCommitted caches, a second source for bars, three tiers for exchange rates and the 8 s deadline
Security

One Gate, No Session Store

  • One gate for everything. proxy.ts runs on the Edge before every request. A page redirects to the password page and returns to where it was headed; an API call gets a 401 as JSON.
  • A stateless token. An expiry time plus an HMAC-SHA256 signature of it, a seal only the server can make, made with Web Crypto and compared in constant time. It lives in an http-only cookie for 90 days: "a phone should log in about four times a year". There is no session store.
  • A patient login. The login route waits 400 ms before it answers, which slows guessing without bothering a real login.
  • Secrets stay out of the repo. The mail password, the GitHub token and the Resend key live in GitHub Actions secrets and Vercel's environment. The repo is private because the data is real.
  • No third-party requests from the portfolio page, since the logos were committed.
Flowchart: the password gate, signing in, and how a typed change becomes a commit or a local write.
17The gate, and how a typed change becomes a commit or a local write
The password page: a small card with the product name, a password field and a sign-in button, nothing else.
18The password page: a field and a button, nothing else
10

How It Was Built

Docs came first, in four phases: design, product, data and architecture. Then the build. It was one repo and two tools: planning and research in Cowork, execution in Claude Code.

Between 10 July and 20 October 2026 the main branch took 385 commits. 231 of them were made by the pipeline's own bot account: mail syncs and research merges. The other 154, made by hand or through the app's own write path, fall on 27 distinct days. The scaffold, the dashboard, the parser, ingestion and the write path all landed on one day, 13 July 2026.

Decision 01

No Database

  • Context. A few thousand rows a year, one user, free tiers only.
  • Decision. JSONL and JSON files in a private repo, with SQLite named as the swap if the volume ever grows.
  • Consequence. Every change to the money is a commit that can be read or reverted. The price: the deployed app cannot write to its own filesystem, and the repo must stay private.
Decision 02

GitHub Actions as the Write Backend

  • Context. Vercel's filesystem is read-only. The alternative was to read the mail on the laptop and publish Vercel as a snapshot.
  • Decision. Scheduled Actions read the mail and commit; typed changes commit through the GitHub API.
  • Consequence. The automation runs with the laptop shut. Every write costs a rebuild before it shows on the live site.
Decision 03

IMAP With an App Password, Not the Gmail API

  • Context. The OAuth token expired every week, and leaving testing needs a verification that a restricted mail scope cannot realistically pass.
  • Decision. IMAP, with OAuth kept as a fallback behind one mail-source interface.
  • Consequence. A credential that does not expire, at the price of a second id space that had to be mapped and guarded.
Decision 04

Identity Is the Message Id

  • Context. Identical real purchases exist, and the research advised removing duplicates by card, time and amount.
  • Decision. Dedupe on the message id, never on content.
  • Consequence. A double charge the owner does not want becomes a question instead: same merchant and same amount within 6 hours at Rp 150.000 or more, or within 14 days at Rp 2.500.000 or more. One tap answers it, stored in its own file. The naive rule, same merchant and amount within 14 days, had fired on 391 pairs, 294 of them e-wallet top-ups that are meant to repeat. Every threshold was measured against the real ledger.
Decision 05

Meaning Is Decided at Read Time

  • Context. An append-only ledger cannot be corrected in place, and one wrong rule had kept 1,049 rows out of every total.
  • Decision. Overrides and rules are applied when a row is read.
  • Consequence. A correction or a fixed rule reaches all of history at once. In exchange, every total must be read through listTransactions().
Decision 06

Thin Routes, a Pure Core

  • Context. The test runner does not collect tests under app/, where the routes live.
  • Decision. Every rule lives in src/core; a route only parses, calls and commits.
  • Consequence. The rules in the 68 core modules are tested without a server or a mailbox.
Decision 07

AI Only Where Its Failure Is Harmless

  • Context. A morning job must not depend on a usage quota, and an alarm must not depend on prose.
  • Decision. Reading the mail, categorising and alerting are plain code. AI writes research and nothing else.
  • Consequence. The system keeps working when the model does not.
Decision 08

A Comment Never Failed a Build

  • Context. An audit of the shipped app found the same class of responsive bug five times in five places, and white on the accent green measured 2.7:1.
  • Decision. The rules that matter are tests. Five source-lint guards fail the build: on responsive mistakes, on contrast ratios computed from the tokens in both themes, on the server and client boundary, and on how a dialog handles focus and the Escape key.
  • Consequence. On a phone the explorer's chrome fell from 666px to 439px, taking visible rows from zero to 5. As of 20 October 2026, 1,251 tests in 70 files pass. Golden tests run against the real ledger and assert invariants and floors, never frozen totals, because the ledger grows every day.
Desktop screenshot. Rincian Pengeluaran, the transaction explorer: four summary tiles, a search field, filter menus and a table of this month's transactions.
19The explorer: four tiles, search, filters and every transaction
Phone screenshot. Rincian Pengeluaran, the transaction explorer: four summary tiles, a search field, filter menus and a table of this month's transactions.
20The same explorer on a phone
Decision 09

Logos Are Downloaded, Never Hot-Linked

  • Context. Drawing a logo from a CDN tells that CDN which stocks are held, on every page view.
  • Decision. The mail job downloads each logo once and commits it, and the files are served behind the gate.
  • Consequence. The portfolio page makes zero third-party requests.
Decision 10

Light First

  • Context. The design started dark-first.
  • Decision. Three days in it was turned around: "Restraint reads premium."
  • Consequence. Categories are told apart by icon and name, never by colour, and green appears once or twice per screen. Dark mode comes from the same tokens.
Decision 11

Habits Forgive, and Say So

  • Context. An unforgiving streak breaks once and is then abandoned.
  • Decision. A grace day keeps a streak alive but never counts as done.
  • Consequence. The streak is the motivating number and consistency is the truthful one. Keeping them apart stops forgiveness becoming a lie.

AI is deliberately not used for reading the mail, alerts, categorisation or trade execution. And the owner overrode the work five times: no database, light instead of dark, no paid API, no checklist on recurring bills, and the reward floor back from 3 to 2 against the backtest.

11

Design Details

The research

Restraint Wins

Five research reports came before the design: inspiration, product benchmarks, stack, motion, and UX with data visualisation.

  • One confident accent, one hero number and one signature chart.
  • A first screen with more than about 7 competing elements loses people, so the target is one hero number and 3 to 5 supporting blocks.
  • Bars and lines, not pies and donuts. A calendar heat-map answers "when do I spend?" better than a daily line.
  • Red means "you crossed a line", never "you spent money". Ordinary spending is neutral ink.
  • Rules alone categorise 60 to 75% of rows, and learning from corrections takes that past 95%. What cannot be placed is shown as uncategorised, never guessed.
  • Forgiveness keeps habits alive: an unforgiving streak breaks once and is then abandoned.
The details

One Number, One Accent

  • One number. One hero number, framed as agency, with 3 to 5 supporting blocks around it.
  • Colour. Light first, with a full dark mode. One slate-navy card holds the focus on each screen, and green appears once or twice.
  • Type. One typeface, Plus Jakarta Sans.
  • Charts. Every chart and control is hand-rolled. No chart library is installed.
  • Money. Whole Rupiah, a dot as the thousands separator, shortened to rb, jt and M, where M is miliar, not million.
  • Tone. A missed habit is normal and is never red. Being behind on a goal is a warning, never an error.
  • Touch. The audit found about 20 controls under the touch target and 46 values on the home page that were tooltip-only.
Key detail: the month card enlarged, with three numbered notes on net totals, the normal-month comparison and the cumulative line.
21One number, and whether it is normal
Component grid: nine interface details at phone width, each with a one-line caption.
22Nine details at phone width
23 · VideoEvery control, played with: periods, the calendar, dark mode, search and sort
The calendar heat-map for October 2026: days shaded from light to dark by spending, with the 13th outlined. With a little of the page around it.
24A calendar answers when the money goes
Desktop screenshot in dark mode. Ringkasan, the summary screen: the month's spending as one large figure, how it compares with a normal month, categories, top merchants, a calendar heat-map, a six-month trend and the latest transactions.
25Dark mode, from the same tokens
Desktop screenshot in dark mode. Trading: a chart of total investment value, four open positions with stop and target levels, and a scorecard.
26The trading desk in dark mode
12

Outcome and Next

0Databases: the repo is the database
3Scheduled mail syncs a day
231Of 385 commits made by the pipeline itself
2,876Ledger rows, one line of JSON each
1,251Tests in 70 files, all passing
2,487Bank emails analysed before any spec
95.8%Of the seeded ledger categorised automatically
12Screens, plus a password page

Numbers as of 20 October 2026.

  • Live and in daily use, at no running cost beyond a subscription the owner already had.
  • The pipeline runs on its own: 231 of the 385 commits on main were made by its bot account.
  • The seeded ledger was 95.8% categorised automatically.
  • Twelve screens, plus a password page.
  • Not measured: the original targets of nothing missed, no duplicates, 99% job success and an answer in under 3 seconds. They have not been audited, so they are not claimed.
  • The honest result of the trading desk is the one its own page prints: holding the index beat every variant tested.
Limits

Stated Plainly

  • A write shows on the live site only after a rebuild. Fine for one person, and the interface says so.
  • One user. Every part of the design assumes one person writing at a time.
  • Everything loads into memory. Right at about 3,000 rows. If that ever changes, the storage boundary is one file.
  • The data folder is not yet encrypted at rest. It is listed as next.
  • Free market feeds are unreliable. Any price can be stale, and the screen labels it.

Next: a wider sweep of trailing stops, encryption of the data folder at rest, goal progress read from account balances, and real habit reminders by email.

Browser window: the whole summary page as it appears on desktop.
27The whole summary page, as it appears on a desktop
13

Gallery

The summary screen before the correction: the month reads Rp12,5jt, Rp2,4jt above a normal month, with a suspected double charge card at the top.
28Before: the month reads Rp12,5jt, above a normal month
The explorer filtered to the category Lainnya for October 2026, showing one row: Topup RDN Sekuritas, Rp 5.000.000.
29The odd category holds one row: a top-up of Rp 5.000.000
The detail sheet scrolled to a grid of thirteen categories, with Lainnya selected.
30Thirteen categories, one tap
The transaction detail sheet for Topup RDN Sekuritas, listing every field the bank sent.
31The detail sheet lists every field the bank sent
The summary screen after the correction: the month reads Rp7,5jt, shown in green as Rp2,6jt under a normal month.
32After: Rp7,5jt, in green, under a normal month
The add-transaction sheet over a blurred summary screen, with Rp 25.000 typed in, category Makan & Minum and method Tunai.
33The add sheet asks for an amount and little else
The summary screen after the cash entry: the month reads Rp 7.546.690 over 58 transactions.
34The new cash row leads the latest transactions
The month card after the correction: Rp7,5jt, 17 per cent down, Rp2,6jt under a normal month, in green. With a little of the page around it.
35The month card after the correction
Film moment: the summary switched to the whole year.
36The same summary, switched to the whole year
Desktop screenshot. Kebutuhan Bulanan: income against recurring needs, what is left to save, what is still unpaid, the credit card line and bills due soon.
37The monthly plan: income, recurring needs and what is left to save
Desktop screenshot. Proyeksi: assumptions for monthly surplus, time span and return, with a projected balance year by year.
38A projection built on the owner's assumptions, never the app's
Desktop screenshot. Trading: a chart of total investment value, four open positions with stop and target levels, and a scorecard.
39The trading desk: positions, levels and a scorecard
Desktop screenshot. Kebiasaan: today's habits grouped by routine, with streak counts and a progress ring.
40Habits grouped by routine, with streaks
Desktop screenshot. Tujuan: goal cards with progress rings, pace labels and the habits that support each goal.
41Goals with a pace label and the habits behind them
Desktop screenshot. Ringkasan, the summary screen: the month's spending as one large figure, how it compares with a normal month, categories, top merchants, a calendar heat-map, a six-month trend and the latest transactions.
42Ringkasan, the summary
Desktop screenshot. Analisis: spending by weekday and by hour, the largest expenses, detected subscriptions and a category ranking.
43Analisis: by weekday, by hour, and the largest expenses
Desktop screenshot. Rekening & Saldo: bank, e-wallet, cash and investment accounts with their balances.
44Rekening and Saldo: every account and its balance
Desktop screenshot. Kekayaan Bersih: net worth as one figure, with assets by type and one liability.
45Kekayaan Bersih: net worth as one figure
Desktop screenshot. Pengaturan: cards, spending rules, sync status and appearance settings.
46Pengaturan: cards, rules, sync and appearance
Desktop screenshot in dark mode. Kebiasaan: today's habits grouped by routine, with streak counts and a progress ring.
47Habits in dark mode
The summary screen on a phone as it first opens, with the suspected double charge card above the greeting.
48The summary as it opens on a phone
The category list on a phone with Lainnya at the top: Rp5jt, 40 per cent of the month.
49The odd category leads the list
The add-transaction sheet on a phone with Rp 25.000 typed in.
50Adding cash on a phone
Today's habits on a phone, with a 17 per cent progress ring.
51Today's habits
The trading scorecard on a phone: a banner saying the index won, 0.6 per cent against 18.5 per cent, above eight metrics.
52The scorecard says so when the index won
A phone showing the corrected month on the product's slate-navy, under the line 'Every rupiah, read from the inbox'.
53The corrected month on the product's slate-navy
Large type: Rp12,5jt struck through above Rp7,5jt, with the re-tagged row beneath.
54The month, before and after one correction
The calendar heat-map under the question 'Kapan paling banyak jajan?'.
55When does the money go?
A phone showing the trading scorecard on slate-navy, beside the line 'It tells you when the index won'.
56It tells the owner when the index won
A phone in dark mode under the line 'Same tokens, other theme'.
57Same tokens, other theme
The phone navigation drawer, listing every destination in four groups.
58Every destination, in four groups
Phone screenshot. Investasi: total portfolio value, an allocation bar across three markets, and each holding with its gain or loss.
59The portfolio on a phone
Phone screenshot. Tujuan: goal cards with progress rings, pace labels and the habits that support each goal.
60Goals on a phone
Phone screenshot in dark mode. Ringkasan, the summary screen: the month's spending as one large figure, how it compares with a normal month, categories, top merchants, a calendar heat-map, a six-month trend and the latest transactions.
61The summary in dark mode on a phone

Keep browsing

More AI Engineering

All projects
  • The Moon and the JasmineA wedding invitation made for phones: a link per guest, a form that takes a photo, a red envelope, and a Google Sheet as its whole backend.
  • Ravenry Design SystemOne codebase and one design system behind every Ravenry campaign page: each campaign on its own address, every lead in one admin.
  • IntLabs WebsiteA business simulation company's website, its writing admin and its database: 76 pages, ten designed emails, row level security on every table.