Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β–ˆβ–ˆβ•—     β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•

LUXE β€” Premium Fashion E-Commerce

A production-grade, full-stack clothing store built with Next.js 14

Next.js React Firebase MongoDB Razorpay Tailwind CSS

Inspired by Zara Β· H&M Β· Myntra Β· TotΓͺme

Live Demo Β· Report Bug Β· Request Feature


✦ Overview

LUXE is a fully featured premium clothing store with real authentication, real payments, phone/email OTP verification, WhatsApp order fulfilment, and an editorial luxury design. Built for a real cloth shop wanting to digitise β€” zero compromise on quality.

Customer visits β†’ Browses β†’ Adds to cart β†’ Logs in β†’ Pays via Razorpay
β†’ Order auto-sent to shop WhatsApp β†’ Shop owner confirms β†’ Done.

πŸ—‚οΈ Complete Folder Structure

luxe-store/
β”‚
β”œβ”€β”€ πŸ“ app/                              # Next.js 14 App Router
β”‚   β”œβ”€β”€ layout.jsx                       # Root layout β€” fonts, AuthProvider
β”‚   β”œβ”€β”€ page.jsx                         # Home page
β”‚   β”œβ”€β”€ globals.css                      # Tailwind base + custom utilities
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ shop/page.jsx                 # Shop β€” filters, sorting, grid
β”‚   β”œβ”€β”€ πŸ“ product/[id]/page.jsx         # Product detail β€” gallery, size/colour picker
β”‚   β”œβ”€β”€ πŸ“ cart/page.jsx                 # Cart β€” live qty, free shipping bar
β”‚   β”œβ”€β”€ πŸ“ checkout/page.jsx             # Checkout β€” Razorpay + WhatsApp dispatch
β”‚   β”œβ”€β”€ πŸ“ wishlist/page.jsx             # Saved products
β”‚   β”œβ”€β”€ πŸ“ login/page.jsx                # Sign in β€” Email + Google OAuth
β”‚   β”œβ”€β”€ πŸ“ signup/page.jsx               # Sign up β€” with phone field + strength meter
β”‚   β”œβ”€β”€ πŸ“ account/page.jsx              # Dashboard β€” Email OTP + Phone OTP verify
β”‚   β”œβ”€β”€ πŸ“ about/page.jsx                # Brand story, team, timeline, press
β”‚   β”œβ”€β”€ πŸ“ contact/page.jsx              # Contact form + WhatsApp CTA + FAQs
β”‚   β”œβ”€β”€ πŸ“ size-guide/page.jsx           # Women / Men / Kids size tables
β”‚   β”œβ”€β”€ πŸ“ shipping/page.jsx             # Shipping options + returns policy
β”‚   β”œβ”€β”€ πŸ“ order-tracking/page.jsx       # Live order status by Order ID
β”‚   β”œβ”€β”€ πŸ“ faqs/page.jsx                 # 25 FAQs β€” searchable, categorised
β”‚   β”‚
β”‚   └── πŸ“ api/                          # Next.js API Routes (backend)
β”‚       β”œβ”€β”€ πŸ“ auth/
β”‚       β”‚   β”œβ”€β”€ sync-user/route.js       # POST β€” Firebase β†’ MongoDB upsert
β”‚       β”‚   β”œβ”€β”€ me/route.js              # GET/PATCH β€” fetch/update profile
β”‚       β”‚   β”œβ”€β”€ send-email-otp/route.js  # POST β€” generate + email 6-digit OTP
β”‚       β”‚   β”œβ”€β”€ verify-email-otp/route.js# POST β€” verify OTP, mark emailVerified
β”‚       β”‚   └── verify-phone/route.js    # POST β€” mark phoneVerified after SMS OTP
β”‚       β”œβ”€β”€ πŸ“ create-order/route.js     # POST β€” create Razorpay order (server-side)
β”‚       └── πŸ“ verify-payment/route.js   # POST β€” HMAC signature verification
β”‚
β”œβ”€β”€ πŸ“ components/
β”‚   β”œβ”€β”€ πŸ“ layout/
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx                   # Sticky β€” search overlay, user dropdown, mobile drawer
β”‚   β”‚   └── Footer.jsx                   # Newsletter, links, contact, socials
β”‚   β”œβ”€β”€ πŸ“ sections/                     # Home page sections
β”‚   β”‚   β”œβ”€β”€ HeroSection.jsx
β”‚   β”‚   β”œβ”€β”€ MarqueeBar.jsx
β”‚   β”‚   β”œβ”€β”€ CategoriesSection.jsx
β”‚   β”‚   β”œβ”€β”€ FeaturedSection.jsx
β”‚   β”‚   β”œβ”€β”€ TrendingSection.jsx
β”‚   β”‚   β”œβ”€β”€ PromoBanner.jsx
β”‚   β”‚   β”œβ”€β”€ TestimonialsSection.jsx
β”‚   β”‚   └── InstagramSection.jsx
β”‚   └── πŸ“ ui/
β”‚       └── ProductCard.jsx              # Card β€” quick-add, wishlist, colour dots
β”‚
β”œβ”€β”€ πŸ“ contexts/
β”‚   └── AuthContext.jsx                  # Global auth state β€” useAuth() hook
β”‚
β”œβ”€β”€ πŸ“ lib/
β”‚   β”œβ”€β”€ firebase.js                      # Firebase client SDK (browser)
β”‚   β”œβ”€β”€ firebaseAdmin.js                 # Firebase Admin SDK (server only)
β”‚   β”œβ”€β”€ mongodb.js                       # Mongoose connection with singleton pooling
β”‚   β”œβ”€β”€ products.js                      # 13 dummy products + SHOP_WHATSAPP config
β”‚   └── store.js                         # Zustand β€” cart + wishlist (localStorage)
β”‚
β”œβ”€β”€ πŸ“ models/
β”‚   β”œβ”€β”€ User.js                          # Mongoose user schema
β”‚   └── OtpToken.js                      # OTP schema with 10-min TTL auto-expiry
β”‚
β”œβ”€β”€ .env.local                           # πŸ” All secrets (never committed)
β”œβ”€β”€ .env.example                         # Template for onboarding
β”œβ”€β”€ .gitignore
β”œβ”€β”€ next.config.js
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ postcss.config.js
└── package.json

⚑ Feature Highlights

πŸ›οΈ Shopping Experience

Feature Details
Home Page Hero banner, animated marquee, categories, featured, trending, promo splits, testimonials, Instagram grid
Shop Page Filter by category / price / size / colour, live sort (newest, trending, price, rating)
Product Page Multi-image gallery, size + colour selector, quantity picker, add-to-cart, WhatsApp enquiry
Cart Real-time qty updates, free shipping progress bar, coupon input
Wishlist Save/remove products, persisted via Zustand + localStorage
Search Instant live overlay β€” searches name, category, description

πŸ’³ Payments β€” Razorpay

Step What happens
1 POST /api/create-order β€” server creates Razorpay order, returns order_id
2 Razorpay modal opens with order_id (card, UPI, net banking, wallets, EMI)
3 POST /api/verify-payment β€” HMAC signature verification on server
4 WhatsApp auto-opens with full order + Payment ID + Order ID

πŸ” Authentication β€” Firebase + MongoDB

Method Flow
Google OAuth One-click Google sign-in β†’ auto email-verified
Email / Password Register with name, email, phone, password β†’ email OTP verification
Forgot Password Reset link sent via Firebase
Email OTP 6-digit OTP via Gmail SMTP β†’ marks emailVerified in MongoDB + Firebase
Phone OTP SMS via Firebase PhoneAuthProvider β†’ updatePhoneNumber on current user

πŸ“§ Email OTP System

Click "Verify Email"
  β†’ POST /api/auth/send-email-otp
  β†’ 6-digit OTP generated, stored in MongoDB (TTL: 10 min, max attempts: 5)
  β†’ Branded HTML email sent via nodemailer (Gmail SMTP)
  β†’ Inline 6-box OTP input appears

User enters OTP
  β†’ POST /api/auth/verify-email-otp
  β†’ OTP checked, attempt counter enforced
  β†’ emailVerified = true in MongoDB + Firebase Admin SDK
  β†’ Green "Verified βœ“" badge appears instantly

πŸ“± Phone OTP System

Click "Verify Now" / "Add & Verify"
  β†’ Invisible reCAPTCHA via Firebase
  β†’ PhoneAuthProvider.verifyPhoneNumber β†’ SMS sent
  β†’ 6-box OTP input (auto-advance, auto-submit, paste support)

User enters OTP
  β†’ PhoneAuthProvider.credential(verificationId, code)
  β†’ updatePhoneNumber(auth.currentUser, credential)
  β†’ phoneVerified = true in MongoDB
  β†’ Green "Verified βœ“" badge appears instantly

πŸ’¬ WhatsApp Order Fulfilment

After Razorpay payment is confirmed, WhatsApp auto-opens with:

βœ… PAYMENT CONFIRMED β€” LUXE STORE
━━━━━━━━━━━━━━━━━━━━━
πŸ’³ Payment ID: pay_Qx7mK9rTpLnW4z
πŸ“‹ Order ID:   order_XXXXXXXXXX

πŸ‘€ CUSTOMER DETAILS
Name:    Priya Sharma
Phone:   9876543210
Address: 23, Palm Grove, Mumbai β€” 400050

🧾 ORDER DETAILS
1. Ivory Linen Blazer
   β€’ Size: S  β€’ Colour: Ivory  β€’ Qty: 1  β€’ β‚Ή4,299

πŸ’° GRAND TOTAL: β‚Ή6,997

πŸš€ Setup Guide

Prerequisites

  • Node.js 18+
  • A Firebase project
  • A MongoDB Atlas cluster
  • A Razorpay account
  • A Gmail account (for email OTP)

Step 1 β€” Clone & Install

git clone https://github.com/your-username/luxe-store.git
cd luxe-store
npm install

Step 2 β€” Environment Variables

Copy the template and fill in your values:

cp .env.example .env.local

Open .env.local:

# ── RAZORPAY ─────────────────────────────────────────────────────────────────
# dashboard.razorpay.com β†’ Settings β†’ API Keys
RAZORPAY_KEY_ID=rzp_test_XXXXXXXXXXXXXXXX
RAZORPAY_KEY_SECRET=XXXXXXXXXXXXXXXXXXXXXXXX
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_test_XXXXXXXXXXXXXXXX

# ── FIREBASE (Client β€” safe to expose) ───────────────────────────────────────
# console.firebase.google.com β†’ Project Settings β†’ Your Apps β†’ Web
NEXT_PUBLIC_FIREBASE_API_KEY=AIzaSy...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789
NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789:web:abc123

# ── FIREBASE ADMIN (Server only β€” NEVER prefix with NEXT_PUBLIC_) ─────────────
# console.firebase.google.com β†’ Project Settings β†’ Service Accounts β†’ Generate Key
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=firebase-adminsdk@your-project.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_KEY\n-----END PRIVATE KEY-----\n"

# ── MONGODB ───────────────────────────────────────────────────────────────────
# cloud.mongodb.com β†’ Connect β†’ Drivers
MONGODB_URI=mongodb+srv://user:pass@cluster0.xxxxx.mongodb.net/luxe_store

# ── EMAIL / SMTP (for Email OTP) ──────────────────────────────────────────────
# Gmail App Password: myaccount.google.com β†’ Security β†’ App Passwords
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-gmail@gmail.com
SMTP_PASS=xxxx-xxxx-xxxx-xxxx

Step 3 β€” Firebase Console Setup

  1. Go to console.firebase.google.com β†’ your project
  2. Authentication β†’ Sign-in method β†’ Enable:
    • βœ… Email/Password
    • βœ… Google
    • βœ… Phone
  3. Authentication β†’ Settings β†’ Authorized domains β†’ Add localhost
  4. Project Settings β†’ Service Accounts β†’ Generate new private key β†’ download JSON β†’ copy values to .env.local

Step 4 β€” MongoDB Atlas Setup

  1. Go to cloud.mongodb.com β†’ your cluster
  2. Security β†’ Network Access β†’ Add IP Address β†’ Allow Access From Anywhere (0.0.0.0/0)
  3. Security β†’ Database Access β†’ Create a user with Read and Write access
  4. Databases β†’ Connect β†’ Drivers β†’ copy the connection string to MONGODB_URI

Step 5 β€” Gmail App Password (for Email OTP)

  1. Go to myaccount.google.com β†’ Security
  2. Enable 2-Step Verification (required)
  3. Search "App Passwords" β†’ Select app: Mail β†’ Generate
  4. Copy the 16-character password β†’ paste into SMTP_PASS in .env.local

Step 6 β€” Configure WhatsApp Number

Open lib/products.js:

export const SHOP_WHATSAPP = "919876543210"; // 91 + 10-digit number

Step 7 β€” Run

npm run dev        # Development
npm run build      # Production build
npm start          # Start production server

Open http://localhost:3000 πŸŽ‰


🎨 Design System

Element Value
Display Font Cormorant Garamond (300, 400, 500, 600, 700)
Body Font DM Sans (300, 400, 500, 600)
Primary Palette Stone 50–900, White, Champagne #f5ede0, Cream #faf8f5
Style Direction Editorial luxury β€” Zara Γ— TotΓͺme Γ— Brunello Cucinelli
Animation Library Framer Motion 11 β€” stagger, fade-up, spring, presence
Icon Library Lucide React

πŸ“¦ Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
UI React 18 + Tailwind CSS 3
Animation Framer Motion 11
Auth Firebase Auth (Email, Google, Phone OTP)
Database MongoDB Atlas + Mongoose
Payments Razorpay (Cards, UPI, Net Banking, Wallets, EMI)
Email Nodemailer + Gmail SMTP
State Zustand 4 (cart + wishlist, persisted)
Icons Lucide React

πŸ› οΈ Customisation

Add / Edit Products

Open lib/products.js and add to the products array:

{
  id:            "unique-id",
  name:          "Product Name",
  category:      "Women",              // "Women" | "Men" | "Kids"
  gender:        "Women",
  price:         2999,
  originalPrice: 4000,                 // optional β€” shows discount badge
  images:        ["url1", "url2"],
  sizes:         ["XS", "S", "M", "L", "XL"],
  colors:        ["Black", "White"],
  colorHex:      { Black: "#1a1a1a", White: "#FFFFFF" },
  description:   "Product description...",
  tag:           "New Arrival",        // "New Arrival" | "Bestseller" | "Trending"
  trending:      true,
  featured:      true,
  rating:        4.8,
  reviews:       120,
  fabric:        "100% Cotton",
  care:          "Machine wash cold",
}

Add a New Page

mkdir app/my-page && touch app/my-page/page.jsx

Import Navbar and Footer from @/components/layout/ and you're live.


πŸ”’ Security Notes

  • .env.local is in .gitignore β€” secrets are never committed
  • FIREBASE_PRIVATE_KEY lives server-side only β€” never prefixed with NEXT_PUBLIC_
  • RAZORPAY_KEY_SECRET lives server-side only β€” payment signatures verified on server
  • OTP attempts are capped at 5 per token β€” brute force protected
  • OTP tokens auto-expire in 10 minutes via MongoDB TTL index

πŸ“„ All Pages at a Glance

Route Page
/ Home
/shop Shop (filters + sorting)
/product/[id] Product Detail
/cart Shopping Cart
/checkout Checkout + Razorpay
/wishlist Wishlist
/login Sign In
/signup Create Account
/account Account Dashboard
/about About Us
/contact Contact + FAQs
/size-guide Size Guide
/shipping Shipping & Returns
/order-tracking Track Order
/faqs Frequently Asked Questions

πŸ“ License

MIT β€” free to use, modify, and deploy for commercial projects.


Built with β™₯ for premium fashion retail

LUXE β€” Where every detail is intentional.

About

A Full Stack Clothing Website With Payment And OTP Integration.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages