How darwintjoe/fazai works
FAZAI is an offline-capable, browser-based accounting PWA. Users unlock with a PIN, record or import transactions, and review balances and reports; the double-entry ledger and IndexedDB provide its core accounting layer. AI-assisted entry and receipt/statement parsing, contacts, POS imports, and administration are supporting workflows. Edges are limited to relationships shown in excerpts, SOURCE INDEX references, or README documentation; unsampled components are represented at their existing directory paths where needed.
Main entry points: page.tsx App shell · fazai-db.ts Local accounting data · report-viewer.tsx Report viewer · ai AI API routes
Components 24
App experience
Accounting and reports
- Transaction entry and history
src/components/fazai/transaction-form.tsx - Transaction history
src/components/fazai/history.tsx - Contacts
src/components/fazai/contacts.tsx - Report viewer
src/components/fazai/report-viewer.tsx - Double-entry ledger
src/lib/ledger-engine.ts
AI and imports
- AI assistant
src/components/fazai/ai-chat.tsx - AI API routes
src/app/api/ai - AI provider adapters
src/lib/ai-provider.ts - Receipt capture and OCR
src/components/fazai/receipt-ocr.tsx - Statement import
src/components/fazai/statement-import.tsx - Account keyword mapping
src/lib/keyword-map.ts
Administration and integrations
- Administration
src/components/fazai/admin-panel.tsx - POS import and tracking
src/lib/pos-import.ts - Backup and restore
src/components/fazai/admin-backup.tsx
Local platform
- Local accounting data
src/lib/fazai-db.ts - App state
src/lib/app-store.ts - Authentication state
src/lib/auth-store.ts - Offline service worker
public/sw.js - Date and number formatting
src/lib/format.ts - Translations
src/lib/i18n.ts
Other components
- User
Connections 27
- User → App shell: uses
- App shell → PIN login: shows
src/app/page.tsx - App shell → Dashboard: renders
src/app/page.tsx - App shell → Transaction entry and history: renders
src/app/page.tsx - App shell → Transaction history: renders
src/app/page.tsx - App shell → Report viewer: renders
src/app/page.tsx - App shell → AI assistant: renders
src/app/page.tsx - App shell → Administration: renders
src/app/page.tsx - PIN login → Authentication state: authenticates
src/app/page.tsx - Transaction entry and history → Double-entry ledger: records entries
- AI assistant → Double-entry ledger: creates transactions
src/components/fazai/ai-chat.tsx - Double-entry ledger → Local accounting data: reads and writes
src/lib/ledger-engine.ts - Report viewer → Double-entry ledger: generates reports
src/components/fazai/report-viewer.tsx - Report viewer → Date and number formatting: formats values
src/components/fazai/report-viewer.tsx - Report viewer → Contacts: renders statement
src/components/fazai/report-viewer.tsx - Transaction history → Local accounting data: reads transactions
src/components/fazai/history.tsx - AI assistant → AI API routes: requests assistance
- AI API routes → AI provider adapters: calls provider
src/app/api/ai/chat/route.ts - AI API routes → Account keyword mapping: uses mappings
src/app/api/ai/chat/route.ts - Receipt capture and OCR → AI API routes: requests parsing
- Receipt capture and OCR → Account keyword mapping: uses mappings
src/components/fazai/receipt-ocr.tsx - Statement import → AI provider adapters: uses AI provider
src/components/fazai/statement-import.tsx - Statement import → Local accounting data: imports records
src/components/fazai/statement-import.tsx - Administration → Local accounting data: manages data
- Backup and restore → Local accounting data: exports and restores
- POS import and tracking → Local accounting data: imports sales
- User → Offline service worker: uses offline app