How akshithreddy89/nxt-trendz works
Nxt Trendz is a customer-facing shopping app: shoppers register or sign in, browse/search/filter products, inspect details and similar items, then manage a cart. React routes these screens to an Express API; authentication protects catalog and cart operations, while PostgreSQL stores users, products, and cart items. The frontend also maintains a local demo-cart fallback. Major branches are represented from the README and tree; some frontend request behavior and backend startup are documented or indexed rather than excerpted, so uncertain links are omitted.
Main entry points: App.jsx React routes · cartRoutes.js Cart routes · productRoutes.js Product routes · index.jsx Route guard
Components 20
Shopping interface
- React routes
nxtrend-fd/src/App.jsx - Navigation and count
nxtrend-fd/src/components/Navbar/index.jsx
Identity and access
- Registration
nxtrend-fd/src/components/Register/index.jsx - Sign in
nxtrend-fd/src/components/Login/index.jsx - Route guard
nxtrend-fd/src/components/ProtectedRoute/index.jsx - Auth service
ecommerce-bk/controllers/authController.js - JWT middleware
ecommerce-bk/middleware/authMiddleware.js
Product discovery
- Catalog browsing
nxtrend-fd/src/components/Home/index.jsx - Product details
nxtrend-fd/src/components/ProductDetails/index.jsx - Catalog service
ecommerce-bk/controllers/productController.js
Cart management
- Cart screen
nxtrend-fd/src/components/Cart/index.jsx - Cart client
nxtrend-fd/src/utils/cartUtils.js - Cart service
ecommerce-bk/controllers/cartController.js
API and persistence
- Auth routes
ecommerce-bk/routes/authRoutes.js - Product routes
ecommerce-bk/routes/productRoutes.js - Cart routes
ecommerce-bk/routes/cartRoutes.js - Express API
ecommerce-bk/app.js - PostgreSQL pool
ecommerce-bk/config/db.js - PostgreSQL
Other components
- Shopper
Connections 31
- Shopper → React routes: uses
nxtrend-fd/src/App.jsx - React routes → Registration: routes to
nxtrend-fd/src/App.jsx - React routes → Sign in: routes to
nxtrend-fd/src/App.jsx - React routes → Route guard: guards pages
nxtrend-fd/src/App.jsx - Route guard → Catalog browsing: renders
- Route guard → Product details: renders
- Route guard → Cart screen: renders
- React routes → Catalog browsing: routes to
nxtrend-fd/src/App.jsx - React routes → Product details: routes to
nxtrend-fd/src/App.jsx - React routes → Cart screen: routes to
nxtrend-fd/src/App.jsx - Registration → Auth routes: submits account
- Sign in → Auth routes: submits credentials
- Express API → Auth routes: mounts at
ecommerce-bk/app.js - Auth routes → Auth service: dispatches
ecommerce-bk/routes/authRoutes.js - Auth service → PostgreSQL pool: queries
ecommerce-bk/controllers/authController.js - PostgreSQL pool → PostgreSQL: connects
- Catalog browsing → Product routes: requests catalog
- Product details → Product routes: fetches details
nxtrend-fd/src/components/ProductDetails/index.jsx - Express API → Product routes: mounts at
ecommerce-bk/app.js - Product routes → JWT middleware: authenticates
ecommerce-bk/routes/productRoutes.js - Product routes → Catalog service: dispatches
ecommerce-bk/routes/productRoutes.js - Catalog service → PostgreSQL pool: queries catalog
ecommerce-bk/controllers/productController.js - Navigation and count → Cart routes: loads cart count
nxtrend-fd/src/components/Navbar/index.jsx - Cart screen → Cart routes: manages cart
- Product details → Cart client: adds product
nxtrend-fd/src/components/ProductDetails/index.jsx - Cart client → Cart routes: updates cart
nxtrend-fd/src/utils/cartUtils.js - Express API → Cart routes: mounts at
ecommerce-bk/app.js - Cart routes → JWT middleware: authenticates
ecommerce-bk/routes/cartRoutes.js - Cart routes → Cart service: dispatches
ecommerce-bk/routes/cartRoutes.js - Cart service → PostgreSQL pool: queries cart
ecommerce-bk/controllers/cartController.js - Navigation and count → Cart client: reads fallback
nxtrend-fd/src/components/Navbar/index.jsx