Ledgr
An asset lending app for schools and small offices. It grew out of an inventory system I built for a kindergarten, rebuilt from scratch on my own time with lending at the center. In November 2026 I redesigned it around three switchable styles.
- Client
- Personal project
- When
- Oct 2026 - Nov 2026 / Personal
- Role
- Fullstack, solo: product, design, web app, and API.
- Stack
- React Router, TypeScript, TanStack Query, Tailwind CSS, GSAP, Hono, Postgres, Drizzle, Cloudflare Workers
01
Where it started
In mid-2026 I built an asset inventory system for a kindergarten in Central Java. Staff kept their assets in a paper ledger, and the brief was to move it online: a register of every item, a borrowing log, purchase requests, and printable reports in the format the school already used. It's listed on this site as Asset Inventory System.
After the handover, one part stayed on my mind. Lending was what staff did every day, and in that build it was a log. Someone wrote down who took what, and someone marked it returned. Nobody approved a loan, and the app couldn't tell whether an item was already promised to someone else. The brief didn't ask for that, so I didn't build it.
Ledgr is my answer to what the same job looks like when lending is the core of the app. The school owns the code I wrote for them, so Ledgr is a separate codebase with its own name, design, data model, and demo data. What carried over is what I learned on the job, like how staff look for things and which parts of the paperwork matter. So did the general patterns I bring to most dashboards: auth, validated forms, paginated tables.
02
What changed
Ledgr isn't the school's app with more features. Some parts went further, and some I left out on purpose.
| Feature | School build | Ledgr |
|---|---|---|
| Lending | A log of who borrowed what and whether it came back | Request, approve, hand out, return, with the item's condition recorded on return |
| Stock | Not reserved per loan | Approving reserves units, and the database refuses to overbook |
| Finding an item | Search the asset list | Scan the QR label on the item with any phone camera |
| Custom fields | Per asset group, under a four-level hierarchy | Per category, checked by the server |
| History | Soft delete and restore | A timeline of every change on each asset and loan |
| Languages | Indonesian | English and Indonesian |
| Automated tests | None | API tests on real Postgres, browser tests for the loan flow |
| Reports | PDF and Excel, laid out like the school's paperwork | CSV export |
| Purchase requests | With priority and review status | Not included |
The last two rows go the other way. The school needed reports that matched its paperwork and a way to ask for new equipment, so its build has both. Ledgr is about lending, and I'd rather leave those out than ship thin copies of them.
03
It opens on what needs doing
The first screen, Today, lists loan requests waiting for approval, oldest first, then anything past its due date, then what's due back soon. Four totals run along the top and the charts sit underneath, for when someone wants the overview.
In Graphite, the default style, Today works like an inbox: the list is on the left and the selected loan is open beside it. J and K move through the list, and A takes the next step. An admin can clear the morning's requests without touching the mouse.
The loans list has a tab for each step: waiting approval, ready to hand out, checked out, overdue. Search, filters, sorting, and the page number live in the URL, so any view can be sent as a link and survives a reload.
04
Three styles, one product
Ledgr launched with one look: warm paper, ruled lines, a single green. When I went back to redesign it I explored several directions, and three were good enough to keep. Visitors switch between them from the palette button, and the choice is remembered.
Graphite is monochrome, with ink for actions and blue only for what's selected. Paper is the original register, with marks that read as rubber stamps. Peony is a black frame around off-white tiles and one pink, and it draws every unit the school owns as a dot, pink when it's out. Red means overdue or destructive in all three.
The styles share routes, data, permissions, and wording. An attribute on the page picks one, and color, type, corner radius, and control size are tokens, so forms, tables, and dialogs are written once. Only Today and the front page have a layout per style. A small script sets the style before first paint, so a returning visitor doesn't see the default flash by.
The front page has a loan you can approve before signing in. GSAP handles its opening and scroll motion on the same clock as Lenis, and reduced motion skips straight to the final state. The app itself never loads GSAP.


05
Loans as a state machine
A loan moves through four steps: requested, approved, checked out, returned. A request can also be rejected, and a loan can be cancelled any time before it leaves the shelf.
Those rules live in one small module that the API and the web app share. The API refuses any move the module doesn't allow. The web app asks the same module which buttons to show, so each person sees only the actions their role and the loan's current step permit. Changing a rule means changing one file.
Every step is written to the loan's history with the name of whoever took it, so anyone can see who approved a loan and when.
06
Two admins, one projector
Approving a loan reserves units. The hard case is two admins approving at the same moment when one unit is left: each checks, sees one free, and approves.
Each asset keeps a count of units already promised. Approval adds to that count with a single UPDATE that only succeeds if the new total stays within the asset's quantity. Postgres applies concurrent updates to the same row one at a time and re-checks the condition against the latest value, so only the first approval goes through. A test fires five approvals at once for two remaining units and checks that exactly two win. A CHECK constraint on the table backs this up.
Ledgr talks to Neon over HTTP, and that driver can't hold a transaction open across several statements. So each loan step is one SQL statement built from chained CTEs: lock the loan if its status still allows the move, reserve or release stock, update the status, write the history row. Either all of it happens or none of it does. A double-clicked Approve gets a 409 instead of a second approval.
- Lock the loan
- Reserve stock
- Update status
- Write history
Any step fails: nothing is saved, and the request gets a 409
07
Labels on the shelf
Every asset gets a code like AV-0001, numbered per category. Admins print a sheet of QR labels for whichever assets they pick. Scanning a label with an ordinary phone camera opens that asset's page, and Scan a label does the same from inside the app.
Someone holding a projector can see whether it's already promised to someone before handing it over, without searching for it.
Each category defines its own fields, like a brand and whether it's wireless for audio and visual gear. The server checks values against that definition, so a form can't save a field the category doesn't have.
08
A demo strangers can use
Anyone can try Ledgr without an account: pick admin, staff, or viewer on the sign-in page. That puts strangers in front of a shared database, so the demo has limits.
The API only answers requests from the Ledgr web app's origin. Sign-in goes through Cloudflare Turnstile, and each IP has rate limits, tighter for writes and sign-ins. The auth library comes with many endpoints, including password changes and admin tools. The demo exposes three (sign in, sign out, and session), so a visitor can't lock the shared accounts.
Anything a visitor writes that contains profanity or a link is refused. Every two hours the database is wiped and seeded again.
09
How it's tested
The API tests run against PGlite, a build of Postgres that runs inside the test process. CTEs, row locks, and check constraints behave the way they do in production, with no Docker and no network.
Playwright starts the real API on a throwaway database alongside the web app. A staff member requests a loan, an admin approves it, hands it out, and checks it back in. The suite also tries to overbook an asset, checks that a viewer never sees a write button, switches the language to Indonesian, changes style and reloads to see that it stuck, and opens an asset from its QR link.
TypeScript checks the translations as well. If the Indonesian dictionary is missing a key from the English one, the build fails.
Want something like this for your school or office, or a walk through how it works? Email me.