Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VÊTEMENT β€” AI-Powered Luxury Fashion E-Commerce

A full-stack, AI-powered fashion e-commerce platform with a Virtual Try-On system. Browse a curated luxury catalog, manage your cart, and visualize how any garment looks on your body before you buy.

Tech Stack Node Python MongoDB License


πŸ“‘ Table of Contents


✨ Features

Feature Status
Luxury product catalog (Men / Women / Accessories / New Arrivals) βœ…
Product detail page β€” image gallery, size & color selectors βœ…
Shopping cart with persistent state (Zustand) βœ…
User authentication β€” JWT (Register / Login / Profile) βœ…
Checkout with shipping address form βœ…
Order history (Account page) βœ…
Admin dashboard β€” product CRUD & order status management βœ…
AI Virtual Try-On β€” upload photo β†’ see outfit on you βœ…
Order confirmation emails (Resend-ready stub) βœ…
Stripe-ready payment service (stub) βœ…
Cloudinary image storage βœ…
Database seeding β€” 12 products + admin account βœ…

πŸ—οΈ Project Structure

dbmsEcommerceProj/
β”œβ”€β”€ frontend/               # Next.js 14 (App Router) β€” TypeScript, Tailwind CSS
β”‚   └── src/
β”‚       β”œβ”€β”€ app/            # Pages & layouts (App Router)
β”‚       β”œβ”€β”€ components/     # Reusable UI components
β”‚       β”œβ”€β”€ store/          # Zustand state management
β”‚       β”œβ”€β”€ lib/            # API client & utilities
β”‚       └── types/          # TypeScript type definitions
β”‚
β”œβ”€β”€ backend/                # Node.js / Express / MongoDB REST API
β”‚   └── src/
β”‚       β”œβ”€β”€ config/         # DB connection & env config
β”‚       β”œβ”€β”€ controllers/    # Route handler logic
β”‚       β”œβ”€β”€ middleware/      # Auth, error handling
β”‚       β”œβ”€β”€ models/         # Mongoose schemas (User, Product, Order, TryOn)
β”‚       β”œβ”€β”€ routes/         # API route definitions
β”‚       β”œβ”€β”€ services/       # Business logic (email, payment, AI)
β”‚       └── utils/          # Helpers & database seed script
β”‚
└── ai-service/             # Python / FastAPI β€” Virtual Try-On engine
    └── app/
        └── services/       # Image compositing & model runner

πŸ› οΈ Tech Stack

Layer Technology
Frontend Next.js 14, React 18, TypeScript, Tailwind CSS, Zustand, Axios
Backend Node.js 18, Express 4, MongoDB 6, Mongoose, JWT, Bcrypt
AI Service Python 3.11, FastAPI, Pillow, OpenCV, NumPy, Cloudinary SDK
Storage Cloudinary (images & try-on results)
Auth JSON Web Tokens (JWT)
Email Resend (stub β€” plug-and-play)
Payments Stripe (stub β€” plug-and-play)

πŸš€ Getting Started

Prerequisites

Tool Version
Node.js 18+
npm 9+
Python 3.11+
MongoDB 6+ (local or Atlas)

1. Clone & Install Dependencies

git clone https://github.com/<your-username>/dbmsEcommerceProj.git
cd dbmsEcommerceProj

# Frontend
cd frontend && npm install

# Backend
cd ../backend && npm install

# AI Service
cd ../ai-service
python -m venv venv
venv\Scripts\activate        # Windows
# source venv/bin/activate   # macOS / Linux
pip install -r requirements.txt

2. Configure Environment Variables

Create the following .env files β€” never commit real secrets to Git.

backend/.env

PORT=5000
MONGO_URI=mongodb://localhost:27017/fashiondb
JWT_SECRET=your_super_secret_jwt_key
JWT_EXPIRES_IN=7d
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
AI_SERVICE_URL=http://localhost:8000
NODE_ENV=development
CLIENT_URL=http://localhost:3000
# Optional β€” uncomment when Resend is active
# RESEND_API_KEY=re_xxxxxxxxxxxx
# FROM_EMAIL=orders@yourdomain.com
# Optional β€” uncomment when Stripe is active
# STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxx

ai-service/.env

AI_SERVICE_PORT=8000
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

frontend/.env.local

NEXT_PUBLIC_API_URL=http://localhost:5000

3. Seed the Database

cd backend
npm run seed

This creates 12 demo products and a ready-to-use admin account:

Field Value
Email admin@vetement.com
Password Admin@12345

4. Run All Three Services

Open three separate terminals:

# Terminal 1 β€” Frontend  β†’  http://localhost:3000
cd frontend
npm run dev

# Terminal 2 β€” Backend   β†’  http://localhost:5000
cd backend
npm run dev

# Terminal 3 β€” AI Service  β†’  http://localhost:8000
cd ai-service
venv\Scripts\activate          # Windows
# source venv/bin/activate     # macOS/Linux
uvicorn app.main:app --reload --port 8000

πŸ”Œ API Reference

Auth β€” /api/auth

Method Endpoint Access Description
POST /register Public Create a new user account
POST /login Public Login & receive JWT
GET /me πŸ”’ Protected Get current user profile
PUT /profile πŸ”’ Protected Update profile details

Products β€” /api/products

Method Endpoint Access Description
GET / Public List all products (supports filtering)
GET /:id Public Get single product
POST / πŸ‘‘ Admin Create a new product
PUT /:id πŸ‘‘ Admin Update a product
DELETE /:id πŸ‘‘ Admin Delete a product

Orders β€” /api/orders

Method Endpoint Access Description
POST / πŸ”’ Protected Place a new order
GET /my-orders πŸ”’ Protected Get current user's orders
GET /admin/all πŸ‘‘ Admin Get all orders
PATCH /:id/status πŸ‘‘ Admin Update order status

AI Try-On β€” /api/ai

Method Endpoint Access Description
POST /tryon πŸ”’ Protected Submit try-on (garment + user photo)
GET /my-tryons πŸ”’ Protected Retrieve past try-on results

🧠 AI Virtual Try-On

The try-on pipeline runs in three steps:

  1. Select a garment from the product catalog
  2. Upload a full-body photo of yourself
  3. AI composites the garment onto your photo

Current engine: PIL / OpenCV compositing β€” runs on CPU, no GPU required.
To upgrade to a diffusion model: swap ai-service/app/services/model_runner.py with an OOTDiffusion or IDM-VTON inference script when a GPU instance is available.

For a detailed breakdown of the system architecture and implementation strategy, see the Architecture and Implementation Documentation.


⚑ Optional Integrations

Stripe Payments

  1. npm install stripe inside backend/
  2. Add STRIPE_SECRET_KEY=sk_test_... to backend/.env
  3. Uncomment the Stripe logic in backend/src/services/payment.service.js

Resend Transactional Email

  1. npm install resend inside backend/
  2. Add RESEND_API_KEY and FROM_EMAIL to backend/.env
  3. Uncomment the Resend logic in backend/src/services/email.service.js

πŸ—„οΈ Database Schema

User       β†’ name, email, passwordHash, role (user | admin), addresses[]
Product    β†’ name, description, price, category, images[], sizes[], colors[], stock
Order      β†’ user, items[], shippingAddress, totalPrice, status, paymentStatus
TryOn      β†’ user, productId, userImageUrl, resultImageUrl, createdAt

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m "feat: add your feature"
  4. Push to the branch: git push origin feature/your-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.


Built as a DBMS course project β€” demonstrating full-stack development with REST APIs, JWT auth, relational-style MongoDB schemas, and an AI microservice.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages