How naresh8k/kjn-ecommerce-site works
KJN Shop is an ecommerce storefront with a separate admin experience, backed by an Express/Prisma API. The customer journey spans account access, product discovery, cart and coupon management, checkout, payment, and order tracking; administrators manage catalog content, customers, orders, and payments. The graph includes those domain stages plus supporting authentication, email, reviews, and shipping integrations. Several backend links are evidenced by the SOURCE INDEX; frontend-to-API routing and some unsampled subsystem wiring are not shown, so those links are omitted or marked unverified.
Main entry points: db.js Prisma database · auth.controller.js Authentication · mailer.js Email delivery · order.controller.js Orders and invoices
Components 21
Customer storefront
- Storefront pages
frontend/app - Account pages
frontend/app/login/page.js - Cart state
frontend/src/store/useCartStore.js - API client
frontend/src/lib/api.js
Commerce API
- Product catalog
backend/src/modules/products/product.controller.js - Cart and coupons
backend/src/modules/cart/cart.controller.js - Orders and invoices
backend/src/modules/orders/order.controller.js - Payments and refunds
backend/src/modules/payments/payment.controller.js - Authentication
backend/src/modules/auth/auth.controller.js - Product reviews
backend/src/modules/reviews/review.controller.js
Admin and fulfillment
- Admin operations
backend/src/modules/admin/admin.controller.js - Shipment management
backend/src/modules/shipmozo/shipmozo.controller.js
Shared services
- Prisma database
backend/src/config/db.js - Email delivery
backend/src/config/mailer.js - Auth helpers
backend/src/utils/otp.js - Refresh-token storage
backend/src/utils/tokenStorage.js - Invoice generation
backend/src/modules/orders/invoice.service.js - ShipMozo client
backend/src/config/shipmozo.js
Other components
- Customer
- Razorpay
- ShipMozo
Connections 25
- Customer → Storefront pages: browses
- Customer → Account pages: signs in
- Cart state → API client: calls
frontend/src/store/useCartStore.js - API client → Cart and coupons: requests
- Storefront pages → Product catalog: loads products
- Account pages → Authentication: authenticates
- Cart and coupons → Prisma database: reads and writes
backend/src/modules/cart/cart.controller.js - Product catalog → Prisma database: reads catalog
backend/src/modules/products/product.controller.js - Orders and invoices → Prisma database: reads and writes
backend/src/modules/orders/order.controller.js - Orders and invoices → Invoice generation: generates invoices
backend/src/modules/orders/order.controller.js - Orders and invoices → Email delivery: sends lifecycle email
- Payments and refunds → Prisma database: updates payment records
backend/src/modules/payments/payment.controller.js - Payments and refunds → Razorpay: uses payments API
- Payments and refunds → Email delivery: sends refund email
backend/src/modules/payments/payment.controller.js - Authentication → Prisma database: reads and writes
backend/src/modules/auth/auth.controller.js - Authentication → Email delivery: sends OTP email
backend/src/modules/auth/auth.controller.js - Authentication → Auth helpers: uses OTP helpers
backend/src/modules/auth/auth.controller.js - Authentication → Refresh-token storage: stores refresh tokens
backend/src/modules/auth/auth.controller.js - Refresh-token storage → Prisma database: reads and writes
backend/src/utils/tokenStorage.js - Product reviews → Prisma database: reads and writes
backend/src/modules/reviews/review.controller.js - Admin operations → Prisma database: reads and writes
backend/src/modules/admin/admin.controller.js - Shipment management → Prisma database: updates shipment data
backend/src/modules/shipmozo/shipmozo.controller.js - Shipment management → ShipMozo client: dispatches tracking
backend/src/modules/shipmozo/shipmozo.controller.js - ShipMozo client → ShipMozo: calls carrier API
- Shipment management → Email delivery: sends order email
backend/src/modules/shipmozo/shipmozo.controller.js