How ansh-raj08/carnival works
Carnival is a MERN storefront and inventory administration platform. Customers browse and filter the catalogue, inspect products, maintain a persistent cart or wishlist, then check out with simulated payment and track orders; administrators manage inventory, categories, and order status. The React app routes page workflows through domain services to the Express API, whose controllers apply business rules to MongoDB models. The README documents additional capabilities not visible in sampled page source. Edges reflect shown calls, imports, or documented API behavior; unsampled implementation details are not inferred.
Main entry points: App.jsx React App Router · server.js Express API · orderRoutes.js Order Routes and Controller · authMiddleware.js JWT and Admin Access
Components 33
Storefront
- React App Router
client/src/App.jsx - Editorial Home
client/src/pages/HomePage.jsx - Catalogue Search
client/src/pages/ShopPage.jsx - Product Details
client/src/pages/ProductDetailPage.jsx - Product API Client
client/src/services/productService.js
Customer Account
- Authentication State
client/src/context/AuthContext.jsx - Auth API Client
client/src/services/authService.js - Checkout
client/src/pages/CheckoutPage.jsx - Profile and Addresses
client/src/pages/ProfilePage.jsx - Order Tracking
client/src/pages
Admin Portal
- Inventory and Categories
client/src/pages - Order Administration
client/src/pages/AdminOrdersPage.jsx - Admin Metrics
client/src/pages/AdminDashboardPage.jsx
API and Domain
- HTTP API Client
client/src/services/api.js - Express API
server/server.js - Auth Routes and Controller
server/routes/authRoutes.js - Product Routes and Controller
server/routes/productRoutes.js - Cart Routes and Controller
server/routes/cartRoutes.js - Wishlist Routes and Controller
server/routes/wishlistRoutes.js - Category Routes and Controller
server/routes/categoryRoutes.js - Order Routes and Controller
server/routes/orderRoutes.js - JWT and Admin Access
server/middleware/authMiddleware.js - Input Validation
server/utils/validators.js
Persistence
- MongoDB Connection
server/config/db.js - User and Address
server/models/User.js - Product and Reviews
server/models/Product.js - Category
server/models/Category.js - Persistent Cart
server/models/Cart.js - Persistent Wishlist
server/models/Wishlist.js - Orders
server/models/Order.js
Other components
- Shopper
- Administrator
- MongoDB Atlas
Connections 42
- Shopper → React App Router: uses
client/src/App.jsx - Administrator → React App Router: uses
client/src/App.jsx - React App Router → Editorial Home: routes
client/src/App.jsx - React App Router → Catalogue Search: routes
client/src/App.jsx - React App Router → Product Details: routes
client/src/App.jsx - Catalogue Search → Product API Client: uses
- Product Details → Product API Client: uses
- React App Router → Authentication State: provides state
client/src/App.jsx - Authentication State → Auth API Client: calls
client/src/context/AuthContext.jsx - React App Router → Checkout: routes
client/src/App.jsx - React App Router → Profile and Addresses: routes
client/src/App.jsx - React App Router → Order Tracking: routes
client/src/App.jsx - React App Router → Inventory and Categories: routes
client/src/App.jsx - React App Router → Order Administration: routes
client/src/App.jsx - React App Router → Admin Metrics: routes
client/src/App.jsx - Auth API Client → HTTP API Client: calls
client/src/services/authService.js - Product API Client → HTTP API Client: calls
client/src/services/productService.js - HTTP API Client → Express API: HTTP requests
- Express API → Auth Routes and Controller: mounts
server/server.js - Express API → Product Routes and Controller: mounts
server/server.js - Express API → Cart Routes and Controller: mounts
server/server.js - Express API → Wishlist Routes and Controller: mounts
server/server.js - Express API → Category Routes and Controller: mounts
server/server.js - Express API → Order Routes and Controller: mounts
server/server.js - Auth Routes and Controller → JWT and Admin Access: guards
server/routes/authRoutes.js - Product Routes and Controller → JWT and Admin Access: guards
server/routes/productRoutes.js - Cart Routes and Controller → JWT and Admin Access: guards
server/routes/cartRoutes.js - Order Routes and Controller → JWT and Admin Access: guards
server/routes/orderRoutes.js - JWT and Admin Access → User and Address: loads user
server/middleware/authMiddleware.js - Order Routes and Controller → Orders: reads and writes
- Order Routes and Controller → Product and Reviews: updates stock
- Order Routes and Controller → Persistent Cart: reads and clears
- Order Routes and Controller → User and Address: reads addresses
- Product Routes and Controller → Product and Reviews: reads and writes
- Product Routes and Controller → Category: checks category
- Cart Routes and Controller → Persistent Cart: reads and writes
- Cart Routes and Controller → Product and Reviews: checks stock
- Category Routes and Controller → Category: reads and writes
- Wishlist Routes and Controller → Persistent Wishlist: reads and writes
- Wishlist Routes and Controller → Product and Reviews: checks products
- Express API → MongoDB Connection: connects
server/server.js - MongoDB Connection → MongoDB Atlas: connects
README.md