Stocks Tracker

A small webapp that gives me a single view of my positions across brokerages, with drift against target allocation surfaced at a glance.

At a glance

Problem
Seeing my real allocation meant opening each brokerage and doing cross-account math in my head, which I never trusted.
My role
I designed and built it in Claude Code, and kept the brokerage connection read-only and the app on localhost.
Result
One page shows every position across my accounts, grouped by the real underlying holding, and flags anything that has drifted from its target.
drift vs target within band
  1. holding now target drift
  2. Alpha 32% 30% +2.0pp
  3. Beta 18% 20% −2.0pp
  4. Gamma 14% 15% −1.0pp
  5. Delta 12% 10% +2.0pp
  6. Epsilon 14% 15% −1.0pp
  7. Cash 10% 10% 0.0pp

An animated story of the Stocks Tracker: a pile of brokerage tabs, a one-way read-only feed, cleaning layers, an equivalence layer that merges one fund under several wrappers, three versions, the rails and tests, and one honest page.

How it got built · a 90 second story

At a glance

Problem
Seeing my real allocation meant opening each brokerage and doing cross-account math in my head, which I never trusted.
My role
I designed and built it in Claude Code, and kept the brokerage connection read-only and the app on localhost.
Result
One page shows every position across my accounts, grouped by the real underlying holding, and flags anything that has drifted from its target.
Under the hood, for the technical folks

I built this as a FastAPI backend in Claude Code, talking to a brokerage-aggregator API in read-only mode, with a React + Vite frontend that renders the holdings grouped by ticker and the drift against a target allocation. The backend caches the brokerage responses in SQLite so the page is fast even when an upstream account is slow, and a ticker-equivalence layer sits between fetch and render so the same underlying instrument under different wrappers (Class A versus Class B, an ETF mirror, share-class differences inside the same fund) groups into one row instead of three.

The webapp is localhost-only by design: nothing about a personal-finance tool needs to be reachable on the open internet. The aggregator integration uses a read-only connection that has no permission to place orders, transfer funds, or change account state; it can only see balances and positions. Targets and equivalence rules live in a config file outside the database so a tweak doesn’t require a migration, and the cache has a freshness timestamp visible on the page so a stale balance never reads as live. The Playwright suite runs in CI on a Windows runner as well as locally, so the platform-specific quirks surface there rather than the first time I open the page.

Technical highlights:

  • A read-only brokerage-aggregator integration scoped to balance + position data only: no order placement, no fund transfer, no account modification can happen through this app
  • A ticker-equivalence layer between the raw brokerage response and the render layer, so the same underlying instrument under different wrappers groups into one row
  • SQLite cache of brokerage responses with a freshness timestamp visible on the page, so a stale balance never reads as live
  • A target-allocation config and a drift calculator that flags any holding more than a small threshold off target
  • Rebalance suggestions sized to a stable chunk so the tool doesn’t ask for a different trade every time prices wiggle
  • A Playwright suite that runs locally and on a Windows CI runner, so a Windows-only quirk fails a CI run before it can reach the page I use

All mockup data on this page is invented: no real positions, no real brokerages, no real symbols, no real dollar values. The Greek-letter labels on the chart are placeholders.


What I wanted

I wanted one view of where my money actually is. Seeing my real allocation meant opening each brokerage’s web app, eyeballing the percentages and doing the cross-account math in my head, which I never trusted. I wanted a small webapp on my own machine that does the math for me: pull live balances over a read-only connection, group them by the underlying instrument across accounts, and show how far my allocation has drifted from the targets I set.

How I got it

I built a small FastAPI service that talks to a brokerage-aggregator API in read-only mode, with a React frontend. The first version was a flat table; the second added the donut and a per-ticker target column; the third added rebalance suggestions, on a chunk size stable enough that I’m not playing whack-a-mole every week.

The hard part wasn’t the visuals, it was the data shape. The same underlying can sit in several accounts under different ticker classes (Class A versus Class B, an ETF that wraps the same thing twice over), and a naive grouping gets the percentages wrong. So the brokerage data stays raw, ticker equivalence is its own layer, and its rules live in a config file I can tune without touching the fetch code.

What it does

With a read-only token it pulls every position across the accounts I’ve connected, merges the tickers that are the same instrument under different wrappers, and shows a donut of where my allocation is next to a table of where it should be. Anything more than a couple of percentage points off target flags itself. The webapp only ever runs on localhost, and the brokerage connection only ever reads.

Why it matters to me

Before this, rebalancing meant four browser tabs and a spreadsheet that always drifted. The tracker doesn’t replace the judgment (I still pick the targets and decide what to trim), but it gets the math out of my head and onto a page I can actually look at. It’s a tool I rely on with my own positions, which is also why everything sensitive about it stays invisible from the outside.

What I learned

The lesson that kept repeating itself was that data normalization is the whole game when you’re aggregating from different systems. The donut and the table were a one-day job; the ticker-equivalence layer that makes them honest took most of the work. Every time I added another account or another wrapper class, the equivalence rules needed to grow, and the shape that finally worked (tune the rules in a config file without touching the fetch code) only emerged because I kept the layers separate from the start. The takeaway I’d underline for any aggregation tool is that the part that earns trust is the cleaning layer, not the visualization sitting on top of it.

What I learned
Trust in a tool I'd point at my own money turned out to be mostly about what I kept out: read-only access, no public surface, nothing on the page I wouldn't show over my shoulder. The rest of the design has to live inside those rails.