Ali Husain Software engineer and product designer

01 Interface/Ballast

Ballast

Live app · open source

Personal finance that turns savings into a salary that lasts.

Ballast on a desktop: 55.83 USD is safe to spend today, and the road ahead shows 22 salaries left.Ballast on a desktop: 55.83 USD is safe to spend today, and the road ahead shows 22 salaries left.
Ballast on a phone, showing what is safe to spend today.Ballast on a phone, showing what is safe to spend today.
Ballast's runway on a phone: the savings drawn as a road that ends in September 2028.Ballast's runway on a phone: the savings drawn as a road that ends in September 2028.

Ballast says what is safe to spend today, draws how long the money lasts as a road that ends on a date, and reads bank statements on the device, checking every row against the running balance to the smallest unit.

599
automated tests, unit and end-to-end
40
currencies, in exact whole-number maths
100
Lighthouse score on desktop, in all four categories
0
accounts, servers or trackers

Why it exists

Living on savings is a guessing game. A banking app shows a balance and a budgeting app assumes a paycheck. Neither says how much is safe to spend today, or whether the money lasts until the date you need.

What it does

Ballast pays you a fixed salary from your savings, keeps aside the bills still to come, and gives one number: what is safe to spend today. It draws how long the savings last as a road ending on a date, and finds the largest salary that still reaches a date you set.

Bank statements are read in the browser. There is no account or server, and it works offline.

How it is built

  • Money as whole numbers

    Every amount is an integer of the currency's smallest unit. Exchange rates are decimal strings applied with big-integer arithmetic and rounded once, so converting between currencies uses no floating point.

  • Every row against the balance

    Each statement row's balance must equal the previous balance plus its amount. Rows that do not follow are listed, usually because a column was matched wrongly.

  • The browser enforces the privacy

    Every page carries a Content Security Policy, a browser-enforced rule, that allows connections only to the site itself.

  • Calculations apart from screens

    Safe to spend, the month between paydays, budgets and the runway are pure functions with tests beside them, checked without a browser.

How I know it works

599 tests
466 unit tests and 133 end-to-end tests on a desktop browser and a phone, run on every change.
35 of 35
Rows of the made-up sample statement whose balances follow, as PDF and as CSV, asserted by tests.
40 currencies
With zero, two or three decimal places, each covered by tests.
62 KB
The largest page's compressed JavaScript, against a 65 KB budget that fails the build.

What was hard

A comma with two meanings

Amounts are whole numbers once stored, so the risk sits where typed text becomes a number. My first parser removed every comma as a thousands mark. Someone who writes decimals with a comma typed 1,5 and got 15. An independent review found it.

The fix treats a comma as a thousands mark only when it groups three digits. A second review found what I had left: with three decimal places, 0,500 still read as five hundred, a thousand times too much. A thousands group cannot start with zero, so that comma is now a decimal point. Both cases now have tests.

Limits

  • It cannot read scanned statements, which are pictures with no text, and says so.
  • Nothing syncs: another device means exporting a backup and restoring it.
  • A typed 1,500 still means fifteen hundred, so a three-place comma decimal needs a point instead.
  • The runway is arithmetic on the figures entered, and it looks ten years ahead.

Also in Interface

Open to remote work.

ali@gallowforge.dev