How chana758/skincare_firebase works
This is a skincare e-commerce application with a public storefront, customer accounts and checkout, plus staff POS and administrative consoles. The main customer flow is routed through the storefront to checkout, which creates an order, generates a KHQR payment code, and records an order notification. Staff also have POS and shift-history screens; administrators manage catalog, orders, content, staff, reports, discounts, and messages. The map reflects documented routes and sampled calls; unsampled subsystems are represented at their existing directory paths, without asserting internal wiring that was not shown.
Main entry points: App.jsx Route application · config.js Firebase setup · index.js Cloud Functions exports · Checkout.jsx Checkout
Components 25
Storefront
- Route application
src/App.jsx - Storefront pages
src/pages/users - Checkout
src/pages/users/Checkout.jsx - Account state
src/context/AuthContext.jsx - Shopping cart
src/context/CartContext.jsx - Product data
src/data/products.js - Login
src/pages/auth/Login.jsx
Staff and admin
- Staff POS
src/pages/staff - POS cart
src/components/pos/POSCart.jsx - Admin console
src/pages/admin - Cloud Functions exports
functions/index.js - Staff account actions
functions/src/auth - Order actions
functions/src/orders - Payment functions
functions/src/payments - Payment webhook
functions/src/payments/verifyPaymentWebhook.js - Sales summary
functions/src/reports/dailySalesSummary.js
Application services
- Order and payment service
src/services/paymentService.js - Notification service
src/services/notificationService.js - Live orders hook
src/hooks/useOrders.js
Firebase backend
- Firebase setup
src/firebase/config.js - Firestore
Other components
- Customer
- Staff
- Administrator
- Bakong KHQR library
Connections 29
- Customer → Route application: uses
- Staff → Route application: uses
- Administrator → Route application: uses
- Route application → Storefront pages: routes to
src/App.jsx - Route application → Checkout: routes to
src/App.jsx - Route application → Login: routes to
src/App.jsx - Route application → Staff POS: routes to
src/App.jsx - Route application → Admin console: routes to
src/App.jsx - Route application → Account state: provides
src/main.jsx - Login → Account state: uses
src/pages/auth/Login.jsx - Account state → Firebase setup: uses
src/context/AuthContext.jsx - Shopping cart → Firebase setup: reads and writes
src/context/CartContext.jsx - Checkout → Shopping cart: uses
src/pages/users/Checkout.jsx - Checkout → Order and payment service: creates order and QR
src/pages/users/Checkout.jsx - Checkout → Notification service: creates notification
src/pages/users/Checkout.jsx - Order and payment service → Firebase setup: uses
src/services/paymentService.js - Order and payment service → Firestore: reads and writes
src/services/paymentService.js - Order and payment service → Bakong KHQR library: generates QR with
src/services/paymentService.js - Notification service → Firebase setup: uses
src/services/notificationService.js - Notification service → Firestore: reads and writes
src/services/notificationService.js - Live orders hook → Firebase setup: uses
src/hooks/useOrders.js - Live orders hook → Firestore: subscribes to
src/hooks/useOrders.js - POS cart → Staff POS: supports
- Storefront pages → Product data: uses
- Cloud Functions exports → Staff account actions: exports
functions/index.js - Cloud Functions exports → Order actions: exports
functions/index.js - Cloud Functions exports → Payment functions: exports
functions/index.js - Cloud Functions exports → Sales summary: exports
functions/index.js - Payment webhook → Firestore: updates orders
functions/src/payments/verifyPaymentWebhook.js