A Chrome extension that enables virtual try-on of clothing items using Google Gemini Nano Banana. Users can try on clothes from Amazon and see how they look before purchasing.
- Virtual try-on using AI image generation
- User profile with measurements and photos
- BYOK (Bring Your Own Key) support - use your own Gemini API key
- Privacy-first (local storage for user data)
This repository contains:
extension/- Chrome extension (TypeScript + React)backend/- Backend API (Node.js + Express, currently not required for BYOK mode)
- Bun (install from https://bun.sh)
- Chrome browser (for testing the extension)
- Google Gemini API key (required for BYOK mode)
- PostgreSQL (optional, only needed if using backend features)
-
Clone the repository:
git clone <repository-url> cd fastfit
-
Install dependencies:
bun install
This will install dependencies for the project. The extension now includes its own local type definitions and does not require a separate
sharedworkspace. -
Set up environment variables (optional):
Create
.envfiles if you need to configure the backend:Root
.env(optional):NODE_ENV=development API_URL=http://localhost:3000
Extension
.env(optional):VITE_API_URL=http://localhost:3000
Backend
.env(optional, only if using backend):PORT=3000 NODE_ENV=development API_URL=http://localhost:3000 GEMINI_API_KEY=your_gemini_api_key_here DATABASE_URL=postgresql://user:password@localhost:5432/fastfit CORS_ORIGIN=*
-
Set up the database (optional, only if using backend):
cd backend bunx prisma generate bunx prisma migrate dev --name init cd ..
-
Build the extension in watch mode:
bun run dev:extension
This will watch for changes and rebuild automatically.
-
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
extension/dist/directory - The extension should now appear in your extensions list
- Open Chrome and navigate to
-
Reload after changes:
- After making changes, the extension will rebuild automatically (if using
dev:extension) - In
chrome://extensions/, click the reload icon on your extension card
- After making changes, the extension will rebuild automatically (if using
Note: The backend is not required for BYOK mode and is currently a placeholder for future features. You can ignore this unless you plan to add server-side features.
Run backend in development mode:
bun run dev:backendThe backend runs on http://localhost:3000 by default.
-
Build the extension:
bun run build:extension
-
Load the extension in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
extension/dist/folder
- Open
-
Configure your API key:
- Click the extension icon in the Chrome toolbar
- Enter your Google Gemini API key in the settings
- Save your user profile (measurements and photos)
-
Navigate to an Amazon product page:
- Go to any Amazon clothing product page (e.g.,
https://www.amazon.com/dp/PRODUCT_ID) - The extension will automatically detect the product page
- Go to any Amazon clothing product page (e.g.,
-
Use the Try-On button:
- Look for the "Try On" button on the product page
- Click it to generate a virtual try-on image
- Wait for the AI image generation to complete
- View the result in the modal or overlay
-
Check for errors:
- Open Chrome DevTools (F12)
- Check the Console tab for any errors
- Check the Network tab for API calls
- Extension won't load: Verify all files are in
extension/dist/andmanifest.jsonis valid - Try-On button not appearing: Check browser console for errors, verify you're on a supported Amazon domain
- API errors: Verify your Gemini API key is correct and has sufficient quota
- Build errors: Run
bun installin the extension directory and rebuild
bun run build:extensionNote: Make sure to build the shared package first: bun run build:shared
bun run build:extensionbun run build:backendbun run build:all- Backend API is optional and minimal (not used by default)
- Extension: TypeScript, React, Vite, Chrome Manifest V3
- Backend: Node.js, Express, Prisma, PostgreSQL (optional for BYOK mode)
- AI: Google Gemini API (BYOK - Bring Your Own Key)
- Build Tool: Bun
MIT
