How pavitr-sharma/pingme1 works
This repository implements a React storefront and NFC-profile product, with Firebase-backed accounts and orders plus Firebase Functions for payment verification and order notifications. The main customer flow is browse products, personalize an NFC profile when relevant, place an order, pay through Razorpay, and view or manage account/order information; public NFC pages and administration are distinct capabilities. Edges reflect shown calls, routes, or README-described behavior. Several page and service implementations were not excerpted, so their internal connections are omitted.
Main entry points: App.tsx App router · Prebook.tsx Prebooking checkout · prebookService.ts Order service · paymentService.ts Payment service
Components 32
Storefront
- App router
src/App.tsx - Product catalog
src/lib/productCatalog.ts - Product browsing
src/pages/Products.tsx - Product details
src/pages/ProductDetail.tsx - Product reviews
src/pages/AddReview.tsx - Storefront layout
src/layouts/MainLayout.tsx - About content
src/pages/About.tsx - Product documentation
src/components/DocsPage.tsx
Identity and profiles
- Authentication state
src/contexts/AuthContext.tsx - Phone sign-in
src/components/auth/PhoneAuthForm.tsx - Auth service
src/lib/authService.ts - Firebase client
src/lib/firebase.ts - Account profile
src/pages/Profile.tsx
Orders and payments
- Shopping cart
src/contexts/CartContext.tsx - Prebooking checkout
src/pages/Prebook.tsx - Order service
src/lib/prebookService.ts - Payment service
src/lib/paymentService.ts - Payment functions
functions/src/index.js - Firestore
- Invoice utilities
src/lib/invoiceUtils.ts - Invoice email utilities
functions/src/invoiceEmail.js - Razorpay Checkout
- Email and messaging
NFC profiles
- NFC profile builder
src/components/NFCProfileBuilder.tsx - NFC checkout helper
src/lib/nfcCheckout.ts - Public NFC profile
src/pages/PublicNFCProfile.tsx - Public profile service
src/lib/publicNfcService.ts
Administration
- Admin console
src/pages/Admin.tsx - Admin service
src/lib/adminService.ts - Order status trigger
functions/src/index.js
Other components
- Customer
- Profile visitor
Connections 38
- Customer → App router: opens
src/App.tsx - App router → Prebooking checkout: routes to
src/App.tsx - App router → Public NFC profile: routes to
src/App.tsx - Customer → Product browsing: browses
- Product browsing → Product catalog: uses catalog
- Product details → Product catalog: uses catalog
- Product reviews → Product catalog: normalizes category
src/pages/AddReview.tsx - Product reviews → Product browsing: saves review
src/pages/AddReview.tsx - App router → Authentication state: provides state
src/App.tsx - App router → Shopping cart: provides state
src/App.tsx - Phone sign-in → Authentication state: uses auth
src/components/auth/PhoneAuthForm.tsx - Authentication state → Auth service: requests OTP
src/contexts/AuthContext.tsx - Auth service → Firebase client: uses phone auth
src/lib/authService.ts - Authentication state → Firebase client: loads profile
src/contexts/AuthContext.tsx - Customer → Prebooking checkout: checks out
- Prebooking checkout → NFC profile builder: collects profile
src/pages/Prebook.tsx - Prebooking checkout → Payment service: starts payment
src/pages/Prebook.tsx - Prebooking checkout → NFC checkout helper: uses NFC checkout
src/pages/Prebook.tsx - Shopping cart → Order service: uses order types
src/contexts/CartContext.tsx - Order service → Firestore: reads and writes
src/lib/prebookService.ts - Order service → Product catalog: resolves images
src/lib/prebookService.ts - Payment service → Payment functions: calls backend
- Payment functions → Razorpay Checkout: creates and verifies
- Razorpay Checkout → Customer: collects payment
- Payment functions → Firestore: writes payments
- Payment service → Order service: uses order service
src/lib/paymentService.ts - Payment service → Invoice utilities: uses invoice helpers
src/lib/paymentService.ts - Payment functions → Invoice email utilities: uses invoice email
functions/src/index.js - Order status trigger → Email and messaging: sends confirmation
- Order status trigger → Firestore: observes status change
- NFC profile builder → Order service: syncs profile
- Prebooking checkout → Public profile service: syncs NFC draft
src/pages/Prebook.tsx - Public NFC profile → Public profile service: loads profile
- Profile visitor → Public NFC profile: views profile
- Admin console → Admin service: uses admin service
src/pages/Admin.tsx - Admin console → Invoice utilities: uses invoice helpers
src/pages/Admin.tsx - Admin console → Firestore: updates order status
- Storefront layout → App router: wraps pages