Visualizing a Ledger with pgledger-ui

Lobsters Hottest Tools

Summary

pgledger-ui 是一个配套 pgledger 的开源可视化工具,打包为单个 Go 二进制,可查询 PostgreSQL 双分录账本并以可点击、信息密集的界面展示账户余额、转账流向与图表。

<p><a href="https://lobste.rs/s/gftix3/visualizing_ledger_with_pgledger_ui">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 11/19/26, 09:05 PM

# Visualizing a Ledger with pgledger-ui Source: [https://www.pgrs.net/2026/11/19/visualizing-a-ledger-with-pgledger-ui/](https://www.pgrs.net/2026/11/19/visualizing-a-ledger-with-pgledger-ui/) November 19, 20263 minute read I’ve been working on a ledger implementation in pure PostgreSQL called[pgledger](https://github.com/pgr0ss/pgledger)\. As I’ve written about previously,[I think more applications should use double\-entry ledgers](https://www.pgrs.net/2025/06/17/double-entry-ledgers-missing-primitive-in-modern-software/)\. However, once a ledger is integrated, it can be a bit hard to wrap your head around it visually\. What are the money flows? What are the main set of accounts per user? Why is the balance in this account not what I expect? In my work with companies, I’ve often tried to make the ledger more visual and understandable, either with a database dashboard like[Metabase](https://www.metabase.com/)or with custom in\-app code\. The same way that pgledger is meant to be a common, reusable ledger across applications, I thought we could have a common, reusable visualization tool\. And thus[pgledger\-ui](https://github.com/pgr0ss/pgledger-ui)was born\. ## Screenshot This is what it looks like to view a ledger account, showing the account details, the most common counterparty accounts, a chart of balance over time, and the detailed transfer entries: [![pgledger-ui account page](https://github.com/pgr0ss/pgledger-ui/blob/dbbf6ca48d477bbf80552cb1bd741eb96839d0d1/screenshots/light/03-account-entries.png?raw=true)](https://github.com/pgr0ss/pgledger-ui/blob/dbbf6ca48d477bbf80552cb1bd741eb96839d0d1/screenshots/light/03-account-entries.png?raw=true) ## Overview In general,`pgledger\-ui`is pretty simple\. It runs database queries and shows them in a webpage\. There are some charts and extra aggregate information\. And the whole thing is bundled into a single Go binary: ``` go run github.com/pgr0ss/pgledger-ui@latest --database-url postgres://user:pass@host:5432/dbname ``` Beyond this, there are a few main ideas baked into pgledger\-ui: ### Everything Is Linked and Clickable Often, when debugging an issue, you start by realizing a ledger account doesn’t have the balance you expect\. Then, you want to see the transfers in and out of that account\. And maybe you want to trace a given metadata key across transfers \(e\.g\. the`payment\_id`\)\. As you continue debugging, you may follow an account to a transfer to another account and so on\. With pgledger\-ui, each entity shows the related entities, and you can click on any of them to trace a flow\. This even includes metadata keys, so you can see related transfers which share the same key/value pair\. ### Search It should be easy to find what you want, so pgledger\-ui has a single, universal search box\. You can search by id, account name, idempotency key, metadata values, etc\., and it will show you all matches across all entities\. For example, if you name your accounts hierarchically \(e\.g\.`user01\.available`,`user01\.pending`, etc\.\) you can search for`user01`and see all accounts and transfers for that user\. ### Information Density I like interfaces which are information dense, without being overwhelming\. The goal is to show a lot of useful information in each page, and make it easy to scan for what you need\. ### Column\-Based Views Normally, when you query data from a database, you get row\-based results\. However, I find that visualizing ledgers in a columnar format is often more useful\. For example, say you are looking at all of the transfer entries for a given payment\. The results may come back like this: ``` kind | name | amount ------------------+------------------------+-------- payment_created | user1.external | -50.00 payment_created | user1.receivables | 50.00 payment_received | user1.receivables | -49.50 payment_received | user1.available | 49.50 refund_created | user1.available | -20.00 refund_created | user1.pending_outbound | 20.00 refund_sent | user1.pending_outbound | -20.00 refund_sent | user1.external | 20.00 ``` But a columnar view of that same data looks like: ``` kind | user1.external | user1.receivables | user1.available | user1.pending_outbound ------------------+----------------+-------------------+-----------------+------------------------ payment_created | -50.00 | 50.00 | | payment_received | | -49.50 | 49.50 | refund_created | | | -20.00 | 20.00 refund_sent | 20.00 | | | -20.00 ``` \(Example from the[pgledger reconciliation\.sql\.out script](https://github.com/pgr0ss/pgledger/blob/fee1aa05630f5af8cb3196749aa4d998162a9862/examples/reconciliation.sql.out#L148-L224)\) PostgreSQL calls this a[crosstab](https://www.postgresql.org/docs/current/tablefunc.html#TABLEFUNC-FUNCTIONS-CROSSTAB-TEXT)\(or[crosstabview](https://wiki.postgresql.org/wiki/Crosstabview)in psql\)\. A pivot table in a spreadsheet may be similar\. And it’s a common way to visualize a ledger[1](https://www.pgrs.net/2026/11/19/visualizing-a-ledger-with-pgledger-ui/#fn:1)\. This type of view exists in pgledger\-ui as well, especially if you’re tracing a flow via a metadata key: [![pgledger-ui trace crosstab view](https://github.com/pgr0ss/pgledger-ui/blob/dbbf6ca48d477bbf80552cb1bd741eb96839d0d1/screenshots/light/05-trace-crosstab.png?raw=true)](https://github.com/pgr0ss/pgledger-ui/blob/dbbf6ca48d477bbf80552cb1bd741eb96839d0d1/screenshots/light/05-trace-crosstab.png?raw=true) And you can separate the in/out flows, making it resemble a standard ledger T\-account view: [![pgledger-ui trace in/out view](https://github.com/pgr0ss/pgledger-ui/blob/dbbf6ca48d477bbf80552cb1bd741eb96839d0d1/screenshots/light/06-trace-inout.png?raw=true)](https://github.com/pgr0ss/pgledger-ui/blob/dbbf6ca48d477bbf80552cb1bd741eb96839d0d1/screenshots/light/06-trace-inout.png?raw=true) ## Feedback Please Please check out[pgledger\-ui](https://github.com/pgr0ss/pgledger-ui), and I’d love to hear what you think, especially if you work with pgledger or other ledgers today\. Are there other useful visualizations or tools you’ve seen in this space? And if pgledger\-ui is something that you are interested in using, please let me know\.

Similar Articles

@GYLQ520: Stocks, funds, crypto assets, cash management scattered across different apps. To view overall assets, you have to open each app and manually compile data in spreadsheets, which is time-consuming and makes it hard to see the big picture. Wealthfolio, an open-source and privacy-focused personal wealth management tool with 8600 Stars, available on both desktop and mobile.

X AI KOLs Timeline

Wealthfolio is an open-source, privacy-focused personal wealth management tool that supports local data storage, enabling unified management of multiple asset types such as stocks and funds, along with performance analysis.

@QingQ77: A system-tray API balance dashboard that is lightweight and local-first, periodically showing the balances and remaining percentages for various AI providers — no need to open web pages and check them one by one. https://github.com/ANDRETRIPOL/pico-pu-api-control…

X AI KOLs Timeline

PICO PU API Control is a system-tray API balance dashboard that supports providers such as DeepSeek and OpenRouter. It is lightweight and local-first, periodically displaying balances and remaining percentages.

Create and Share a Dashboard in ChatGPT

YouTube AI Channels

OpenAI demonstrated a new dashboard feature in ChatGPT: view and edit charts, ask follow-up questions about the reasons behind the data, set up one-time or automatic refreshes, and share it with your team through Sites.