How segjay/urbancartmern works
Urbancart is a MERN storefront with customer browsing, accounts, cart and checkout, order history, and admin product/user screens. The main flow runs from the React routes through page-level API calls to Express routes, controllers, and MongoDB models; cart and login state are managed in frontend contexts. The README only names the product, so capabilities and connections are grounded in the source index and shown excerpts. Some admin and order internals were not excerpted; their links are limited to documented references or left unasserted.
Main entry points: App.jsx Route shell · api.js API client · Checkout.jsx Checkout · server.js Express server
Components 25
Storefront
- Route shell
frontend/src/App.jsx - Storefront
frontend/src/pages/Home.jsx - Product detail
frontend/src/pages/ProductDetail.jsx - Shopping cart
frontend/src/pages/Cart.jsx - Checkout
frontend/src/pages/Checkout.jsx - Order history
frontend/src/pages/MyOrders.jsx - Product card
frontend/src/components/ProductCard.jsx
Accounts
- Login state
frontend/src/context/AuthContext.jsx - Sign in
frontend/src/pages/Login.jsx - Registration
frontend/src/pages/Register.jsx - User admin
frontend/src/pages/admin/AdminUsers.jsx - User routes
backend/routes/userRoutes.js - User handlers
backend/controllers/userController.js - User records
backend/models/User.js
Catalog
- Product admin
frontend/src/pages/admin/AdminProducts.jsx - Product routes
backend/routes/productRoutes.js - Product handlers
backend/controllers/productController.js - Product records
backend/models/product.js
Orders
- Cart state
frontend/src/context/CartContext.jsx - Order routes
backend/routes/orderRoutes.js - Order handlers
backend/controllers/orderController.js - Order records
backend/models/Order.js
API and data
- API client
frontend/src/services/api.js - Express server
backend/server.js
Other components
- Shopper
Connections 34
- Shopper → Route shell: visits
frontend/src/App.jsx - Route shell → Storefront: routes to
frontend/src/App.jsx - Route shell → Product detail: routes to
frontend/src/App.jsx - Route shell → Shopping cart: routes to
frontend/src/App.jsx - Route shell → Checkout: routes to
frontend/src/App.jsx - Route shell → Order history: routes to
frontend/src/App.jsx - Route shell → Sign in: routes to
frontend/src/App.jsx - Route shell → Registration: routes to
frontend/src/App.jsx - Route shell → Product admin: routes to
frontend/src/App.jsx - Route shell → User admin: routes to
frontend/src/App.jsx - Storefront → API client: fetches products
frontend/src/pages/Home.jsx - Storefront → Product card: renders
frontend/src/pages/Home.jsx - Product detail → API client: fetches product
frontend/src/pages/ProductDetail.jsx - Product detail → Cart state: adds item
frontend/src/pages/ProductDetail.jsx - Shopping cart → Cart state: reads and updates
frontend/src/pages/Cart.jsx - Checkout → Cart state: reads cart
frontend/src/pages/Checkout.jsx - Checkout → Login state: reads account
frontend/src/pages/Checkout.jsx - Checkout → API client: submits order
frontend/src/pages/Checkout.jsx - Order history → API client: fetches orders
frontend/src/pages/MyOrders.jsx - Sign in → Login state: sets login
frontend/src/pages/Login.jsx - Sign in → API client: authenticates
frontend/src/pages/Login.jsx - Registration → API client: registers
frontend/src/pages/Register.jsx - Product card → Cart state: adds item
frontend/src/components/ProductCard.jsx - User admin → Login state: reads account
frontend/src/pages/admin/AdminUsers.jsx - API client → Express server: HTTP requests
frontend/src/services/api.js - Express server → Product routes: mounts
backend/server.js - Express server → User routes: mounts
backend/server.js - Express server → Order routes: mounts
backend/server.js - Product routes → Product handlers: dispatches
backend/routes/productRoutes.js - Product handlers → Product records: queries and saves
backend/controllers/productController.js - User routes → User handlers: dispatches
backend/routes/userRoutes.js - User handlers → User records: queries and saves
backend/controllers/userController.js - Order routes → Order handlers: dispatches
backend/routes/orderRoutes.js - Order handlers → Order records: queries and saves
backend/controllers/orderController.js