How aryanmashalkar/skin_ai works
MIROIR combines selfie-based skincare analysis with personal-colour styling and apparel try-on. The main journey runs from a skin scan to a concern report and tailored product/routine recommendations, then uses the same profile to rank garments and support virtual try-on and side-by-side colour proof. The README documents these capabilities; sampled source and the SOURCE INDEX support many internal links, but not every UI request path or unsampled implementation detail.
Main entry points: store.ts Persisted app state · route.ts Skin analysis API · page.tsx Fashion collection · ScanModal.tsx Selfie scan
Components 27
Skincare journey
- Selfie scan
src/components/ScanModal.tsx - Skin analysis API
src/app/api/skin/analyze/route.ts - YouCam Skin API
- Skin profile model
src/lib/skin.ts - Skin report
src/components/SkinReport.tsx - Skincare catalog
src/lib/products.ts - Concern matching
src/lib/matching.ts - Routine planner
src/components/RoutineSection.tsx - Progress tracking
src/components/ProgressSection.tsx
Colour and styling
- Appearance sampling
src/lib/appearance-sample.ts - Colour measurements
src/lib/color.ts - Season classification
src/lib/season.ts - Season styling
src/lib/fashion/styling.ts
Fashion experience
- Fashion collection
src/app/fashion/page.tsx - Garment catalog
src/lib/fashion/products.ts - Garment cards
src/components/fashion/GarmentCard.tsx - Virtual try-on
src/components/fashion/TryOnModal.tsx - Photo preparation
src/lib/fashion/photo.ts - Colour proof
src/components/fashion/ColorProofModal.tsx - Garment recolouring
src/lib/fashion/recolor.ts - Try-on API
src/app/api/tryon/route.ts - YouCam Apparel VTO
Shared state and services
- Persisted app state
src/lib/store.ts - Unified cart
src/lib/cart.ts - Cart drawer
src/components/CartDrawer.tsx - Request limiting
src/lib/rate-limit.ts
Other components
- Shopper
Connections 38
- Shopper → Selfie scan: provides selfie
- Selfie scan → Skin analysis API: submits scan
- Selfie scan → Appearance sampling: samples appearance
src/components/ScanModal.tsx - Selfie scan → Persisted app state: updates profile
src/components/ScanModal.tsx - Skin analysis API → YouCam Skin API: requests analysis
- Skin analysis API → Skin profile model: parses results
src/app/api/skin/analyze/route.ts - Skin analysis API → Request limiting: checks limits
src/app/api/skin/analyze/route.ts - Skin analysis API → Season classification: derives season
src/app/api/skin/analyze/route.ts - Skin analysis API → Shopper: returns profile
- Appearance sampling → Colour measurements: converts samples
src/lib/appearance-sample.ts - Colour measurements → Season classification: classifies season
src/lib/color.ts - Season classification → Skin profile model: provides tone
src/app/api/skin/analyze/route.ts - Skin profile model → Persisted app state: stores profile
src/lib/store.ts - Persisted app state → Skin report: supplies profile
src/components/SkinReport.tsx - Skin report → Concern matching: ranks products
src/components/SkinReport.tsx - Concern matching → Skincare catalog: scores products
- Skin report → Routine planner: renders routine
src/components/SkinReport.tsx - Skin report → Progress tracking: renders progress
src/components/SkinReport.tsx - Shopper → Fashion collection: browses apparel
- Fashion collection → Garment catalog: loads collection
src/app/fashion/page.tsx - Fashion collection → Garment cards: renders garments
src/app/fashion/page.tsx - Fashion collection → Persisted app state: reads profile
src/app/fashion/page.tsx - Fashion collection → Season styling: derives recommendations
src/app/fashion/page.tsx - Season styling → Skin profile model: uses skin profile
src/lib/fashion/styling.ts - Season styling → Colour measurements: uses colour analysis
src/lib/fashion/styling.ts - Garment cards → Season styling: shows styling
src/components/fashion/GarmentCard.tsx - Virtual try-on → Photo preparation: prepares photo
src/components/fashion/TryOnModal.tsx - Virtual try-on → Try-on API: requests try-on
- Try-on API → Garment catalog: resolves garment
src/app/api/tryon/route.ts - Try-on API → YouCam Apparel VTO: renders garment
- Colour proof → Photo preparation: prepares photo
src/components/fashion/ColorProofModal.tsx - Colour proof → Garment recolouring: recolours garment
src/components/fashion/ColorProofModal.tsx - Colour proof → Try-on API: requests both renders
src/components/fashion/ColorProofModal.tsx - Persisted app state → Unified cart: manages cart lines
src/lib/store.ts - Cart drawer → Persisted app state: reads and updates
src/components/CartDrawer.tsx - Cart drawer → Unified cart: changes quantities
src/components/CartDrawer.tsx - Persisted app state → Skincare catalog: accepts products
src/lib/store.ts - Persisted app state → Garment catalog: accepts garments
src/lib/store.ts