How noorjsdivs/shopcartpro-yt works
ShopCart Pro is a Sanity-backed commerce application with Clerk authentication and Stripe/Clerk payment options. The main customer journey is browsing products, building a cart, placing an order, processing payment, and viewing order history; administrators also manage catalog, orders, accounts, reviews, subscriptions, and analytics. The graph preserves these documented capabilities and the sampled order, webhook, and Sanity layers. Many UI and admin route implementations were not sampled, so their documented connections are shown at capability level rather than as detailed call chains.
Main entry points: page.tsx Admin console · backendClient.ts Sanity CMS · orders/route.ts Order handling · webhook/route.ts Payment webhook
Components 25
Storefront & discovery
- Product discovery
app/(client)/page.tsx - Category browsing
components/CategoryPageClient.tsx
Customer commerce
- Persistent cart
components/cart/ServerCartContent.tsx - Checkout
components/checkout/CheckoutContent.tsx - Order handling
app/api/orders/route.ts - Payment processing
app/api/checkout/stripe/route.ts - Order history
components/ResponsiveOrdersComponent.tsx - Wishlist
components/wishlist/ServerWishlist.tsx - Profile & addresses
components/profile/ProfileClient.tsx
Admin & operations
- Admin console
app/(admin)/admin/page.tsx - Order operations
app/api/admin/orders/route.ts - Account requests
components/admin/AccountRequestsClient.tsx - Business analytics
app/api/admin/analytics/route.ts - Review management
components/admin/AdminReviews.tsx - Subscriptions
app/api/newsletter/subscribe/route.ts - Employee portal
app/(employee)/employee/page.tsx
Application services
- Payment webhook
app/api/webhook/route.ts - Order notifications
lib/notificationService.ts - Email delivery
lib/emailService.ts
Content & persistence
- Catalog queries
sanity/queries/query.ts - Sanity CMS
sanity/lib/backendClient.ts - Order query helpers
sanity/helpers/index.ts
Other components
- Shopper
- Stripe
- Clerk identity
Connections 32
- Shopper → Product discovery: browses
README.md - Product discovery → Category browsing: filters products
README.md - Category browsing → Catalog queries: queries catalog
sanity/queries/query.ts - Shopper → Persistent cart: adds products
README.md - Persistent cart → Checkout: proceeds to
README.md - Checkout → Order handling: submits order
README.md - Order handling → Clerk identity: authenticates with
app/api/orders/route.ts - Order handling → Sanity CMS: creates order
app/api/orders/route.ts - Order handling → Order notifications: sends status
app/api/orders/route.ts - Checkout → Payment processing: starts payment
README.md - Payment processing → Stripe: charges via
README.md - Stripe → Payment webhook: posts payment event
README.md - Payment webhook → Stripe: retrieves invoice
app/api/webhook/route.ts - Payment webhook → Sanity CMS: reads and updates
app/api/webhook/route.ts - Payment webhook → Order notifications: sends status
app/api/webhook/route.ts - Order notifications → Sanity CMS: uses CMS client
lib/notificationService.ts - Shopper → Order history: tracks orders
README.md - Order history → Order query helpers: loads order history
- Order query helpers → Sanity CMS: fetches orders
sanity/helpers/index.ts - Shopper → Wishlist: saves favorites
README.md - Shopper → Profile & addresses: manages account
README.md - Profile & addresses → Clerk identity: uses identity
README.md - Shopper → Admin console: administers store
README.md - Admin console → Order operations: manages orders
README.md - Admin console → Account requests: reviews applications
README.md - Admin console → Business analytics: views insights
README.md - Admin console → Review management: moderates reviews
README.md - Admin console → Subscriptions: manages campaigns
README.md - Admin console → Employee portal: assigns staff
README.md - Subscriptions → Email delivery: sends email
app/api/newsletter/subscribe/route.ts - Subscriptions → Sanity CMS: uses CMS data
- Business analytics → Sanity CMS: queries metrics
app/api/admin/analytics/route.ts