How richard2606-hub/bukusaksi works
Buku Saksi is a Malaysian shop credit-book app: sellers record debts or bills, customers confirm through a one-time link, and either side can verify the customer’s hash-chained history. Other documented capabilities include importing old ledger photos, reminders, shop/account management, and sales measurement. The map follows documented workflows and sampled calls; some page-to-API wiring and unsampled subsystems are represented only where the README supports them.
Main entry points: store.ts Record store · route.ts Entry actions · account/page.tsx Shop account · [token]/page.tsx Shared record
Components 22
Seller workflows
- Snap bill
app/snap-bill/page.tsx - Ledger import
app/import/page.tsx - Debt entry
app/add-debt/page.tsx - Reminders
app/reminders/page.tsx - Shop measure
app/ukur/page.tsx - Customer list
app/customers/page.tsx
Customer records
- Shared record
app/c/[token]/page.tsx
Business services
- Photo reading
app/api/ocr/route.ts - Line parsing
app/api/parse/route.ts - Entry actions
app/api/entries/route.ts - Confirmation
app/api/confirm/route.ts - Reminder drafting
app/api/reminder/route.ts - Ukur analysis
app/api/ukur/route.ts - Record store
lib/store.ts - Hash chain
lib/chain.ts - Money totals
lib/totals.ts - ILMU client
lib/ilmu.ts
Shop and identity
- Shop account
app/account/page.tsx - Shop management
app/api/shop/route.ts - Owner access
lib/auth.ts
Other components
- Seller
- Customer
Connections 35
- Seller → Snap bill: records photo
- Seller → Ledger import: imports ledger
- Seller → Debt entry: records debt
- Snap bill → Photo reading: requests reading
- Ledger import → Photo reading: requests reading
- Debt entry → Line parsing: requests parsing
- Debt entry → Entry actions: submits record
- Photo reading → ILMU client: reads photo
app/api/ocr/route.ts - Line parsing → ILMU client: parses line
app/api/parse/route.ts - Entry actions → Record store: writes records
app/api/entries/route.ts - Entry actions → Money totals: computes total
app/api/entries/route.ts - Entry actions → Hash chain: computes balance
app/api/entries/route.ts - Entry actions → Shared record: issues confirm link
app/api/entries/route.ts - Customer → Shared record: opens link
- Shared record → Confirmation: confirms or disputes
- Confirmation → Record store: reads and appends
app/api/confirm/route.ts - Confirmation → Hash chain: seals result
app/api/confirm/route.ts - Shared record → Hash chain: verifies history
app/c/[token]/page.tsx - Seller → Reminders: drafts reminder
- Reminders → Reminder drafting: requests draft
- Reminder drafting → Record store: reads records
app/api/reminder/route.ts - Reminder drafting → ILMU client: drafts message
app/api/reminder/route.ts - Seller → Shop measure: views shop measure
- Shop measure → Ukur analysis: requests analysis
- Ukur analysis → Record store: reads shop data
app/api/ukur/route.ts - Ukur analysis → ILMU client: requests analysis
app/api/ukur/route.ts - Seller → Customer list: manages customers
- Customer list → Entry actions: views records
- Seller → Shop account: manages shop
- Shop account → Owner access: loads shop context
app/account/page.tsx - Shop account → Record store: checks shop records
app/account/page.tsx - Shop account → Shop management: manages shop
- Shop management → Owner access: checks owner access
app/api/shop/route.ts - Shop management → Record store: updates shop
app/api/shop/route.ts - Owner access → Record store: loads memberships
lib/auth.ts