How xxomelxx/web-based-capstone-project works
This is a Sari-Sari POS web application: staff use dashboard screens for checkout, inventory, shifts, credit, and reporting, with server API routes handling business data. The client also supports offline use through local caches and queued actions that synchronize with the server. The map preserves management and reporting branches visible in the tree. Evidence is limited to the README, source index references, and excerpts; connections among unsampled screens and routes are omitted unless documented there.
Main entry points: inventory.ts Client API helpers · api Business API routes · POSClient.tsx Point of sale · sync-engine.ts Sync engine
Components 20
POS screens
- Point of sale
app/(dashboard)/pos/POSClient.tsx - Dashboard
app/(dashboard)/dashboard/DashboardClient.tsx - Product management
app/(dashboard)/products/ProductsClient.tsx - Reports
app/(dashboard)/reports/ReportsClient.tsx - Credit accounts
app/(dashboard)/credit/CreditClient.tsx - User management
app/(dashboard)/users/UsersClient.tsx
Client services
- Client API helpers
lib/client/api/inventory.ts - POS API helper
lib/client/api/pos.ts - Shift API helper
lib/client/api/shift.ts
Server services
- Business API routes
app/api - Checkout route
app/api/pos/checkout/route.ts - Reports routes
app/api/reports - Application database
lib/server/prisma.ts - Authentication
lib/server/auth.ts - Realtime broadcasting
lib/server/realtime.ts
Offline system
- Offline data cache
lib/client/offline.ts - Pending action queue
lib/client/offlineQueue.ts - Sync engine
lib/client/sync-engine.ts - Offline sync status
lib/client/hooks/useOfflineSync.ts
Other components
- Cashier
Connections 25
- Cashier → Point of sale: uses
- Point of sale → POS API helper: uses
app/(dashboard)/pos/POSClient.tsx - Point of sale → Client API helpers: uses
app/(dashboard)/pos/POSClient.tsx - Point of sale → Shift API helper: fetches shifts
app/(dashboard)/pos/POSClient.tsx - Dashboard → Client API helpers: loads data
app/(dashboard)/dashboard/DashboardClient.tsx - Dashboard → Reports: renders charts
app/(dashboard)/dashboard/DashboardClient.tsx - Product management → Client API helpers: uses inventory APIs
app/(dashboard)/products/ProductsClient.tsx - Reports → Client API helpers: loads data
app/(dashboard)/reports/ReportsClient.tsx - Credit accounts → Client API helpers: loads data
app/(dashboard)/credit/CreditClient.tsx - User management → Client API helpers: loads data
app/(dashboard)/users/UsersClient.tsx - Client API helpers → Offline data cache: reads and writes
lib/client/api/inventory.ts - Client API helpers → Business API routes: requests data
lib/client/api/inventory.ts - POS API helper → Checkout route: checkout request
- Shift API helper → Business API routes: requests shifts
- Reports routes → Application database: queries
app/api/reports/route.ts - Business API routes → Application database: uses database
app/api/products/route.ts - Business API routes → Realtime broadcasting: broadcasts updates
app/api/products/route.ts - Business API routes → Authentication: checks access
app/api/products/route.ts - Authentication → Application database: looks up users
lib/server/auth.ts - Offline sync status → Pending action queue: counts actions
lib/client/hooks/useOfflineSync.ts - Offline sync status → Pending action queue: starts sync
lib/client/hooks/useOfflineSync.ts - Pending action queue → Sync engine: delegates sync
lib/client/offlineQueue.ts - Sync engine → Pending action queue: updates action status
lib/client/sync-engine.ts - Sync engine → Offline data cache: merges pulled data
lib/client/sync-engine.ts - Sync engine → Business API routes: pushes and pulls
lib/client/sync-engine.ts