How bharath-appu/babycon works
Babycon is a Next.js commerce storefront with a staff administration studio. The customer journey runs from catalog discovery through cart and server-validated checkout to payment confirmation and order status; staff manage catalog, orders, and store operations separately. The graph preserves README-documented capabilities, including accounts, wishlist, SEO, and analytics. Some routes and admin subsystems are unsampled, so their documented links are cited to the README rather than presented as inspected implementation details.
Main entry points: page.tsx Checkout form · db.ts PostgreSQL data · (store) Storefront pages · route.ts Order creation
Components 25
Storefront
- Storefront pages
app/(store) - Home experience
app/(store)/page.tsx - Catalog queries
lib/catalog.ts - Product browsing
app/(store)/products/[slug]/page.tsx - Shop and search
app/(store)/shop/page.tsx - Collections
app/(store)/collections/[slug]/page.tsx - Wishlist
lib/store/wishlist.tsx
Commerce
- Cart state
lib/store/cart.tsx - Cart session API
app/api/cart/route.ts - Checkout form
app/(store)/checkout/page.tsx - Order creation
app/api/checkout/route.ts - Payment verification
app/api/razorpay/payments.ts - Payment verify route
app/api/razorpay/verify/route.ts - Payment webhook
app/api/razorpay/webhook/route.ts - Order status
app/(store)/checkout/success/page.tsx
Admin studio
- Admin studio
app/admin/(panel) - Admin mutations
app/admin/(panel)/actions.ts
Identity and platform
- PostgreSQL data
lib/db.ts - Customer accounts
app/(store)/account - Authentication
auth.ts - Auth handlers
app/api/auth/[...nextauth]/route.ts - SEO endpoints
app/sitemap.ts
Other components
- Customer
- Razorpay
- Staff user
Connections 29
- Customer → Storefront pages: browses
- Storefront pages → Home experience: renders
app/(store)/page.tsx - Home experience → Catalog queries: loads catalog
app/(store)/page.tsx - Customer → Shop and search: finds products
- Customer → Collections: browses
- Customer → Product browsing: views details
- Customer → Wishlist: saves items
- Customer → Cart state: adds items
- Cart state → Cart session API: syncs session
- Cart session API → PostgreSQL data: reads and writes
- Customer → Checkout form: submits order
- Checkout form → Cart state: reads items
app/(store)/checkout/page.tsx - Checkout form → Order creation: sends checkout
app/(store)/checkout/page.tsx - Order creation → PostgreSQL data: validates and creates order
app/api/checkout/route.ts - Order creation → Razorpay: creates payment order
app/api/checkout/route.ts - Checkout form → Payment verify route: submits signature
app/(store)/checkout/page.tsx - Payment verify route → Payment verification: verifies payment
- Payment webhook → Payment verification: marks paid
app/api/razorpay/webhook/route.ts - Payment webhook → PostgreSQL data: looks up order
app/api/razorpay/webhook/route.ts - Razorpay → Payment webhook: sends events
- Checkout form → Order status: shows status
- Customer → Customer accounts: manages account
- Customer accounts → Authentication: authenticates
- Auth handlers → Authentication: dispatches handlers
- Staff user → Admin studio: manages store
- Admin studio → Admin mutations: submits changes
app/admin/(panel)/products/page.tsx - Admin mutations → PostgreSQL data: updates commerce data
- Admin studio → PostgreSQL data: reads reports and records
app/admin/(panel)/products/page.tsx - Storefront pages → SEO endpoints: publishes sitemap