StackMoth/Work/Ledgerline

Personal infrastructure

An owner-only dashboard with no authentication code of its own

Ledgerline is my own finance and network dashboard. I chose the architecture, the stack and the hosting, and the most useful decision was about what not to build.

Scale
20,500 lines, 17 tables, 31 tests
Runtime
Cloudflare Workers, Next.js via vinext
Data
Cloudflare D1
Authentication
Cloudflare Access, and nothing else
Access
Private, owner only

All case studies

The authentication boundary is not in the application

There are no passwords, no cookies and no session state in this codebase, because the application is never reachable by anyone Access has not already identified.

Cloudflare Access sits in front of the Worker and is the only authentication boundary. The application does not implement a login, and it cannot be tricked into a weak one, because it has none to weaken. Logout is delegated to the Access endpoint. The Worker fails closed if the Access identity or the configured owner email is missing, so a misconfiguration produces a locked door rather than an open one.

For a single-owner application this removes an entire category of vulnerability in exchange for a hard dependency on the platform. That trade is worth naming, and for a private dashboard it is clearly the right one.

Money is an integer

Amounts are stored as integer minor units and converted to LKR only at the API boundary. Dates and timestamps are ISO strings, booleans are checked integers, and non-currency decimals are the only place a real number is allowed.

Deploys are gated

The build is verified before it ships and deployment runs behind a preflight script, so a broken build fails at my terminal rather than at the edge. Migrations have check, status and apply commands, which matters when the datastore is D1 and there is no second chance at a bad migration.

Next case study

Rainfall tracker