How ownertest-byte/kuventory works
KUVENTORY is a browser-based, real-time restaurant inventory system backed by Supabase. Users sign in, enter a protected application shell, and manage stock, daily counts, reports, notifications, and settings. Inventory operations cover catalog items and stock mutations; daily inventory provides a separate date-based count and finalization workflow; reporting and administration form additional product branches. Shared authentication and Supabase access support these workflows. The README documents PostgreSQL, Auth, RLS, and Edge Functions; sampled source confirms client-side Supabase access, but does not establish every integration or data relationship.
Main entry points: App.tsx Route coordinator · index.ts Inventory data operations · ReportsLibraryPage.tsx Reports library · AuthContext.tsx Authentication context
Components 30
Access and shell
- Route coordinator
src/app/App.tsx - Authentication context
src/features/auth/context/AuthContext.tsx - Login experience
src/features/auth/pages/LoginPage.tsx - Protected-route guard
src/features/auth/components/RequireAuth.tsx - Application shell
src/components/layout/AppLayout.tsx - Command palette
src/components/layout/CommandPalette.tsx
Inventory operations
- Item catalog
src/features/inventory/pages/ItemsCatalogPage.tsx - Item details
src/features/inventory/pages/ItemDetailsPage.tsx - Inventory overview
src/features/inventory/pages/InventoryLandingPage.tsx - Inventory data operations
src/features/inventory/api/index.ts - Item editor
src/features/inventory/components/ItemFormModal.tsx - Stock mutations
src/features/inventory/hooks/useStockMutations.ts - Stock batches
src/features/inventory/pages/StockBatchesPage.tsx - Stock history
src/features/inventory/pages/StockHistoryPage.tsx
Daily counting
- Daily inventory screen
src/features/daily-inventory/pages/DailyInventoryPage.tsx - Daily inventory state
src/features/daily-inventory/hooks/useDailyInventory.ts - Daily count operations
src/features/daily-inventory/api/index.ts
Reports and alerts
- Reports library
src/features/reports/pages/ReportsLibraryPage.tsx - Report detail
src/features/reports/pages/ReportViewPage.tsx - Report data operations
src/features/reports/api/reports.ts - Report exports
src/features/reports/export - Notification center
src/features/inventory/pages/NotificationCenter.tsx
Shared platform
- Settings and administration
src/features/admin/pages/AdminPage.tsx - Category management
src/features/categories/pages/CategoriesPage.tsx - Supplier directory
src/features/inventory/components/SuppliersDirectoryTab.tsx - Realtime synchronization
src/features/inventory/hooks/useRealtimeSync.ts - Database keepalive
src/lib/keepalive.ts - Supabase client
src/lib/supabase.ts
Other components
- Restaurant user
- Supabase platform
Connections 35
- Restaurant user → Route coordinator: uses
src/app/App.tsx - Route coordinator → Authentication context: provides auth
src/app/App.tsx - Route coordinator → Login experience: routes to
src/app/App.tsx - Route coordinator → Protected-route guard: protects routes
src/app/App.tsx - Route coordinator → Application shell: mounts shell
src/app/App.tsx - Route coordinator → Daily inventory screen: routes to
src/app/App.tsx - Route coordinator → Item catalog: routes to
src/app/App.tsx - Route coordinator → Item details: routes to
src/app/App.tsx - Route coordinator → Inventory overview: routes to
src/app/App.tsx - Route coordinator → Reports library: routes to
src/app/App.tsx - Route coordinator → Report detail: routes to
src/app/App.tsx - Route coordinator → Notification center: routes to
src/app/App.tsx - Route coordinator → Settings and administration: routes to
src/app/App.tsx - Route coordinator → Realtime synchronization: starts sync
src/app/App.tsx - Route coordinator → Database keepalive: starts heartbeat
src/app/App.tsx - Authentication context → Supabase client: uses
src/features/auth/context/AuthContext.tsx - Authentication context → Supabase platform: auth and profile queries
src/features/auth/context/AuthContext.tsx - Application shell → Authentication context: reads session
src/components/layout/AppLayout.tsx - Application shell → Command palette: opens palette
src/components/layout/AppLayout.tsx - Command palette → Inventory data operations: queries items
src/components/layout/CommandPalette.tsx - Inventory overview → Inventory data operations: loads inventory
src/features/inventory/pages/InventoryLandingPage.tsx - Inventory data operations → Supabase client: uses
src/features/inventory/api/index.ts - Inventory data operations → Supabase platform: reads and writes stock
src/features/inventory/api/index.ts - Item editor → Supplier directory: loads supplier options
src/features/inventory/components/ItemFormModal.tsx - Daily inventory screen → Daily inventory state: uses count state
src/features/daily-inventory/pages/DailyInventoryPage.tsx - Daily inventory state → Daily count operations: fetches and finalizes
src/features/daily-inventory/hooks/useDailyInventory.ts - Daily count operations → Supabase platform: reads and writes counts
src/features/daily-inventory/api/index.ts - Reports library → Report data operations: loads report data
src/features/reports/pages/ReportsLibraryPage.tsx - Reports library → Inventory data operations: queries inventory
src/features/reports/pages/ReportsLibraryPage.tsx - Report data operations → Supabase platform: queries reports
- Reports library → Report exports: exports reports
- Database keepalive → Supabase client: uses
src/lib/keepalive.ts - Database keepalive → Supabase platform: pings database
src/lib/keepalive.ts - Realtime synchronization → Supabase client: uses
src/features/inventory/hooks/useRealtimeSync.ts - Settings and administration → Supabase platform: manages settings