How ralph-web-dev/sari-sari-app works
TindahanKo is an offline-first store-management app for sari-sari store owners. Owners sign in, manage inventory, record cash or credit sales, track customer debts and payments, and review reports and alerts. Screens use a local SQLite database; the documented sync engine pushes local changes to Supabase when available. The graph preserves documented barcode scanning, PDF export, notifications, and profile/settings capabilities, but their implementation details were not sampled. Arrows are limited to relationships shown in excerpts, the source index, or README.
Main entry points: index.ts SQLite database · products.tsx Inventory management · supabase.ts Supabase client · sync.ts Background sync
Components 22
App experience
- App shell
src/app/_layout.tsx - Sign-in
src/app/index.tsx - Profile and settings
src/app/(screens)/profile.tsx - Dashboard
src/app/(tabs)/dashboard.tsx - User profile state
src/context/UserProfileContext.tsx
Store operations
- Inventory management
src/app/(tabs)/products.tsx - Product forms
src/app/product/add.tsx - Product details
src/app/product/[id].tsx - Point of sale
src/app/(tabs)/sales.tsx - Sales history
src/app/(tabs)/sales-history.tsx - Utang management
src/app/(tabs)/utang.tsx - Customer records
src/app/utang/add-customer.tsx - Debt details
src/app/utang/[id].tsx - Payment recording
src/app/utang/record-payment.tsx
Insights and alerts
- Financial reports
src/app/(tabs)/reports.tsx - Notifications
src/app/(screens)/notifications.tsx
Local data
- SQLite database
src/db/index.ts - Store data schema
src/db/schema.ts
Cloud and identity
- Background sync
src/lib/sync.ts - Supabase client
src/lib/supabase.ts - Supabase services
Other components
- Store owner
Connections 23
- Store owner → Sign-in: signs in
- Sign-in → Supabase client: authenticates with
src/app/index.tsx - Supabase client → Supabase services: connects to
- App shell → User profile state: provides
src/app/_layout.tsx - User profile state → Supabase client: fetches user
src/context/UserProfileContext.tsx - App shell → Background sync: starts sync
src/app/_layout.tsx - Background sync → SQLite database: reads and updates
src/lib/sync.ts - Background sync → Supabase client: pushes changes
src/lib/sync.ts - Inventory management → Product forms: opens forms
- Inventory management → Product details: opens details
- Inventory management → SQLite database: manages products
- Point of sale → SQLite database: records sales
src/app/(tabs)/sales.tsx - Utang management → Customer records: manages customers
- Utang management → Debt details: opens debt details
- Debt details → Payment recording: records payment
- Payment recording → SQLite database: stores payments
src/app/utang/record-payment.tsx - Financial reports → SQLite database: reads store data
src/app/(tabs)/reports.tsx - Notifications → SQLite database: reads alerts
src/app/(screens)/notifications.tsx - SQLite database → Store data schema: uses schema
src/db/index.ts - Profile and settings → User profile state: uses profile state
- Financial reports → Store owner: exports PDF
- Inventory management → Store owner: supports barcode scanning
- Notifications → Store owner: alerts on stock and debt