Skip to content
onetwothirdPublic

About

OOTDify (Penggi) — an AI fashion assistant for your phone. Build a private wardrobe, get outfit ideas for any occasion, try on clothes virtually and with live AR, and compose looks. Built with Expo, React Native, Supabase and a Flask + YOLO AI backend.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1,667 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧥 OOTDify (Penggi)

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.

✨ Features

  • 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.

🛠️ Tech Stack

Expo app (dev build / device)  ──HTTP──▶  Flask backend (:5000)
        │                                   │
        └──────────▶ Supabase (Auth + DB + Storage)  ◀── service-role client (backend only)

📁 Repository Layout

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

🚀 Getting Started

0. Prerequisites

  • 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)

1. Apply the Supabase schema (once)

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.

  1. Open your Supabase project → SQL Editor → paste the contents of supabase/schema.sql → Run. The script is idempotent (safe to re-run).
  2. It creates: all tables + RLS policies, the private storage buckets (users, wardrobe, tryons, avatars) and the public clothing bucket, 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.

1b. Fill the catalog with real clothing (recommended)

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 ingestion

The 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.

2. Configure environment files

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:5000

For 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 weights

3. Run the backend

cd backend
python -m venv .venv
.venv\Scripts\Activate.ps1          # Windows — or: source .venv/bin/activate
pip install -r requirements.txt
python app.py

Verify 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}

4. Run the app

npx expo start

Open 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.apk

Press a for an emulator, w for web.

5. One command for everything (recommended)

Instead of running the backend and Expo in separate terminals, kick off both from the repo root:

npm run dev

This 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 only
  • npm run expo — Expo only
  • npm run dev — both (default)

🐳 Docker (optional)

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/health

Notes:

  • env_file is optional: without it the app boots and /health works, while Supabase-backed routes pause gracefully ("Supabase not configured").
  • uploads/, outputs/, data/, and models/ are volume-mounted so model weights (auto-downloaded on first boot) and job data persist across restarts.

🔐 Social Sign-In Setup (Google & Facebook)

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:

  1. 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).
  2. Supabase Dashboard → Authentication → URL Configuration → Redirect URLs: add ootdify:// (the redirect URI this app produces natively; the exact value is logged during development).
  3. 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.

🧪 Verification

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)

🔒 Security Notes

  • No private keys in the client. Only EXPO_PUBLIC_* variables exist in the Expo bundle; the service-role key lives in backend/.env exclusively.
  • 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_id for every user-owned bucket.

🧠 Future Directions

  • 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.py for a model-based one (e.g. embeddings) while keeping the same signature — the UI renders whatever catalog ids the /api/recommend and /api/outfits contracts return.

About

OOTDify (Penggi) — an AI fashion assistant for your phone. Build a private wardrobe, get outfit ideas for any occasion, try on clothes virtually and with live AR, and compose looks. Built with Expo, React Native, Supabase and a Flask + YOLO AI backend.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages