Green

Green is a self-hosted Laravel and Filament app that shows my business and personal bank accounts in one place. It reads balances and transactions through the Plaid API and groups the accounts into Books, one for the business and one for the household. It also tracks recurring bills, income and flex spends (weekly or monthly budgets for a category, such as groceries), and forecasts account balances a few weeks out.

In use on my own books

  1. Books, Plaid sync and pending transactions · Built Oct 21
  2. Recurring bills, payment matching and the forecast · Built Oct 27
  3. Categories, two-factor sign-in and the Plaid activity log · Built Oct 29
  4. Alerts, reminders, budget rollover and set-asides · Built Nov 15
Started
Oct 21, 2026
Latest update
Nov 15
Runs on
My own server, with my own Plaid keys
Stack
Laravel 13, Filament 5, Livewire 4, Plaid, Pest

Updates

Budget rollover and alerts

A flex spend can roll over: what's left of a period's budget adds to the next period, and overspending takes from it. Green alerts once when spending reaches 80% of the period's budget and once when it goes over.

How it's built: Each period is an Occurrence row, and the rollover isn't stored: Occurrence::budget() computes the period's budget on read from the flex spend's amount and the spending in every earlier period. NotifyBudgetAlerts runs after each sync, once transactions are categorized. It records the alert level in occurrences.budget_alert before it notifies, so each level alerts once per period. The forecast reserves what's left of the current period and takes any overspending out of later ones.

Postponing, reminders and set-asides

A single due date on a bill or income can be postponed to a later day, and the due dates after it stay on schedule. A bill or income can have reminders, such as “3 days before: cancel Netflix”, sent once or before every due date. Quarterly and yearly bills show what to set aside each month and how much should be set aside by now.

How it's built: The new date is stored in occurrences.postponed_to and the scheduled due_on doesn't change. The forecast, the overdue check, the sort order and payment matching all read Occurrence::expectedOn(). reminders:send runs every morning on the scheduler and reminds about the soonest open due date, so a paid or skipped one is left out and a postponed one is timed from its new date. Set-asides are computed on read and are display only.

Negative balance alerts

When a sync finds a checking or savings account below zero, usually because of a pending charge, Green sends an alert. There's one alert per dip, and it resets when the balance recovers. Each notification type goes to the in-app bell, to email, to both or to neither.

How it's built: NotifyNegativeBalances runs after each sync and checks the available balance, which already includes pending transactions. It sets accounts.negative_notified_at before it notifies and clears it when the balance recovers, so a mail failure can't cause a repeat on every hourly sync. Alerts are Laravel notifications on the database and mail channels, chosen per type on a preferences page. Email is opt-in, is sent through Resend, and leaves out the balance.

Plaid activity log

The Plaid Activity page lists every sync, live balance request, bank link and removal from the last 14 days: what started it, how long it took, what changed and any error. Each row carries Plaid's request IDs, so it lines up with a row in Plaid's dashboard. Fetching a live balance straight from the bank is the one request Plaid bills per call in production, so that action sits in an Actions menu and asks for confirmation.

How it's built: PlaidLogger wraps each operation and saves a plaid_logs row when it starts and again when it ends, so a job killed at its timeout still shows as unfinished. PlaidClient captures each request's endpoint, status and request_id while the operation runs. Tokens and transaction details are never logged, a failed log write is reported and not thrown, and model:prune deletes rows after 14 days.

Transaction categories

A Book uses one category set, and Green categorizes its transactions after every sync. A category comes from one of four sources, and the first that applies wins: my own pick, the bill the transaction pays, a payee listed on a category, then Plaid's own category. The starter Business set follows the expense lines of IRS Schedule C, with Hosting and AI services added.

How it's built: CategorizeTransactions runs after each sync and whenever a category, a Book's set or a bill's link changes. transactions.category_source records which source set the category, and a manual one is never replaced by the other three. Payee matching takes the longest payee the description contains, so “Amazon Web Services” beats “amazon”. Plaid's personal finance category codes are mapped to categories in each set, and a detailed code beats a primary one.

First one that applies wins
manualMy pick
recurringThe bill it pays
payeeA payee I listed
suggestedPlaid's category

Balance forecast

The forecast projects a checking or savings account's balance a few weeks out and shows its lowest point. It starts from today's available balance and applies each bill, flex spend and expected income on its date. A one-time expense or expected payment can be added to see what it does to the lowest point.

Forecast / Personal Checking / RegisterScreenshot
The forecast register for a checking account: grocery and gas budgets, a one-time car repair, then rent and Netflix on Dec 1 taking the balance to minus $258.86 before a $2,000 owner draw brings it back to $1,741.14.

How it's built: Plaid's available balance already includes pending transactions, so ForecastBalance leaves out a bill that's linked to a pending charge. A flex spend reserves what's left of its current period today and its full budget at the start of each later period. An unpaid bill past its due date counts today. On a day with both, money out is applied before money in, so the projection errs low.

Screenshots show demo data.

Recurring bills and payment matching

Bills, income and flex spends are set up as recurring items on an account. A bill counts as paid when Green links it to the transaction that paid it, and each due date shows that transaction and how it was matched. A payment I unlink stays unlinked.

Recurring / ComcastScreenshot
A monthly Comcast bill on autopay: the payee text it looks for, amounts matched within 10%, and its due dates. Two are upcoming. One is pending and one is paid, and each of those shows the transaction that paid it and “Matched automatically”.

How it's built: MatchRecurringTransactions runs after each sync. It links a transaction to a due date only when the bank's description contains the bill's payee, the amount is within the bill's tolerance and the date is within a match window set by the bill's frequency, so an equal amount alone never matches. Candidates are paired closest date first, then closest amount, and each transaction and due date is used once. Unlinked transactions are stored by Plaid ID and checked against the pending ID too, so a link doesn't return when a pending charge posts under a new ID.

tests/Feature/Recurring/MatchRecurringTransactionsTest.phpPHP
it('never links a payment on amount alone', function () {
    $spotify = bill($this->account, [
        'name' => 'Spotify', 'payee' => 'spotify',
        'amount' => 11, 'starts_on' => '2026-10-20',
    ]);
    payment($this->account, '2026-10-20', 11.00,
        'SHELL OIL 57442', 'Shell');

    matchAccount($this->account);
    expect(linkedTo($spotify))->toBeEmpty();

    payment($this->account, '2026-10-21', 11.50,
        'SPOTIFY USA P2F1A');
    matchAccount($this->account);
    expect(linkedTo($spotify))
        ->toBe(['2026-10-20' => 'SPOTIFY USA P2F1A']);
});

Books and Plaid sync

The dashboard shows what's available and what's pending for every account at once, grouped into Books. One bank connection can feed both Books. A connection that needs a new sign-in is flagged, with a link to reconnect.

DashboardScreenshot
The dashboard: what's available in a business Book and a personal Book, one bank connection that needs attention, and the pending transactions across both Books.

How it's built: Plaid has no official PHP SDK, so PlaidClient is a thin client on Laravel's Http facade. SyncPlaidItem pulls changes from /transactions/sync on an hourly schedule. Each page is applied as it arrives with idempotent upserts and deletes, and the cursor is saved only after the last page, so a failed sync replays without duplicates. A posted transaction deletes its pending predecessor by pending_transaction_id, since Plaid's own removal can arrive in a later sync. In tests every Plaid response is faked, and Http::preventStrayRequests() fails any real request.

Decisions

Decision 01Oct 21

A bank connection belongs to the user, not to a Book

  • Context: One login at a bank often holds a business account and a personal one.
  • Decision: The connection belongs to the user. Each account is assigned to a Book, or left unassigned.
  • Why: The books stay separate without linking the same bank twice.
Decision 02Oct 21

The cursor is saved last

  • Context: Plaid sends changes in pages, and a request can fail between two of them.
  • Decision: Every write is idempotent. The cursor is saved only after a full pass, and matching and alerts run after that.
  • Why: A failed sync starts over without duplicates, and an error in matching or alerts can't stop a sync.
Decision 03Oct 27

Manual choices are never overwritten

  • Context: After every sync, Green sets categories and links payments to bills.
  • Decision: A category I picked is never replaced by an automatic one. A payment I unlinked is never linked again.
  • Why: The next sync would otherwise undo the correction.
Decision 04Oct 28

No public registration

  • Context: Green stores Plaid access tokens.
  • Decision: Users are created from the command line. In production every user sets up an authenticator app, and access tokens are encrypted at rest.
  • Why: The app holds bank data.

What's next

  1. Later
    Plaid webhooks, so changes don't wait for the hourly sync
  2. Later
    Rules by merchant, and categorizing in bulk
  3. Later
    Reports per Book, and exports for tax time
  4. Later
    Manual accounts for banks Plaid doesn't support

Follow along

Updates are posted here as features are built. The repo is private.

I build API integrations for clients the same way. Work with me