How rohandevtech23/primenest-e-commerce works
PrimeNest is a consumer storefront with product discovery, saved items, cart and checkout, customer accounts, reviews, AI shopping features, and an administration area. The principal customer journey moves from browsing a catalog to a product page, then cart and checkout; checkout submission is handled by the orders API, which verifies the customer session and persists the order while updating stock. Source excerpts establish several API-to-database and API-to-auth relationships, but do not show most page-to-API wiring, so those links are omitted.
Main entry points: page.js Product detail · auth.js Session tokens · db.js PostgreSQL · page.tsx Home & discovery
Components 23
Storefront
- Home & discovery
app/page.tsx - Shop & search
app/shop/page.js - Product detail
app/product/[id]/page.js - Navigation
components/Navbar.jsx - Cart state
context/CartContext.jsx - Wishlist state
context/WishlistContext.jsx
Customer account
- Address API
app/api/profile/addresses/route.js - Customer profile
app/profile/page.jsx - Session tokens
lib/auth.js
Commerce services
- Checkout
app/checkout/page.jsx - Order API
app/api/orders/route.js - Product API
app/api/products/route.js - Reviews API
app/api/reviews/route.js - PostgreSQL
lib/db.js
AI features
- Review insights
components/AIReviewSummarizer.jsx - Shopping assistant
components/AIShoppingAssistant.jsx - Virtual try-on
components/VirtualTryOnModal.jsx - AI endpoints
app/api/ai - AI services
lib/ai.js
Administration
- Admin console
app/admin - Admin product API
app/api/admin/products/route.js - Admin analytics API
app/api/admin/stats/route.js
Other components
- Shopper
Connections 22
- Shopper → Home & discovery: browses
app/page.tsx - Shopper → Shop & search: browses
app/shop/page.js - Shopper → Product detail: views
app/product/[id]/page.js - Home & discovery → Navigation: renders
app/page.tsx - Home & discovery → Shop & search: showcases products
app/page.tsx - Product detail → Cart state: uses
app/product/[id]/page.js - Product detail → Wishlist state: uses
app/product/[id]/page.js - Product detail → Virtual try-on: renders
app/product/[id]/page.js - Product detail → Review insights: renders
app/product/[id]/page.js - Navigation → Cart state: reads count
components/Navbar.jsx - Navigation → Wishlist state: reads count
components/Navbar.jsx - Checkout → Cart state: uses cart
app/checkout/page.jsx - Order API → Session tokens: verifies session
app/api/orders/route.js - Order API → PostgreSQL: reads and writes
app/api/orders/route.js - Reviews API → Session tokens: verifies session
app/api/reviews/route.js - Reviews API → PostgreSQL: reads and writes
app/api/reviews/route.js - Address API → Session tokens: verifies session
app/api/profile/addresses/route.js - Address API → PostgreSQL: reads and writes
app/api/profile/addresses/route.js - Admin product API → Session tokens: verifies session
app/api/admin/products/route.js - Admin product API → PostgreSQL: reads and writes
app/api/admin/products/route.js - Admin analytics API → Session tokens: verifies session
app/api/admin/stats/route.js - Admin analytics API → PostgreSQL: queries metrics
app/api/admin/stats/route.js