How john-michaelg135/web-pos works
This is a Next.js point-of-sale operations application. Staff authenticate through an Enterprise Portal, then use POS modules for sales processing, orders, products, stock, locations, starting cash, and manager reporting. The principal workflow is portal sign-in and session validation, followed by role- and location-scoped access to operational views backed by a shared POS API layer. The graph includes documented portal handoffs and sampled API relationships; several operational views are present in the tree but were not sampled, so their internal calls are not inferred.
Main entry points: open/route.ts Probe handoff · callback/route.ts Portal callback · api.ts POS API client · login/route.ts Portal login
Components 24
Identity and access
- Portal login
app/api/portal/login/route.ts - Portal callback
app/api/portal/callback/route.ts - Portal client
lib/portal/client.ts - POS session
lib/portal/config.ts - Auth context
context/AuthContext.tsx - Role permissions
lib/permissions.ts - Probe handoff
app/api/probe/open/route.ts
POS operations
- Location scope
lib/useMyLocations.ts - My locations API
app/api/my-locations/route.ts - Sales processing
pages/pos/ViewSalesProcessing.tsx - Order management
pages/pos/ViewOrderManagement.tsx - Product management
pages/pos/ViewProductManagement.tsx - Stock management
pages/pos/ViewStockManagement.tsx - Location management
pages/pos/ViewLocationsManagement.tsx - Starting cash
pages/pos/ViewStartingCash.tsx - Starting cash gate
components/module-pos/StartingCashGate.tsx - POS API client
components/module-pos/api/api.ts
Management reporting
- Sales analytics
pages/pos/ViewSalesAnalytics.tsx - Sales report
components/module-pos/SalesReport.tsx
Application platform
- Application shell
components/shared/AppShell.tsx - Page loading UI
components/shared/PageSkeleton.tsx
Other components
- Staff member
- Enterprise Portal
- POS Probe
Connections 17
- Staff member → Portal login: starts sign-in
app/api/portal/login/route.ts - Portal login → Enterprise Portal: redirects to authorize
app/api/portal/login/route.ts - Enterprise Portal → Portal callback: returns code
- Portal callback → Portal client: exchanges code
app/api/portal/callback/route.ts - Portal callback → POS session: sets session cookie
app/api/portal/callback/route.ts - Auth context → Role permissions: checks actions
context/AuthContext.tsx - Staff member → Probe handoff: opens Probe
app/api/probe/open/route.ts - Probe handoff → Portal client: rechecks access
- Probe handoff → POS API client: fetches assigned branch
app/api/probe/open/route.ts - Probe handoff → POS Probe: redirects with handoff
app/api/probe/open/route.ts - Location scope → My locations API: fetches scope
lib/useMyLocations.ts - Sales processing → POS API client: uses API client
pages/pos/ViewSalesProcessing.tsx - Starting cash → Starting cash gate: uses gate
- Starting cash gate → POS API client: loads POS data
components/module-pos/StartingCashGate.tsx - Sales analytics → Sales report: renders report
- Staff member → Application shell: uses POS application
- Application shell → Page loading UI: shows loading UI