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.
- Features
- Project Structure
- Tech Stack
- Getting Started
- API Reference
- AI Virtual Try-On
- Optional Integrations
- Database Schema
- Contributing
| 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 | β |
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
| 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) |
| Resend (stub β plug-and-play) | |
| Payments | Stripe (stub β plug-and-play) |
| Tool | Version |
|---|---|
| Node.js | 18+ |
| npm | 9+ |
| Python | 3.11+ |
| MongoDB | 6+ (local or Atlas) |
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.txtCreate the following .env files β never commit real secrets to Git.
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_xxxxxxxxxxxxAI_SERVICE_PORT=8000
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secretNEXT_PUBLIC_API_URL=http://localhost:5000cd backend
npm run seedThis creates 12 demo products and a ready-to-use admin account:
| Field | Value |
|---|---|
admin@vetement.com |
|
| Password | Admin@12345 |
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| 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 |
| 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 |
| 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 |
| Method | Endpoint | Access | Description |
|---|---|---|---|
POST |
/tryon |
π Protected | Submit try-on (garment + user photo) |
GET |
/my-tryons |
π Protected | Retrieve past try-on results |
The try-on pipeline runs in three steps:
- Select a garment from the product catalog
- Upload a full-body photo of yourself
- 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.
npm install stripeinsidebackend/- Add
STRIPE_SECRET_KEY=sk_test_...tobackend/.env - Uncomment the Stripe logic in
backend/src/services/payment.service.js
npm install resendinsidebackend/- Add
RESEND_API_KEYandFROM_EMAILtobackend/.env - Uncomment the Resend logic in
backend/src/services/email.service.js
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
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m "feat: add your feature" - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
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.