How shresta-voruganti/ai-wardrobe1 works
Project Type and Purpose
• This is a full-stack, single-page web application (“AI Wardrobe”) that leverages a React frontend (in src/ and public/) and a Python backend (server/server.py plus requirements.txt). Its purpose is to let users upload photos of clothing, run computer-vision/ML models on the server to detect and classify garments, store them in a digital wardrobe, and generate outfit recommendations via an AI model.
File Structure Analysis
• Top-level: package.json (npm/React), server/ (Python API), public/ (React’s static assets), src/ (React components/pages).
• src/pages contains three major UI flows: Main (landing/dashboard), UploadItem (image upload + classification modal), Wardrobe (view stored items + outfit generation modal).
• server/server.py likely implements REST endpoints for item classification, wardrobe CRUD, and outfit recommendation.
• No explicit DB folder—assume the server persists metadata either to a lightweight DB (e.g., SQLite) or file storage; pre-trained models live in the repo root per README.
README Insights
• Confirms computer-vision “Clothing Detection”, “Digital Wardrobe” storage, and “Outfit Generation” features.
• Describes a two-step local setup: pip install server dependencies + npm start front end.
• External ML artifacts (models) must be downloaded into the root.
Diagramming the Architecture
a. Main Components
• User’s Browser (React UI)
• React Frontend (src/ + public/)
• API Gateway / Backend (Flask or equivalent in server/server.py)
• ML Model Layer (pre-trained CV and outfit-generation models)
• Data Storage (Digital Wardrobe DB or filesystem)
• Jupyter Notebook Suite (offline data-prep & model training—not in runtime)
b. Relationships & Data Flow
1. User interacts with React UI → triggers HTTP requests (POST /upload, GET /wardrobe, GET /outfits)
2. Backend API receives request → loads appropriate ML model → processes image or wardrobe data
3. Backend persists metadata & image references to storage → returns JSON response to frontend
4. React UI renders updated wardrobe or outfit recommendations
c. Architectural Patterns
• Client-Server separation (SPA + REST API)
• Layered architecture: Presentation (React) → Application (Flask API) → ML Services → Persistence
• Modular React pages for each UI flow
d. Key Technologies
• Frontend: React, create-react-app, CSS Modules
• Backend: Python 3.x, Flask (or FastAPI), pip dependencies (requirements.txt)
• ML: TensorFlow/PyTorch models, Jupyter notebooks for training/preprocessing
• Build & Deployment: npm, virtualenv, local static hosting for React, Python HTTP server