How valgrow-labs/ceyloncrunch works
Ceylon Crunch is a storefront and admin system for selling products, managing orders, and configuring the shop. The customer flow runs from the storefront and product selection through a persistent cart and checkout, where the orders API creates the order and can prepare PayHere checkout. Admin capabilities include product and order management, store settings, team administration, and newsletter management. Evidence is limited to the supplied excerpts and source index; unsampled pages and routes are shown only where their role is clear from the file tree.
Main entry points: supabase-server.js Server client · page.jsx Homepage · route.js Orders API · ProductDetailClient.jsx Product detail
Components 32
Storefront
- Homepage
app/(store)/page.jsx - Shop catalog
app/(store)/shop/page.jsx - Product detail
components/storefront/ProductDetailClient.jsx - Product card
components/storefront/ProductCard.jsx - Newsletter form
components/storefront/NewsletterForm.jsx - Rating display
components/storefront/Stars.jsx - Store icons
components/storefront/Icons.jsx
Commerce
- Cart state
contexts/CartContext.jsx - Checkout
components/storefront/CheckoutClient.jsx - Orders API
app/api/orders/route.js - Order follow-up
app/api/orders/[id]/route.js - Order tracking
app/api/orders/track/route.js - Payment webhook
app/api/orders/webhook/route.js - PayHere integration
lib/payhere.js
Store administration
- Admin workspace
app/admin/layout.jsx - Product management
app/admin/products/AdminProductsClient.jsx - Order management
app/admin/orders/AdminOrdersClient.jsx - Store settings
app/admin/settings - Team management
app/admin/team/TeamClient.jsx - Newsletter API
app/api/newsletter/route.js - Team API
app/api/team/route.js - Status badge
components/admin/StatusBadge.jsx - Image uploader
components/admin/ImageUploader.jsx - Save button
components/admin/SaveButton.jsx
Platform services
- Products API
app/api/products/route.js - Settings API
app/api/settings/route.js - Settings reader
lib/settings.js - Server client
lib/supabase-server.js - Supabase data store
- Variant normalization
lib/variants.js
Other components
- Shopper
- PayHere
Connections 36
- Shopper → Homepage: browses
- Homepage → Settings reader: loads settings
app/(store)/page.jsx - Homepage → Product card: renders
app/(store)/page.jsx - Homepage → Newsletter form: renders
app/(store)/page.jsx - Homepage → Rating display: renders
app/(store)/page.jsx - Product card → Cart state: adds items
components/storefront/ProductCard.jsx - Product card → Rating display: renders
components/storefront/ProductCard.jsx - Product card → Variant normalization: normalizes variants
components/storefront/ProductCard.jsx - Product detail → Cart state: adds items
components/storefront/ProductDetailClient.jsx - Product detail → Variant normalization: normalizes variants
components/storefront/ProductDetailClient.jsx - Product detail → Rating display: renders
components/storefront/ProductDetailClient.jsx - Product detail → Store icons: renders
components/storefront/ProductDetailClient.jsx - Checkout → Cart state: reads cart
components/storefront/CheckoutClient.jsx - Checkout → Orders API: submits order
components/storefront/CheckoutClient.jsx - Checkout → Store icons: renders
components/storefront/CheckoutClient.jsx - Orders API → Supabase data store: creates order
app/api/orders/route.js - Orders API → Settings reader: loads payment settings
app/api/orders/route.js - Orders API → PayHere integration: builds payment payload
app/api/orders/route.js - PayHere integration → PayHere: prepares checkout
- Payment webhook → Supabase data store: updates orders
app/api/orders/webhook/route.js - Payment webhook → PayHere integration: verifies notification
app/api/orders/webhook/route.js - Product management → Status badge: renders
app/admin/products/AdminProductsClient.jsx - Order management → Status badge: renders
app/admin/orders/AdminOrdersClient.jsx - Team management → Team API: manages members
app/admin/team/TeamClient.jsx - Team management → Status badge: renders
app/admin/team/TeamClient.jsx - Team API → Supabase data store: reads and updates
app/api/team/route.js - Products API → Supabase data store: reads products
app/api/products/route.js - Settings API → Supabase data store: reads and writes
app/api/settings/route.js - Settings reader → Server client: reads settings
lib/settings.js - Orders API → Server client: creates clients
app/api/orders/route.js - Team API → Server client: creates clients
app/api/team/route.js - Products API → Server client: creates client
app/api/products/route.js - Settings API → Server client: creates client
app/api/settings/route.js - Newsletter API → Server client: creates client
app/api/newsletter/route.js - Store settings → Image uploader: uses
app/admin/settings/homepage/HomepageClient.jsx - Store settings → Save button: uses
app/admin/settings/homepage/HomepageClient.jsx