How vinay99199/grocery-store works
This is a grocery e-commerce application. Customers browse products, manage a cart, and submit a checkout; the backend validates stock and delivery eligibility, creates orders, and sends notifications. Customers can then view order status, while administrators manage the catalog and orders. The README also documents product requests, analytics, reviews, wishlists, and delivery OTPs. Source excerpts show the order and review paths; other documented capabilities are represented at their exact tree paths, with uncertain internal links omitted.
Main entry points: orderController.js Order lifecycle · api.js API client · AppRoutes.jsx Page routing · AdminDashboard.jsx Admin dashboard
Components 34
Customer and admin UI
- UI entry
frontend/src/App.jsx - Page routing
frontend/src/routes/AppRoutes.jsx - Authentication state
frontend/src/context/AuthContext.jsx - Auth hook
frontend/src/hooks/useAuth.js - Product browsing
frontend/src/pages/Products.jsx - Checkout
frontend/src/pages/Checkout.jsx - Order views
frontend/src/pages/OrderDetail.jsx - Admin dashboard
frontend/src/pages/AdminDashboard.jsx - Request service
frontend/src/services/requestService.js
API and access
- API client
frontend/src/services/api.js - Express app
backend/app.js - Authentication routes
backend/routes/authRoutes.js - Authentication
backend/controllers/authController.js - Product routes
backend/routes/productRoutes.js - User records
backend/models/User.js - Authentication gate
backend/middleware/authMiddleware.js - Admin gate
backend/middleware/adminMiddleware.js
Catalog and shopping
- Catalog operations
backend/controllers/productController.js - Category operations
backend/controllers/categoryController.js - Cart operations
backend/controllers/cartController.js - Product records
backend/models/Product.js - Category records
backend/models/Category.js - Cart records
backend/models/Cart.js - Wishlist capability
backend/controllers/wishlistController.js - Product requests
backend/models/ProductRequest.js - Product reviews
backend/controllers/reviewController.js
Orders and engagement
- Order lifecycle
backend/controllers/orderController.js - Order records
backend/models/Order.js - Delivery pricing
backend/utils/deliveryRules.js - Notification service
backend/services/notificationService.js - Notification records
backend/models/Notification.js - Store analytics
backend/controllers/analyticsController.js
Other components
- Customer
- Administrator
Connections 38
- Customer → UI entry: uses
README.md - Administrator → UI entry: uses
README.md - UI entry → Page routing: renders
frontend/src/App.jsx - Page routing → Auth hook: checks state
frontend/src/routes/AppRoutes.jsx - Auth hook → Authentication state: reads
frontend/src/hooks/useAuth.js - Page routing → Product browsing: routes to
frontend/src/routes/AppRoutes.jsx - Page routing → Admin dashboard: routes to
frontend/src/routes/AppRoutes.jsx - Product browsing → API client: requests data
- Checkout → API client: submits order
- Order views → API client: requests orders
- Admin dashboard → API client: requests admin data
frontend/src/pages/AdminDashboard.jsx - API client → Express app: calls API
- Express app → Authentication routes: mounts
backend/app.js - Express app → Product routes: mounts
backend/app.js - Product routes → Catalog operations: dispatches
backend/routes/productRoutes.js - Catalog operations → Product records: reads and writes
backend/controllers/productController.js - Catalog operations → Category records: uses categories
backend/controllers/productController.js - Category operations → Category records: reads and writes
backend/controllers/categoryController.js - Cart operations → Cart records: reads and writes
backend/controllers/cartController.js - Cart operations → Product records: checks products
backend/controllers/cartController.js - Authentication routes → Authentication: dispatches
backend/routes/authRoutes.js - Authentication → User records: reads and writes
backend/controllers/authController.js - Product routes → Authentication gate: protects routes
backend/routes/productRoutes.js - Product routes → Admin gate: guards admin actions
backend/routes/productRoutes.js - Admin gate → User records: checks role
backend/middleware/adminMiddleware.js - Order lifecycle → Order records: creates and updates
backend/controllers/orderController.js - Order lifecycle → Cart records: loads and clears
backend/controllers/orderController.js - Order lifecycle → User records: updates purchases
backend/controllers/orderController.js - Order lifecycle → Product records: checks stock
backend/controllers/orderController.js - Order lifecycle → Delivery pricing: calculates charge
backend/controllers/orderController.js - Order lifecycle → Notification service: creates alerts
backend/controllers/orderController.js - Notification service → Notification records: saves alerts
backend/services/notificationService.js - Product reviews → Product records: updates reviews
backend/controllers/reviewController.js - Product reviews → Order records: checks purchase
backend/controllers/reviewController.js - Admin dashboard → Store analytics: views metrics
- Admin dashboard → Product requests: handles requests
- Request service → Product requests: submits requests
- Customer → Wishlist capability: manages wishlist