Design & engineering

the dashboard OF THE Jan balances in real time

A finance dashboard rebuilt from the ground up: live ledgers, pages three times faster, and half the support tickets it used to create.

  • Next.js
  • TypeScript
  • PostgreSQL
  • Charts
  • Design system
read the case study

What Ledgerly is

Ledgerly is the dashboard a finance team lives in: every account, transaction and balance across a group of companies, in one place. The old version was a tangle of server-rendered pages and overnight batch jobs, so the numbers on screen were always yesterday's.

We rebuilt it as a Next.js app on top of an event ledger. Balances update the moment money moves, pages load three times faster, and the questions that used to arrive as support tickets are now answered by the screen itself.

faster page loads
3×
support tickets
−50%
from payment to balance
<1s
The Ledgerly overview: balance cards, a cash-flow chart, a spending breakdown and the latest transactions
The overview: balances, cash flow and the latest transactions, all streaming in as they happen.

A ledger that streams

Every movement of money is an append-only event in ledger_events. Balances are never edited, only derived, so any number on screen can be traced back to the events that produced it.

Postgres logical replication feeds those events to a small stream service, which pushes them over WebSockets to every open dashboard. The client folds each event into its local state, so a payment shows up in the balance, the chart and the table at the same moment.

ledger-stream.ts
// Fold each ledger event into the balances the dashboard shows.
export function applyEvent(balances: Balances, e: LedgerEvent): Balances {
  const account = balances[e.accountId] ?? { cents: 0, updatedAt: e.at };
  return {
    ...balances,
    [e.accountId]: { cents: account.cents + e.amountCents, updatedAt: e.at },
  };
}

stream.on("event", (e) => setBalances((b) => applyEvent(b, e)));

Making it fast

The old dashboard rendered every table on the server and shipped it whole. We moved to streamed server components: the shell and the numbers that matter most arrive first, and the heavy tables fill in behind them.

Charts switch to canvas once a series passes a few thousand points, and long tables are virtualised, so a year of transactions scrolls as smoothly as a week.

Month-end close used to take us a week of exports and spreadsheets. Now it's an afternoon in Ledgerly.

Finance operations lead, Ledgerly

Design decisions

Numbers first. Every screen leads with the figure someone came to check; charts and tables support it instead of competing with it.

Derived, never edited. Balances are computed from events, so there is exactly one way for a number to change and one place to look when it seems wrong.

Fast by default. Every page has a performance budget checked in CI. A change that makes the overview slower than 1.5 seconds fails the build.