How sribuenasautosolutions/d2w-ui works
This is a React-based smart-store sales and inventory application. Users sign in and enter role-gated owner, store, salesperson, procurement, or POS routes. The main workflows cover lead capture and procurement, product and stock management, sales/proformas, and POS checkout through invoicing. Shared API services mediate backend requests, while the POS cart provides shared frontend state. Route wiring and selected service calls are evidenced by the excerpts and source index; several listed product areas were not sampled, so their internal interactions are not asserted.
Main entry points: OwnerRoutes.jsx Owner routes · AppRoutesNew.jsx Role routes · StoreRoutes.jsx Store routes · LeadStaffRoutes.jsx Lead staff routes
Components 25
Access and navigation
- Role routes
src/routes/AppRoutesNew.jsx - Owner routes
src/owner/routes/OwnerRoutes.jsx - Store routes
src/store/routes/StoreRoutes.jsx - Lead staff routes
src/store/routes/LeadStaffRoutes.jsx - Role guard
src/auth/ProtectedRoute.jsx - Dashboard layout
src/owner/layouts/DashboardLayout.jsx
Lead management
- Lead pipeline
src/owner/components/leads/LeadList.jsx - Lead capture
src/owner/components/leads/LeadCreate.jsx - Lead workspace
src/owner/components/leads/LeadDetails.jsx - WhatsApp chats
src/owner/components/leads/WhatsAppChats.jsx
Store operations
- Inventory management
src/owner/components/inventory/ProductManagePage.jsx - Product catalog
src/owner/pages/ProductPage.jsx - Purchases
src/owner/pages/PurchasesPage.jsx - Vehicle catalog
src/owner/components/vehicles/VehicleManagement.jsx - Store reports
src/owner/pages/ReportsPage.jsx
Sales and POS
- Sales and proformas
src/sales/pages/NewSalePage.jsx - POS routes
src/pos/routes/POSRoutes.jsx - POS register
src/pos/pages/POSPage.jsx - Cart state
src/pos/context/CartContext.jsx - Payment
src/pos/pages/PaymentPageor.jsx - Invoice
src/pos/pages/InvoicePage.jsx
Shared services
- Lead service
src/services/leadService.js - HTTP API client
src/services/api.js
Other components
- Staff user
- Application backend
Connections 34
- Staff user → Role routes: opens app
src/routes/AppRoutesNew.jsx - Role routes → Role guard: guards routes
src/routes/AppRoutesNew.jsx - Role routes → Owner routes: routes owner
src/routes/AppRoutesNew.jsx - Role routes → Store routes: routes store
src/routes/AppRoutesNew.jsx - Role routes → POS routes: routes POS
src/routes/AppRoutesNew.jsx - Role routes → Lead staff routes: routes staff
src/routes/AppRoutesNew.jsx - Owner routes → Dashboard layout: renders layout
src/owner/routes/OwnerRoutes.jsx - Owner routes → Sales and proformas: routes sales
src/owner/routes/OwnerRoutes.jsx - Owner routes → Inventory management: routes inventory
src/owner/routes/OwnerRoutes.jsx - Owner routes → Purchases: routes purchases
src/owner/routes/OwnerRoutes.jsx - Owner routes → Product catalog: routes products
src/owner/routes/OwnerRoutes.jsx - Owner routes → Vehicle catalog: routes vehicles
src/owner/routes/OwnerRoutes.jsx - Owner routes → Store reports: routes reports
src/owner/routes/OwnerRoutes.jsx - Store routes → Dashboard layout: renders layout
src/store/routes/StoreRoutes.jsx - Store routes → Inventory management: routes inventory
src/store/routes/StoreRoutes.jsx - Store routes → Sales and proformas: routes sales
src/store/routes/StoreRoutes.jsx - Lead staff routes → Dashboard layout: renders layout
src/store/routes/LeadStaffRoutes.jsx - Lead staff routes → Lead pipeline: routes leads
src/store/routes/LeadStaffRoutes.jsx - Lead staff routes → Lead workspace: routes details
src/store/routes/LeadStaffRoutes.jsx - Lead staff routes → Lead capture: routes creation
src/store/routes/LeadStaffRoutes.jsx - Store routes → Lead pipeline: routes leads
src/store/routes/StoreRoutes.jsx - Lead pipeline → Lead capture: opens creation
src/owner/components/leads/LeadList.jsx - Lead pipeline → WhatsApp chats: loads chat links
src/owner/components/leads/LeadList.jsx - Lead capture → Lead service: creates lead
src/owner/components/leads/LeadCreate.jsx - Lead workspace → Lead service: uses lead operations
src/owner/components/leads/LeadDetails.jsx - Lead service → HTTP API client: sends requests
src/services/leadService.js - Sales and proformas → HTTP API client: loads sale data
- POS routes → POS register: routes register
src/pos/routes/POSRoutes.jsx - POS routes → Invoice: routes invoice
src/pos/routes/POSRoutes.jsx - POS register → Cart state: uses cart
- Payment → Cart state: reads cart
src/pos/pages/PaymentPageor.jsx - Payment → Invoice: routes after payment
- Invoice → HTTP API client: loads invoice
src/pos/pages/InvoicePage.jsx - HTTP API client → Application backend: sends HTTP
src/services/api.js