# Runway

A simple budget runway estimator. Enter your current balance, your income and your expenses, each with how often it is paid, and Runway shows how long the money lasts. It is a calculator, not an accounting or history tool.

Everything is saved in the browser's `localStorage` and nothing is ever sent anywhere. There are no accounts and nothing sensitive is asked for: only numbers.

## Views

- **Runway** (home): runway length and run-out date, balance, income, expenses and net per month, a balance-over-time chart, and a table of income, expenses, net and balance at 1, 3, 6 and 12 months plus a custom horizon.
- **Inputs**: current balance, then lists of income and expenses. Each row has a name, an amount and how often it is paid (weekly, monthly, quarterly, yearly, every 2 or 3 years, or custom "every N weeks / months / years"). Rows can be added, edited and removed. Each list shows totals per month, per year and over a custom number of months.
- **Settings**: currency, theme, home page horizons, custom horizon, chart length, and export and import of data, settings or both.

## How the numbers work

Every item is converted to a per-month amount: `amount / (every × months in unit)`, with a week as 7 / 30.4375 months and a year as 12. Balance after `m` months is `balance + net × m`, a straight line. Yearly bills are spread evenly rather than landing on their due dates. Runway is `balance / -net` when net is negative, otherwise unlimited.

## Files

```
index.html            page shell
assets/app.css        styles (tokens on :root)
assets/js/model.js    pure data model, math, storage and backup (unit tested)
assets/js/app.js      UI
tests/unit/           node --test
tests/e2e/smoke.mjs   Playwright smoke test
```

## Storage

Keys: `runway.data.v1` (balance, incomes, expenses) and `runway.settings.v1`. Backup files are JSON with `app: "runway"`, `format`, `kind` (`data`, `settings` or `all`), and the matching `data` and/or `settings`.

## Develop

```
node --test tools/public/runway/tests/unit/*.test.mjs
npm run dev
node tools/public/runway/tests/e2e/smoke.mjs
```
