OOTDify is a mobile-first AI fashion assistant built with Expo (React Native) and a Flask AI backend. It helps you build a private wardrobe, generate outfit ideas, run virtual try-ons, and keep your photos secure.
Privacy-first by design: wardrobe images and body photos are stored in private, per-user storage buckets and are only ever shown to the owner via short-lived signed URLs. No fake data — every screen renders real rows, and failures are honest and clearly explained.
- Wardrobe — add clothes by photo, tag category/color/size/brand/style/ season/occasion, search, filter, favorite, edit, and delete. Multiple photo uploads with per-image success/failure reporting.
- AI styling — image analysis (detection, pose, segmentation) and server-side outfit recommendations + complete looks over the real catalog.
- AI Outfit Picker — pick an occasion/weather and get ready-to-save looks,
composed server-side from real catalog pieces (
/api/outfits). - Virtual try-on — 5-step workflow (Photo → Clothing → Generate → Review → Save) with an honest "model not configured" state until a real VTON model is provided server-side.
- Outfit builder — compose outfits from your wardrobe + catalog, save looks, and get compatibility scoring.
- Profile & preferences — first/last name, avatar, favorite styles, colors, sizes, occasions; privacy & data controls (export, clear, delete account).
- Shopping integration architecture — a runtime provider registry for Shopee/TikTok Shop etc. Nothing is scraped; providers plug in through one interface with honest "not configured" messaging until one exists.
- Expo SDK 57 + React Native + Expo Router
- TypeScript + Zustand
- Supabase — Auth, Postgres (RLS), and private Storage
- Flask AI backend + Ultralytics YOLO (detection / pose / segmentation)
- Reanimated +
expo-imagefor smooth UI
Expo app (dev build / device) ──HTTP──▶ Flask backend (:5000)
│ │
└──────────▶ Supabase (Auth + DB + Storage) ◀── service-role client (backend only)
OOTDify/
├── src/ # Expo Router app
│ ├── app/ # routes only: (auth), (tabs), catalog, item, outfit, privacy
│ ├── features/ # capture, clothing, shopping, tryon, wardrobe, outfit, history
│ ├── services/ # apiClient (error-aware), aiApi (typed backend client)
│ └── shared/ # components, config (theme, api), hooks, lib (supabase)
├── backend/ # Flask AI backend (app.py, routes/, services/, models/, tests/)
├── supabase/schema.sql # full DB schema: tables, RLS, storage buckets, seed catalog
├── docker-compose.yml # optional backend container (see Docker section)
└── .env.local # Expo public env (gitignored) — copy from .env.example
- Node 20+ and npm
- Python 3.12
- A Supabase project (free tier is fine)
- An Android phone (or emulator) with the OOTDify dev build installed. Expo Go is not enough: live try-on uses native modules (VisionCamera, fast-tflite, WebRTC)
The app relies on tables and storage buckets that live in
supabase/schema.sql. This must be applied to your Supabase project or features
fail with errors like storageApiError: bucket not found.
- Open your Supabase project → SQL Editor → paste the contents of
supabase/schema.sql→ Run. The script is idempotent (safe to re-run). - It creates: all tables + RLS policies, the private storage buckets
(
users,wardrobe,tryons,avatars) and the publicclothingbucket, storage object policies, and a small seed catalog.
If you later see bucket not found, the schema was not applied (or was applied
before the storage section existed) — re-run supabase/schema.sql.
The picker and recommender draw from public.clothing. To go beyond the 10-item
seed, ingest a real public dataset — the Fashion Product Images dataset
(44k product photos with category / colour / usage metadata), fetched over plain
HTTPS from the Hugging Face datasets mirror. No Kaggle account or token is
needed.
cd backend
.\.venv\Scripts\python.exe scripts\ingest_fashion.py --limit 1200 # ~1,200 items
.\.venv\Scripts\python.exe scripts\ingest_fashion.py --reset # undo an ingestionThe run is idempotent (already-ingested rows are skipped) and category-balanced
(article types like T-Shirts, Shorts, Jeans, Sneakers, Jackets, Dresses, Bags
are each capped so one category can't dominate). Images are uploaded to the
public clothing bucket and every clothing row carries real image_urls.
Run with --dry-run first to preview the distribution.
Only public keys go into Expo. Private credentials live in
backend/.env only.
Expo — copy .env.example → .env.local:
EXPO_PUBLIC_SUPABASE_URL=https://<project-ref>.supabase.co
EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-publishable-or-anon-key
# Flask backend URL — your PC's LAN IP when testing on a real phone:
EXPO_PUBLIC_API_URL=http://192.168.1.50:5000For the API URL: physical phone → your PC's LAN IPv4 (ipconfig); Android
emulator → http://10.0.2.2:5000; iOS simulator / web → http://localhost:5000.
If EXPO_PUBLIC_API_URL is left unset on a phone, the app derives the LAN host
from Metro automatically.
Backend — copy backend/.env.example → backend/.env and fill in:
SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key # NEVER in EXPO_PUBLIC_*
TRYON_MODEL_PATH= # optional VTON weightscd backend
python -m venv .venv
.venv\Scripts\Activate.ps1 # Windows — or: source .venv/bin/activate
pip install -r requirements.txt
python app.pyVerify connectivity (Terminal 1 stays running):
Invoke-WebRequest http://127.0.0.1:5000/health # PowerShell
# => {"status":"ok","service":"ootdify-ai","version":"1.0.0","model_loaded":true}npx expo startOpen the installed dev build on your phone (phone and PC must be on the same Wi-Fi) and
connect to Metro. Build and install the dev build once, and again when native
dependencies or plugins change (Windows, from a short-path copy at C:\o; see
REMAINING_TASKS.md §3 for the full steps):
npx expo prebuild --platform android --no-install
cd android && gradlew assembleDebug -PreactNativeArchitectures=arm64-v8a
adb install -r app/build/outputs/apk/debug/app-debug.apkPress a for an emulator, w for web.
Instead of running the backend and Expo in separate terminals, kick off both from the repo root:
npm run devThis launches the Flask backend (backend/app.py, reusing backend/.venv if
present) and npx expo start side by side, with [backend] / [expo]
prefixed logs. Ctrl+C shuts both down.
npm run backend— backend onlynpm run expo— Expo onlynpm run dev— both (default)
A Dockerfile (in backend/) and docker-compose.yml are provided for anyone
who prefers the backend in a container. Not required — the venv flow above
is the primary path.
# from the repo root, with backend/.env optionally configured first
docker compose up --build
# verify
Invoke-WebRequest http://127.0.0.1:5000/healthNotes:
env_fileis optional: without it the app boots and/healthworks, while Supabase-backed routes pause gracefully ("Supabase not configured").uploads/,outputs/,data/, andmodels/are volume-mounted so model weights (auto-downloaded on first boot) and job data persist across restarts.
The Google and Facebook buttons (src/shared/lib/oauth.ts) both use
browser-based OAuth through Supabase — no native SDK config (Info.plist /
SHA-1 fingerprints) is required. For either provider to complete, the
server side must be set up:
- Supabase Dashboard → Authentication → Providers: enable Google (paste the OAuth Client ID + Secret from the Google Cloud Console) and/or Facebook (Client ID + Secret from the Meta for Developers app).
- Supabase Dashboard → Authentication → URL Configuration → Redirect URLs:
add
ootdify://(the redirect URI this app produces natively; the exact value is logged during development). - Provider console → authorized redirect URIs: register the Supabase
callback URL
https://<project-ref>.supabase.co/auth/v1/callback(Google: Authorized redirect URIs; Facebook: Valid OAuth Redirect URIs).
The flow handles implicit tokens and PKCE (code → exchangeCodeForSession),
then the root layout routes to the app once onAuthStateChange reports a
session. If a provider isn't enabled, sign-in fails with Supabase's own message
(e.g. "provider is not enabled") rather than a fabricated success.
npx tsc --noEmit # TypeScript
npm test # Jest (outfit generator + compatibility)
cd backend && .\.venv\Scripts\python.exe -m pytest -q
npx expo-doctor # project health
npx expo export -p web # static web export (sanitizes build)- No private keys in the client. Only
EXPO_PUBLIC_*variables exist in the Expo bundle; the service-role key lives inbackend/.envexclusively. - Identity is derived from the validated Supabase session token server-side —
the client never sends a
user_id. - Storage buckets are private; the backend hands out short-lived signed URLs.
- Storage RLS/object policies enforce
auth.uid() = owner_idfor every user-owned bucket.
- Plug a real virtual-try-on model into
backend/services/tryon_service.py. - Register Shopee / TikTok Shop providers in
src/features/shopping/. - Swap the rule-based scorer in
backend/services/recommender_service.pyfor a model-based one (e.g. embeddings) while keeping the same signature — the UI renders whatever catalog ids the/api/recommendand/api/outfitscontracts return.