60 Commits
Author SHA1 Message Date
MangaValkandClaude Opus 5.5 bda9265d70 Move "A month starts" to Settings, Profile
It sat in the money profile form on Optimize, where nobody looks for a
display setting. Now it's its own card in Settings, Profile, and saves
as soon as it's picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:12:11 +01:00
MangaValkandClaude Opus 5.5 943b19d743 Pay months on Charts, left this month, check-ins and onboarding
With months that start on payday, Charts groups by pay month (presets,
savings rate and month to date included, day 1 being payday). Left this
month counts bills and the usual pace up to the day before the next
salary. Check-ins read this month, budget tips and the weekly cap from
the pay month, and onboarding looks at full pay months.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:06:51 +01:00
MangaValkandClaude Opus 5.5 9d42d52e4d Months that start on payday
A profile setting ("A month starts: on payday") runs each month from one
salary to the day before the next, named after the calendar month it
mostly covers. Salary is money in under Income of at least half a usual
paycheck, found within 12 days of the usual pay day; until it arrives the
running month goes on. The months are worked out on each request and kept
in pay_periods, which money_by_month now groups by, so every monthly
total follows. Spending, Home, Budgets, the typical month and the plan
use them; Charts, check-ins and onboarding stay on calendar months.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:02:23 +01:00
MangaValkandClaude Opus 5.5 1bdcc57c2f Keep accounts and history when a connection is removed
Removing a bank connection deleted its accounts and transactions through
the cascade, so a relink or "Remove this copy" could wipe years of
history and every edit. Now an account that another connection also has
folds into that one (older rows move, edits carry over), and any other
account stays as an account added by hand. Test banks still go entirely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:04:27 +01:00
MangaValkandClaude Opus 5.5 fbdeea630a Bank feeds: sync no longer fails on long transaction ids
Enable Banking ids are about 150 characters, so looking up 500 of them in one
request made a URL the database gateway turned away. The error was ignored,
every row looked new, and inserting them failed on the saved ones (23505), so
the connection showed "Needs you to sign in again" and linking again failed too.

- saved rows are read by account and date range, in pages, and errors stop the sync
- a new row whose id is saved after all is skipped; the same id twice in one
  fetch is one row
- database errors keep their message in the log and on Accounts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 23:05:52 +01:00
MangaValkandClaude Opus 5.5 0d399b77c3 Remove the donation popup and the Support broke links
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:01:48 +01:00
MangaValkandClaude Opus 5.5 5ef800e618 Bank feeds: a row sent again under a new id updates the saved one
ING through Enable Banking gave every row a new transaction_id after linking
again, so the 14-day re-fetch saved all of it a second time.

- before inserting, a new-looking row is paired with a saved row of the same
  provider, account, day, amount and name whose id this fetch didn't return
- the saved row takes the new id and keeps its category, name and tags
- one saved row per new row, so two identical buys on a day stay two rows;
  visible rows are used before hidden ones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:01:47 +01:00
MangaValkandClaude Opus 5.5 059a1da375 MCP: full detail per token, single-transaction tools, one user per token
Tokens get a level (migration 0034). Summary stays the default; Full detail is
the person's explicit choice on Connect your AI, with a confirmation, and is
written into CLAUDE.md as the one exception to summary-only cloud AI. Full
tokens get the full tools plus list_transactions, update_transactions and
mark_transfer_pair; IBANs and long account numbers are shortened in everything
they return (ids stay intact).

Isolation tested with two users and an accepted partner share: RLS alone lets
the partner read the owner's shared rows, but every tool also filters on the
token's user, so nothing leaked and no change landed (own ids, rule id, names).

Also fixes the full spending_summary crashing on rows without a category.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:36:12 +01:00
MangaValkandClaude Opus 5.5 dee883472a MCP: the add command uses --scope user
Without it Claude Code keeps the server for the one folder the command ran in,
so sessions elsewhere don't see brokeless.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:13:02 +01:00
MangaValkandClaude Opus 5.5 1253f4e7fb brokeless as an MCP server for AI apps like Claude Code
/api/mcp (Streamable HTTP, stateless) with personal tokens made on Connect
your AI (stored as a hash, shown once, revocable; migration 0033). Each call
runs as the token's user in their own session, so RLS applies; AI switched
off in Settings refuses.

Summary only, like every cloud path: the existing summary tools, plus tools
that change things through placeholders and answer with counts: list
categories and rules, create rule, delete rule (with undo), recategorize,
find transfers, merge accounts (preview first).

Rule past-matching and merging moved to shared libraries (lib/rule-past.ts,
lib/merge-run.ts) so the app and the tools run the same code.

Tested with the official MCP client: bad token refused, tools listed, and the
'ing' rule found, undone and replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:06:44 +01:00
MangaValkandClaude Opus 5.5 c7298cf955 Rules: undo a rule on past transactions when deleting it; warn about short text
Deleting a rule can now take back what it did: rows it changed get what the
other rules say (or Other / no category), then own transfers are looked for
again. A rule's text matches anywhere in a name, so 1-3 letters ("ing": also
Stichting, Payments, every ING IBAN) gets a warning.

Transfers: also ING's English savings export ("Transfer to/from current
account"), "Naar Beleggingsrek." and "Incasso ING creditcard".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:55:41 +01:00
MangaValkandClaude Opus 5.5 730d99d38b Check for own transfers on every app open, not only with a bank sync
The bank sync runs at most every 6 hours (and never without a linked bank), so
transfers in imported statements stayed counted as spending and income.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:44:36 +01:00
MangaValkandClaude Opus 5.5 759b0c0d62 Spending: a Charts tab with filters
Eight charts over the same spend / income rule as the rest of broke (transfers
never count): cash flow, savings rate per month, spending by category over time,
this month so far vs last month and the 3-month average, balance over time per
account and in total (worked back from today's balances), top merchants,
spending by weekday and biggest changes vs the period before.

Filters in the URL: time range or custom dates, grouping, accounts, categories,
tags, direction, merchant search, and compare with the previous period.
Clicking a bar or point opens those transactions in Activity. Every chart has a
legend and a table view; series colors are a validated palette in a fixed order
set by all-time spending, so filters never repaint a series.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:40:35 +01:00
MangaValkandClaude Opus 5.5 2371a5674f Transfers between own accounts no longer count as spending and income
Imported statements come in without a category, so money moved to savings counted
as spent on one side and earned on the other. After every import and sync, brokeless
now marks them as Transfers out / in: pairs (same amount out of one own account and
into another within 4 days) and savings accounts by name (Oranje Spaarrekening,
Doelspaar, Direct Sparen...). Only rows without a category or with Other change.
All history, so existing imports get fixed on the next sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:20:40 +01:00
MangaValkandClaude Opus 5.5 49ecfb975f Accounts: Merge into a linked account
The account editor of an imported account gets a Merge into section: pick the
linked account, see what moves and what the bank already has, then merge.
Tested in the stack: older rows move, overlap counts once, edits carry over,
and the next sync leaves it alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 19:28:56 +01:00
MangaValkandClaude Opus 5.5 8e830dc422 Merge an imported account into a linked one (server side, no button yet)
POST /api/accounts/merge {from, into, preview}. Older imported rows move over; from
the day the bank's history starts the bank's rows win, and edits on matching rows
carry over. Safe to run again after stopping halfway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:35:49 +01:00
MangaValkandClaude Opus 5.5 514b2aac77 Enable Banking: warn before the bank's permission runs out, and link again cleanly
- save when the permission ends (consent_until, migration 0032)
- Accounts warns two weeks ahead, says Needs attention once it ran out, and offers
  Link again; an expired or revoked session no longer shows a raw API error
- accounts and rows are keyed on identification_hash, which stays the same across
  links (the uid doesn't), so linking again adds no copies and keeps edits
- links made with the per-link uid move to the stable key on their next sync
- linking the same bank again replaces the old connection

Tested against the stand-in: first link, moving old IDs, linking again,
the warning and an expired permission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:23:49 +01:00
MangaValkandClaude Opus 5.5 0a97ddbcae Add accounts: no Plaid setup card when a bank feed is set up
In the Netherlands with Enable Banking keys, "Link a bank or card" sent people to
the setup page instead of the working Link your bank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:13:00 +01:00
MangaValkandClaude Opus 5.5 33a8a237ea Statement import: ABN AMRO's TXT/TAB download
It has no header row, so nothing came in. Recognize its eight columns, and take
the other party's name out of ABN's coded text (/NAME/, card payments, Naam:).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:40:42 +01:00
MangaValkandClaude Opus 5.5 0232766260 Connect my computer: works from Docker and on Windows
- Docker passes BROKE_HOSTED through (setting it in .env did nothing before)
- the helper finds claude.exe / claude.cmd on Windows (PATH uses ';' there),
  runs a .cmd through cmd.exe with the question on stdin only, and keeps the
  Windows variables Claude needs to find its login; opencode on Windows only as .exe
- the page gives Windows a PowerShell command (curl.exe, file then node)
- Copy works on a plain http LAN address

Tested on Windows end to end with a stand-in claude.cmd: pairing, a question with
quotes, & and %, and every lockdown flag arriving intact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:50:41 +01:00
MangaValkandClaude Opus 5.5 ea53718e5d Link ING and other European banks through Enable Banking
- Docker passes ENABLE_BANKING_APP_ID and ENABLE_BANKING_PRIVATE_KEY through
- transactions are keyed on entry_reference: Enable Banking says transaction_id
  may change between fetches, which imported rows twice
- a key pasted on one line keeps its own PEM label (PKCS#1 keys broke before)
- nginx keeps X-Forwarded-Proto/Host from a reverse proxy, so return links are https
- README: how to set up the app, the keys, and https if Enable Banking needs it

Checked against Enable Banking's API docs and tested end to end against a stand-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:16:53 +01:00
MangaValkandClaude Opus 5.5 cc22098868 Docker: default to port 3003
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:00:24 +01:00
MangaValkandClaude Opus 5.5 73bb30e9a1 Docker: always build the app image, never try to pull it
Unraid's Compose Manager stopped at "pull access denied for brokeless".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 14:55:24 +01:00
MangaValkandClaude Opus 5.5 7f60b51374 Docker: default to port 3001
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 14:47:15 +01:00
MangaValkandClaude Opus 5.5 cec3b15c2c brokeless: fully local by default, and a README for it
- BROKE_OFFLINE=1 (on in Docker) turns off the GitHub update check and the
  exchange-rate fetch, so the server makes no calls out
- auto-update in scripts/start.mjs pulls from your own repo (origin), never upstream
- install.sh points at brokeless; drop the workflow that merged upstream by itself
- compose project and image are named brokeless
- README: what changed from broke, how to run it, how to review upstream

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 14:08:42 +01:00
MangaValkandClaude Opus 5.5 861e65021f Docker: fixes from a full test run
- roles.sql only touches roles this stack has (the init stopped early before)
- internal database link without SSL
- Mailpit without an SMTP login (GoTrue refuses one over plain SMTP)
- setup.mjs refuses localhost, which the containers can't reach

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:56:32 +01:00
MangaValkandClaude Opus 5.5 c50c645cfb Redirects use the address the browser used, not the server's listen address
Behind Docker or a proxy, request.url says http://0.0.0.0:3000, so the sign-in
link sent people there. originOf() reads the Host or X-Forwarded-Host header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:56:32 +01:00
MangaValkandClaude Opus 5.5 44aa5e0933 Docker: run broke fully on your own server
Dockerfile builds this checkout. docker/docker-compose.yml adds Supabase's
Postgres, Auth and PostgREST behind one nginx address, Mailpit for sign-in
links, and Ollama under the ai profile. docker/setup.mjs writes fresh secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:57:45 +01:00
MangaValkandClaude Opus 5.5 5297d8dfa6 Bump next to 15.5.29 and react to 19.1.10 for security advisories
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:40:38 +01:00
MangaValkandClaude Opus 5.5 fc0bf0a566 Statement import: read ING's Af Bij column for the direction of each amount
ING Netherlands exports every amount as positive and says Af (out) or Bij (in)
in its own column. Without this, spending and income all came in as income.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:40:37 +01:00
minimus7andClaude Opus 5.5 b532bb8dd8 Setup step 3 asks where you live and shows that country's bank feed (#6)
Saved as BROKE_COUNTRY. US and Canada get Plaid, NZ Akahu, UK and Europe
Enable Banking, Australia Basiq, Brazil Belvo. Countries with no feed are
told to import a statement after sign-in. Onboarding uses the saved
country instead of asking again.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:15:28 -06:00
minimus7andClaude Opus 5.5 1e246336a2 broke ai: short answers with a breakdown, actions and follow-ups (#7)
Answers lead with one sentence and the key number. A split of money is a
breakdown block drawn as rows with the category icons, things to do are
actions that open the broke page that does them, and follow-up questions
are buttons under the answer. Output only: nothing new goes to the model.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:39:40 -06:00
minimus7andClaude Opus 5.5 b4a5044f8a Accounts: rename, set the kind (bank account or credit card), and delete
- An Edit button on every account: name, and what kind it is (bank account,
  credit card, loan, investment, something else). The kind decides where it
  counts: a credit card's balance is money you owe.
- The kind you pick sticks: migration 0031 adds accounts.type_override, and a
  trigger puts it back whenever a sync writes the bank's type, so every page
  keeps reading accounts.type.
- An imported or hand-added credit card or loan now adds its purchases to what
  you owe (it subtracted them, as for a bank account).
- Delete for accounts you added or imported, with their transactions. A linked
  account says to hide it or remove the bank, since sync would bring it back.

Tested on a local Supabase: rename + Credit card moved the imported account
under Credit cards; a sync-style write of type depository kept it credit;
deleting removed it and its 358 transactions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:05:36 -06:00
minimus7andClaude Opus 5.5 1cf12f4619 Recurring: broke finds repeating charges and pay itself, for every account
Recurring charges only came from Plaid's detection, so imported statements,
bank feeds and hand-added accounts had none (Coming up stayed empty), and a
Plaid bill dropped off Coming up once its predicted date passed.

- findRecurring (pure, tested): groups by cleaned merchant name and direction,
  finds a weekly, 2-weekly, monthly, quarterly or yearly rhythm (3 hits, 2 for
  yearly, most gaps on the rhythm). Bills may vary 40% (electricity); everyday
  spending (groceries, dining, gas) counts only at the same amount. Transfers
  skipped. Next date keeps the day of the month. Stopped ones are ended.
- saveFoundRecurring runs after every sync and after a statement import. Plaid's
  own stream wins for the same merchant. Updates keep the category you picked
  and anything you hid. Plaid streams with a past next date roll forward.

Tested: the sample CSV alone finds Geico, Planet Fitness, Spotify, Netflix,
Verizon, rent, PG&E and Comcast, and Home's Coming up fills in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:19:53 -06:00
minimus7andClaude Opus 5.5 3a4b6a0371 Auto-update: broke brings in the newest version each time it starts
On start, broke fetches main and fast-forwards when this copy has no changes of
its own, then reinstalls only if package-lock.json changed. With your own changes
it says to run npm run update; offline, no git or BROKE_NO_AUTO_UPDATE=1, it
starts the copy you have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:13:18 -06:00
minimus7andClaude Opus 5.5 19e093451d Connect your AI: logos for OpenRouter, Claude, ChatGPT, Gemini, opencode and the local model
Brand marks from Simple Icons (ChatGPT from LobeHub icons), on a white tile so
the dark ones show in dark mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:11:55 -06:00
minimus7andClaude Opus 5.5 3af9e7b306 Budgets: the first list shows every spending category, each with an X to remove it
It only showed categories you spend $10+ a month on. Now every spending
category is listed, biggest first, so nothing is hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:10:39 -06:00
minimus7andClaude Opus 5.5 fb8e5425c3 Add accounts: link a bank without Plaid keys points to Setup; delete test data right there
- With no Plaid keys, the page said bank linking "isn't available in United
  States yet". It is: the keys are missing. It now shows Link a bank or card,
  which opens Setup to add the free Plaid keys.
- Test banks: the Delete test data link went to Settings. It's now a button on
  this page, with a confirm, that removes the test bank and its transactions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:07:02 -06:00
minimus7andClaude Opus 5.5 3e51cc4fcc Sign-in page: don't promise a code when the email has a link
Supabase's default sign-in email has only a link; the code appears only after
the email template is changed. The page said "Sign in with a code" and
"Send code" either way. It now says Send sign-in email, then: open the link
in this browser, or type the code if the email has one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:40:10 -06:00
minimus7andClaude Opus 5.5 b7dc3a6f57 Budgets: Suggest offers changes to budgets that are well off from real spending (#3)
The Suggest sheet said "Nothing to suggest right now." once every main category had a budget.
It now lists budgets $25 and a fifth or more away from the suggested amount as current -> suggested,
then main categories with no budget. Apply all saves them, each row can be edited or removed first,
and the sheet carries the page's Ask AI to tune my budget button.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:39:15 -06:00
minimus7andClaude Opus 5.5 cebd597708 Budgets: edit, remove and add on the first-time suggestion list (#2)
The first-time "Set a budget from how you really spend" list was read-only
until you pressed Use these. Each suggested amount is now an input, each row
has a remove button, and a category picker adds any other category with an
amount. The Use these total and the "This leaves $X to save" line follow the
edits as you type. Use these saves exactly the rows shown.

Reuses AmountCell and the table's add form (now AddBudget, shared by both).
The Suggest sheet on the after-budget view gets the same editing.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:36:14 -06:00
minimus7 0d9ccfa209 Add a broke command: typing broke in a new Terminal starts it again (#1) 2026-11-09 17:05:00 -06:00
minimus7andClaude Opus 5.5 af66279940 Statement import: read a Category column; onboarding counts imported accounts
- A CSV with a Category column (Chase, Amex, Monzo style) now files each row
  under the matching broke category instead of Other, so budgets suggest
  per category straight after an import.
- Onboarding's bank step counted only linked banks, so after importing a
  statement it kept sending you back to Link your bank. It now counts
  imported (manual checking/savings) accounts too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:59:50 -06:00
minimus7andClaude Opus 5.5 8374fc325b Start: install when next is missing, not only when node_modules is
A stopped first install left a half-full node_modules, so the next
start skipped npm ci and failed with spawn node_modules/.bin/next ENOENT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:18:13 -06:00
minimus7andClaude Opus 5.5 a842601665 Back to manual Supabase setup: paste three keys, then the connection string and password
The account-wide sign-in, project picker and project creation are gone. Signing in to Supabase stays as an option on step 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:13:42 -06:00
minimus7andClaude Opus 5.5 e7c5c8df69 Supabase sign-in that expired: say so and offer Connect Supabase again; ask for projects one at a time
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:12:45 -06:00
minimus7andClaude Opus 5.5 cb56fd11a0 Project picker names the connected Supabase organization, and says to change it on the approval page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:11:40 -06:00
minimus7andClaude Opus 5.5 c7df0dba8f Start: only treat the port as broke when broke answers, else use the next free port
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:07:53 -06:00
minimus7andClaude Opus 5.5 961958685c Use a different Supabase organization: sign in again from the project picker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:03:02 -06:00
minimus7andClaude Opus 5.5 f674cc7baf Supabase project creation: read confirmation_id, and say plainly when the free project limit is reached
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:57:01 -06:00