Skip to content

creativoma/virtual-try-on-store

Repository files navigation

Mike - Virtual Try-On Lab

Screenshot

AI-powered virtual try-on platform for experimenting with clothes online using Google Gemini 3 Pro.

Features

Virtual Try-On

  • AI-Powered: Uses Google Gemini 3 Pro for high-quality image generation
  • Example Models: Try on clothes with 5 diverse example models without uploading your photo
  • User Photos: Upload your own photo for personalized try-on experience
  • Instant Results: See yourself wearing any garment in seconds

Shopping Experience

  • 20+ Products: Curated catalog of t-shirts, hoodies, jackets, pants, and dresses
  • Functional Filters: Filter by category, gender, price range, size, and color
  • Smart Sorting: Sort by featured, price (low/high), or newest
  • Persistent Favorites: Save your favorite items (persisted across sessions)
  • Responsive Design: Optimized for mobile, tablet, and desktop
  • Nike-Inspired UI: Clean, modern, professional design

Getting Started

Prerequisites

Installation

# Install dependencies
pnpm install

Development

# Run development server
pnpm dev

# Open http://localhost:3000

Build

# Create production build
pnpm build

# Run production server
pnpm start

Configuration

API Key Setup

Required: You need your own OpenRouter API key to use the virtual try-on feature.

  1. Sign up at OpenRouter
  2. Get free credits for new accounts
  3. Copy your API key
  4. Click the settings icon (⚙️) in the app
  5. Paste your API key and save

OpenRouter provides free credits for new users, so you can start experimenting immediately!

Tech Stack

Frontend

  • Next.js 16 - React framework with App Router
  • React 19 - Latest React with modern hooks
  • TypeScript - Type-safe development
  • Tailwind CSS 4 - Utility-first styling
  • Zustand - Lightweight state management
  • Radix UI - Accessible component primitives
  • Sonner - Beautiful toast notifications

AI & Backend

  • OpenRouter API - AI model gateway
  • Google Gemini 3 Pro Image Preview - High-quality image generation
  • Next.js API Routes - Serverless backend

Development

  • ESLint - Code linting
  • Prettier - Code formatting
  • Knip - Unused code detection
  • pnpm - Fast, efficient package manager

Project Structure

├── app/
│   ├── api/                    # API routes
│   │   ├── virtual-try-on/    # Main AI generation endpoint
│   │   └── test-key/          # API key validation
│   ├── layout.tsx             # Root layout
│   └── page.tsx               # Home page
├── components/
│   ├── ui/                    # Reusable UI components (Radix + shadcn)
│   ├── product-card.tsx       # Individual product with try-on
│   ├── product-grid.tsx       # Product catalog with filters
│   ├── filter-sidebar.tsx     # Functional filter panel
│   ├── api-key-manager.tsx    # API key configuration
│   └── ...
├── lib/
│   ├── api/                   # API utilities
│   │   ├── openrouter-service.ts  # OpenRouter integration
│   │   ├── prompts.ts         # AI prompt generation
│   │   └── constants.ts       # API configuration
│   ├── encryption.ts          # Client-side key encryption
│   ├── products-data.ts       # Product catalog
│   └── example-models.ts      # Example person models
├── store/
│   ├── useAppStore.ts         # Zustand global state
│   └── types.ts               # TypeScript types
└── hooks/
    └── use-toast.ts           # Toast notifications

How It Works

  1. Choose a Model: Upload your photo or select from 5 diverse example models
  2. Browse Products: Explore 20+ clothing items with functional filters
  3. Try Virtually: Click the AI icon on any product to generate a preview
  4. See Results: Google Gemini generates a realistic preview in seconds
  5. Save Favorites: Heart icon saves items for later (persisted in localStorage)

Features Deep Dive

State Management (Zustand)

  • User image and selected example model
  • Active filters and sorting preferences
  • Persistent favorites across sessions
  • Product catalog and filtered results

Filtering System

  • Categories: T-Shirts, Hoodies, Jackets, Pants, Dresses
  • Gender: All, Men, Women, Unisex
  • Price Range: $0-$200 slider
  • Sizes: XS, S, M, L, XL, XXL
  • Colors: Black, White, Gray, Beige, Blue, Pink

Example Models

Pre-loaded diverse models for instant try-on without uploading photos:

  • Various genders, skin tones, and styles
  • High-quality Unsplash images
  • Immediate preview capability

License

Educational project - MIT License

About

AI-powered virtual try-on platform for experimenting with clothes online.

Topics

Resources

License

Stars

Watchers

Forks

Contributors