Bazaar Ledger 如何構建商店離線優先 Flutter 記帳應用:沒有網絡的真正代價
Building an offline-first Flutter ledger for shops: what "no internet" really costs
Bazaar Ledger 是一款面向商店的記帳應用,支援 Android 並配有 Windows 配套程式;所有帳單、付款和庫存變動都先寫入手機。帳目採用複式記帳;啟用雲端時,資料會先在手機上加密,伺服器不會取得解密密鑰,因此無法搜尋或分析帳目。選用的 AI 助手使用 Anthropic 的 Claude,只會收到單次請求所需資料。
I built Bazaar Ledger, a shop bookkeeping app for Android with a Windows companion, and I want to share what offline-first did to the design.
The rule. Every bill, payment and stock movement is written to the phone first. The network is optional, so there is no loading spinner between a customer and a receipt.
The ledger underneath. Billing screens are friendly, but every sale, payment, purchase and expense posts to double-entry accounts. That is why the 100+ reports agree with each other: they are different views of one ledger.
A server that cannot read. If a shop turns on the optional cloud, the books are sealed on the phone before upload, with keys the server never receives. The cost is real: the server cannot search, repair or analyse a shop's data, so every feature that needs reading has to be opt-in and done on the device.
Posted bills are never edited in place. A correction is a cancelled bill plus a new corrected one, both kept, behind a PIN. It is more work to build and far easier to audit.
The AI assistant is optional and narrow. Simple commands are parsed on the phone. When the phone is unsure, the assistant (Anthropic's Claude, through our server) gets only what that one request needs, never the whole book. You review and save by default.
The app is free for one whole shop. I would like feedback from other Flutter developers on two things: testing sync conflicts when two counters sell the last unit offline, and how you handle thousands of ledger rows on low-end phones.
Play: https://play.google.com/store/apps/details?id=pk.bazaarledger
來源:DEV Community · dev.to