How losshye/catatku works
Catatku is an offline-first personal-finance PWA: users enter income, expenses, or wallet transfers, then review balances, budgets, history, and reports from device-local data. The main flow runs from the app shell through screens and a reactive ledger hook to IndexedDB-backed repositories and domain calculations. Other documented capabilities include wallet/category management, recurring items, savings, debts, receipt scanning, security, and backup/sharing. Edges follow shown imports/calls or README statements; unsampled implementation details are omitted.
Main entry points: App.tsx App shell · transactions.repo.ts Transaction repository · useLedger.ts Reactive ledger hook · database.ts IndexedDB schema
Components 26
App shell
- React entry
src/main.tsx - App shell
src/App.tsx
Finance workflows
- Home screen
src/screens/HomeScreen.tsx - Transaction input
src/screens/InputScreen.tsx - Budgets and goals
src/screens/BudgetScreen.tsx - History and editing
src/screens/HistoryScreen.tsx - Reports
src/screens/ReportScreen.tsx - Wallet management
src/components/WalletSheet.tsx - Category management
src/components/CategorySheet.tsx - Receipt scanning
src/components/ReceiptScanSheet.tsx - Settings and sharing
src/components/SettingsSheet.tsx
Local data
- Reactive ledger hook
src/hooks/useLedger.ts - Ledger read model
src/db/ledger.ts - IndexedDB schema
src/db/database.ts - Transaction repository
src/db/transactions.repo.ts - Budget repository
src/db/budgets.repo.ts - Wallet repository
src/db/wallets.repo.ts
Domain logic
- Transaction rules
src/domain/transaction.ts - Rupiah arithmetic
src/domain/money.ts - Local date cycles
src/domain/date.ts
Security and portability
- Security repository
src/db/security.repo.ts - Encrypted vault
src/db/vault.ts - Backup and export
src/domain/export.ts - Shared wallet packs
src/domain/sharedPack.ts - PIN lock screen
src/components/PinLockScreen.tsx
Other components
- User
Connections 36
- User → React entry: uses
README.md - React entry → App shell: mounts
src/main.tsx - App shell → Home screen: routes
src/App.tsx - App shell → Transaction input: routes
src/App.tsx - App shell → Budgets and goals: routes
src/App.tsx - App shell → History and editing: routes
src/App.tsx - App shell → Reports: routes
src/App.tsx - App shell → Security repository: loads PIN
src/App.tsx - App shell → Encrypted vault: checks vault
src/App.tsx - App shell → PIN lock screen: locks app
src/App.tsx - Home screen → Reactive ledger hook: reads snapshot
src/screens/HomeScreen.tsx - Transaction input → Transaction repository: saves transaction
src/screens/InputScreen.tsx - Transaction input → Reactive ledger hook: reads snapshot
src/screens/InputScreen.tsx - Transaction input → Category management: opens picker
src/screens/InputScreen.tsx - Transaction input → Receipt scanning: opens scanner
src/screens/InputScreen.tsx - Budgets and goals → Budget repository: upserts budget
src/screens/BudgetScreen.tsx - Budgets and goals → Reactive ledger hook: reads snapshot
src/screens/BudgetScreen.tsx - History and editing → Reactive ledger hook: reads snapshot
src/screens/HistoryScreen.tsx - History and editing → Transaction repository: edits transactions
src/screens/HistoryScreen.tsx - Reports → Reactive ledger hook: reads snapshot
src/screens/ReportScreen.tsx - Home screen → Wallet management: opens wallets
src/screens/HomeScreen.tsx - Settings and sharing → Backup and export: serializes backup
src/components/SettingsSheet.tsx - Settings and sharing → Shared wallet packs: parses pack
src/components/SettingsSheet.tsx - Reactive ledger hook → Ledger read model: loads snapshot
src/hooks/useLedger.ts - Ledger read model → Encrypted vault: reads encrypted data
src/db/ledger.ts - Ledger read model → IndexedDB schema: reads tables
src/db/ledger.ts - Transaction repository → Transaction rules: validates input
src/db/transactions.repo.ts - Transaction repository → Encrypted vault: mutates vault data
src/db/transactions.repo.ts - Transaction repository → IndexedDB schema: writes records
src/db/transactions.repo.ts - Transaction repository → Local date cycles: gets cycle month
src/db/transactions.repo.ts - Transaction repository → Rupiah arithmetic: validates amounts
src/db/transactions.repo.ts - Budget repository → IndexedDB schema: stores budgets
src/db/budgets.repo.ts - Wallet repository → IndexedDB schema: stores wallets
- Security repository → IndexedDB schema: stores security
src/db/security.repo.ts - Security repository → Encrypted vault: uses vault
src/db/security.repo.ts - Encrypted vault → IndexedDB schema: stores ciphertext
src/db/vault.ts