A personal mirror of an Up Bank account: transactions arrive by webhook within seconds (daily sweep as backup), land raw in bronze, become typed rows in silver, and roll up into gold marts for spend and cashflow.
UP_API_TOKEN in env vars (token from https://api.up.com.au).jobs/bronze.cron.ts a few times until the logs report backfill done. Each run resumes from its cursor.tools/webhookSetup.ts set MODE = "register", run, paste the printed secret into env vars as UP_WEBHOOK_SECRET, then MODE = "ping" and expect DELIVERED / HTTP 200. Leave MODE on status.models/silverTransform.ts, run tools/silverReplay.ts to re-transform anything in silver_rejects.| Table | Holds |
|---|---|
bronze_transactions | Latest state per id: raw JSON as last received, upserted by id, deleted_at tombstones |
bronze_transactions_log | Every observation, append-only: one row per cron page row, webhook fetch or delete event, with source and run id |
silver_transactions | Typed columns, integer cents, UTC timestamps, live rows only |
silver_rejects | Bronze ids toSilver refused, with reason and attempt count; clears itself when the id transforms cleanly |
gold_category_spend | Settled spend per day and category, rebuilt whole; durations roll up at query time |
gold_cashflow | Settled money in and out per day and account, rebuilt whole |
gold_balance | Reconstructed balance per day and account, dense day spine |
gold_income | Income per day and type (salary, interest, tax refunds), rebuilt whole |
meta | Cursors, watermarks, locks, per-job run state |
Why it is built this way: docs/adr/.