Architecture
How Ledgerline works
Ledgerline loads usage, prices it when you read it, and turns it into revenue, margin, invoices and alerts. This page shows the parts and the five paths that data takes between them.
Coming soon. Not yet available to buy.
Scroll the diagram sideways to see all of it.
The 5 paths
Usage comes in
The usage sync loads one day at a time, for each account and SKU, and the vendors' counts for the same days. An admin starts a load with Refresh now, which loads today and the two days before it. The sync also has a route that a scheduler can call once a day. The demo has no scheduler.
Your team changes prices
Admins and editors set a price for each account and SKU: flat, graduated, whole-volume slab, or a bundle of SKUs. Each price has an effective-from date, so earlier usage keeps the price it had. Vendor costs are for admins only. The server checks the person's role before each change, and writes the change, with its old and new values, to the audit log.
Revenue and margin are worked out when you read them
Ledgerline does not store revenue. When a page asks for it, the revenue calculation prices the usage with the price in effect on each date, and subtracts vendor cost to give margin. Usage with no price is flagged. After a price change or a new load of usage, Ledgerline clears its cached figures, so pages show the new numbers. The reconciliation page compares your usage counts with each vendor's, day by day.
Usage becomes an invoice
A draft invoice for an account and billing period comes from the period's priced usage and its approved manual entries. Usage with no price is flagged and left out. Finalizing stores the invoice and its lines with a number, so a later price change does not change a finalized invoice. Each invoice exports as PDF or CSV.
Alerts list what changed
After usage loads, a daily check compares each account's usage with the average for the same weekday over the previous four weeks. It flags drops in volume, spikes in failures, new SKUs and unpriced usage, and it also lists good news. Admins and editors see the alerts in the app.
The parts
- Usage source
- Where usage comes from: one row per account, SKU and day, with its counts. In the demo, usage is generated from the existing accounts and SKUs.
- Vendors
- The providers whose services you resell. Their usage counts load for each day, so you can compare them with yours. In the demo, they are generated from your own usage.
- Usage sync
- Loads usage for one date at a time. It replaces that date's rows in one transaction, so loading a date again gives the same result. It matches each row to a SKU by the SKU's code, and holds a row with an unknown code for review.
- Database
- One database holds usage, prices and bundles, vendor costs, manual entries, invoices, and an audit log of each change.
- Revenue calculation
- Prices each day's usage with the price in effect on that date, and subtracts vendor cost to give margin, for each account and SKU. Graduated and slab prices are worked out over the whole billing period.
- Invoices
- Builds a draft invoice for each account and billing period. Finalizing stores the invoice and its lines with a number. Each invoice exports as PDF or CSV.
- Alerts
- A daily check that compares each account's usage with its recent baseline and lists what changed.
- Your team
- People use Ledgerline in a web browser. Admins can change everything. Editors can change prices and manual entries. Members can only read.
Built with
- Web app
- Next.js and React, rendered on the server
- Database
- Postgres
- Money
- Decimal arithmetic, not floating point
About the demo
- The demo uses a fictional company. Its accounts, SKUs, vendors and usage are generated sample data.
- The usage source and the vendors' counts are simulated. The demo calls no outside service.
- The demo has no real sign-in. You enter as a sample admin or member.
- The demo sends no email.
- Ledgerline holds one company's data. It has no setup for several companies.