How saurabhtbj1201/megabasket works
Project Type and Purpose
• This is a full-stack e-commerce platform (“MegaBasket”) built on the MERN stack (MongoDB, Express, React, Node.js).
• It serves two main user groups: shoppers (browsing products, adding to cart, checking out) and administrators (managing products, categories, orders, users, banners, promotions).
File Structure
• Top level:
• .github/workflows—CI/CD pipeline (runs tests or deployments)
• backend/—API server and business logic
• frontend/—React single-page application (SPA)
• backend/:
• config/db.js—database connection setup
• controllers/—request handlers (adminController, authController, productController, etc.)
• models/—Mongoose schemas for Users, Products, Orders, Banners, Offers, etc.
• routes/—Express routers mapping HTTP endpoints to controllers
• middleware/—authMiddleware (JWT verification), uploadMiddleware (file handling)
• utils/—token generation, PayU integration, email sending
• server.js—entry point that wires middleware, routes, DB, and starts the server
• frontend/:
• src/:
– components/—reusable UI widgets (Header, Footer, ProductCard, Modals, etc.)
– pages/—route-driven views (HomePage, ProductDetailPage, CartPage, AdminDashboardPage, etc.)
– layouts/—wrappers for public vs. admin routes
– context/—React Contexts (AuthContext, LoadingContext)
– utils/—helper functions (cacheUtils, formatCurrency)
– App.jsx & main.jsx—React router setup and root rendering
• vite.config.js—dev server proxy to backend
• There’s a vercel.json for frontend deployment, and .github/workflows for CI.
README for Additional Insights
• Confirms MERN stack, JWT and Google OAuth for auth, AWS S3 for image hosting, PayU for payments.
• Describes features: search, filter, cart, checkout, admin dashboard, CRUD operations, email notifications.