A production-ready full-stack eCommerce application for "Mahendra Chandra & Sons" - a premium bag brand selling handbags, trolley luggage, travel bags, and backpacks.
- Next.js 14 (App Router)
- Tailwind CSS
- Framer Motion
- Axios
- Node.js + Express.js
- MongoDB + Mongoose
- JWT Authentication
- bcrypt
- Node.js 18+
- MongoDB Atlas Account (cloud) OR local MongoDB installation
Option A: MongoDB Atlas (Recommended for Production)
- Create a free account at https://www.mongodb.com/cloud/atlas
- Create a free cluster
- Get your connection string (should look like:
mongodb+srv://username:password@cluster.mongodb.net/mc-sons) - Replace the connection string in
backend/.env
Option B: Local MongoDB
- Install MongoDB Community Server
- Start mongod service
- Use:
mongodb://localhost:27017/mc-sons-ecommerce
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installEdit backend/.env:
PORT=5000
MONGODB_URI=your_mongodb_connection_string_here
JWT_SECRET=your_secure_jwt_secret
JWT_EXPIRE=7dcd backend
npm startBackend runs on: http://localhost:5000
The server will automatically:
- Connect to MongoDB
- Create the admin account (if not exists)
- Seed sample products
cd frontend
npm run devApp runs on: http://localhost:3000
- Email: admin@mcsons.com
- Password: admin123
- URL: http://localhost:3000/admin
Register a new account at http://localhost:3000/register
MC-gpt/
├── backend/ # Express.js API
│ ├── config/ # Database config
│ ├── controllers/ # Business logic
│ ├── models/ # Mongoose models
│ ├── routes/ # API routes
│ ├── middleware/ # Auth, Admin, Error
│ ├── server.js # Entry point
│ └── .env # Environment variables
│
├── frontend/ # Next.js 14 App
│ ├── app/ # App Router pages
│ │ ├── page.js # Home
│ │ ├── shop/ # Shop page
│ │ ├── product/[id]/ # Product details
│ │ ├── cart/ # Shopping cart
│ │ ├── checkout/ # Checkout (COD)
│ │ ├── dashboard/ # User dashboard
│ │ ├── admin/ # Admin dashboard
│ │ ├── login/ # Login
│ │ ├── register/ # Register
│ │ ├── about/ # About page
│ │ └── contact/ # Contact page
│ ├── components/ # Reusable components
│ ├── context/ # React Context
│ ├── lib/ # API utilities
│ └── .env.local # Frontend env
│
└── README.md
- ✅ User Registration & Login
- ✅ JWT Authentication
- ✅ Browse Products by Category
- ✅ Product Search & Filters
- ✅ Product Details with Image Gallery
- ✅ Add to Cart
- ✅ Update Cart Quantity
- ✅ Remove Items from Cart
- ✅ Cash on Delivery (COD) Checkout
- ✅ Order Confirmation
- ✅ Order History Dashboard
- ✅ Admin Dashboard
- ✅ Add New Products
- ✅ Edit Products
- ✅ Delete Products
- ✅ View All Orders
- ✅ Update Order Status (Processing → Shipped → Delivered)
- ✅ Sales Summary
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/profile- Get user profile
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create product (Admin)PUT /api/products/:id- Update product (Admin)DELETE /api/products/:id- Delete product (Admin)
GET /api/cart- Get user cartPOST /api/cart/add- Add to cartPUT /api/cart/update- Update cart itemDELETE /api/cart/remove/:productId- Remove from cart
-/orders-POST /api Create order (COD)
GET /api/orders- Get user ordersGET /api/orders/:id- Get single orderGET /api/orders/all- Get all orders (Admin)PUT /api/orders/:id/status- Update order status (Admin)
- Push code to GitHub
- Import project in Vercel
- Add environment variable:
NEXT_PUBLIC_API_URL=your_backend_url - Deploy
- Push code to GitHub
- Create new Web Service
- Add environment variables
- Deploy
- Create cluster at https://www.mongodb.com/cloud/atlas
- Get connection string
- Add to backend environment
Currently using COD (Cash on Delivery). The order system is modular and ready for Razorpay or other payment gateway integration in the future.
Luxury, elegant, premium.
- Primary: Black (#0a0a0a)
- Accent: Gold (#d4af37)
- Background: Dark (#121212)
- Headings: Serif (Playfair Display)
- Body: Sans-serif (Inter/Poppins)
ISC