How gvardhan97/next_store works
This is a Next.js e-commerce storefront. The main customer journey is browsing the product catalog, viewing a product, adding it to a per-user cart, creating an order, and completing Stripe checkout; review and favorite features branch from product pages. Admins manage products separately. Server actions coordinate authentication, validation, database operations, and image storage. The README documents several integrations and flows whose implementation was not sampled, so those links are cited to the README; source-level edges are limited to relationships visible in excerpts or the source index.
Main entry points: actions.ts Server Actions · [id]/page.tsx Product Detail · db.ts Prisma Data Store · products/page.tsx Product Catalog
Components 20
Storefront
- Product Catalog
app/products/page.tsx - Home Page
app/page.tsx - Product Detail
app/products/[id]/page.tsx - Catalog Components
components/products
Customer Features
- Favorites
app/favorites/page.tsx - Reviews
app/reviews/page.tsx - Review Submission
components/reviews/SubmitReview.tsx
Cart And Orders
- Shopping Cart
app/cart/page.tsx - Checkout Page
app/checkout/page.tsx - Payment Session API
app/api/payment/route.ts - Payment Confirmation API
app/api/confirm/route.ts - Order History
app/orders/page.tsx
Administration
- Product Management
app/admin/products - Sales Management
app/admin/sales/page.tsx
Server And Integrations
- Server Actions
utils/actions.ts - Prisma Data Store
utils/db.ts - Clerk Auth
- Supabase Storage
utils/supabase.ts - Stripe
Other components
- Customer
Connections 27
- Customer → Product Catalog: browses
- Customer → Home Page: visits
- Product Catalog → Product Detail: opens product
- Product Catalog → Catalog Components: renders listings
app/products/page.tsx - Product Detail → Server Actions: fetches product
app/products/[id]/page.tsx - Product Detail → Review Submission: offers review
app/products/[id]/page.tsx - Product Detail → Favorites: links favorites
- Customer → Favorites: manages favorites
- Customer → Reviews: manages reviews
- Review Submission → Server Actions: submits review
components/reviews/SubmitReview.tsx - Reviews → Server Actions: fetches reviews
app/reviews/page.tsx - Customer → Shopping Cart: manages cart
- Shopping Cart → Server Actions: loads cart
app/cart/page.tsx - Server Actions → Prisma Data Store: reads and writes
utils/actions.ts - Server Actions → Clerk Auth: checks identity
utils/actions.ts - Server Actions → Supabase Storage: uploads images
utils/actions.ts - Product Management → Server Actions: manages products
app/admin/products/page.tsx - Sales Management → Server Actions: fetches sales
app/admin/sales/page.tsx - Customer → Checkout Page: starts checkout
- Checkout Page → Payment Session API: requests session
- Payment Session API → Stripe: creates session
- Payment Session API → Prisma Data Store: loads order data
app/api/payment/route.ts - Stripe → Payment Confirmation API: confirms payment
- Payment Confirmation API → Prisma Data Store: marks paid
app/api/confirm/route.ts - Payment Confirmation API → Prisma Data Store: cleans cart
app/api/confirm/route.ts - Customer → Order History: views orders
- Order History → Server Actions: fetches orders
app/orders/page.tsx