How bshemphang/cloudpeak-store works
Cloudpeak is a Next.js streetwear storefront with customer accounts, product browsing, checkout and an admin catalogue/order-management area. The main customer path is browse products, add items to a cart, submit an order, complete Razorpay payment, and receive confirmation. The graph also preserves reviews, newsletter signup, product feeds and admin analytics as distinct capabilities. Several routes and persistence modules are listed but not excerpted; uncertain links are omitted or marked dashed rather than inferred from names.
Main entry points: page.tsx Checkout · route.ts Order API · ProductDetailClient.tsx Product Detail · email-service.ts Email Outbox
Components 26
Storefront
- Home Page
app/page.tsx - Shop Collection
app/shop/ShopClient.tsx - Product Detail
app/shop/[slug]/ProductDetailClient.tsx - Customer Accounts
context/AuthContext.tsx - Product Reviews
lib/reviews-store.ts - Newsletter Signup
app/api/newsletter/route.ts
Orders and Payments
- Shopping Cart
context/CartContext.tsx - Checkout
app/checkout/page.tsx - Order API
app/api/orders/route.ts - Order Validation
lib/order-utils.ts - Order Store
lib/orders-store.ts - Razorpay
- Payment Verification
app/api/verify-payment/route.ts - Payment Webhook
app/api/razorpay-webhook/route.ts - Order Confirmation
app/order-confirmation/[id]/page.tsx
Admin and Catalogue
- Product API
app/api/products/route.ts - Product Store
lib/products-store.ts - Product Feed
app/products-feed.xml/route.ts - Admin Console
app/admin/page.tsx - Admin Authentication
hooks/useAdminAuth.ts - Sales Analytics
app/admin/analytics/page.tsx
Shared Services
- Subscribers
lib/subscribers-store.ts - Email Outbox
lib/email-service.ts - Email Templates
lib/email-templates.ts - Supabase
lib/supabase.ts
Other components
- Shopper
Connections 30
- Shopper → Home Page: visits
README.md - Shopper → Shop Collection: browses
README.md - Shopper → Product Detail: selects
- Product Detail → Shopping Cart: adds items
app/shop/[slug]/ProductDetailClient.tsx - Checkout → Shopping Cart: reads cart
app/checkout/page.tsx - Checkout → Customer Accounts: reads account
app/checkout/page.tsx - Shopper → Checkout: submits order
README.md - Checkout → Order API: creates order
app/checkout/page.tsx - Order API → Order Validation: validates and builds
app/api/orders/route.ts - Order API → Order Store: saves order
app/api/orders/route.ts - Checkout → Razorpay: starts payment
README.md - Checkout → Payment Verification: verifies payment
app/checkout/page.tsx - Payment Verification → Order Store: updates payment status
app/api/verify-payment/route.ts - Razorpay → Payment Webhook: sends event
- Payment Webhook → Order Store: updates payment status
app/api/razorpay-webhook/route.ts - Payment Verification → Email Outbox: sends confirmation
app/api/verify-payment/route.ts - Payment Webhook → Email Outbox: sends confirmation
app/api/razorpay-webhook/route.ts - Order API → Email Outbox: sends order email
app/api/orders/route.ts - Shopper → Newsletter Signup: subscribes
app/api/newsletter/route.ts - Newsletter Signup → Subscribers: adds subscriber
app/api/newsletter/route.ts - Newsletter Signup → Email Outbox: sends welcome
app/api/newsletter/route.ts - Product Feed → Product Store: reads products
app/products-feed.xml/route.ts - Product Feed → Shopper: publishes feed
- Admin Authentication → Admin Console: authenticates
- Admin Authentication → Order API: checks access
hooks/useAdminAuth.ts - Admin Console → Sales Analytics: opens analytics
app/admin/analytics/page.tsx - Product API → Product Store: accesses catalogue
- Shop Collection → Product Detail: opens product
- Product Detail → Product Reviews: loads reviews
- Supabase → Product Store: backs persistence