How originalmeow0503-pixel/ai-project works
1. Repository shape: This is a two-tier fashion application with a React frontend in ESHINE-Front-End/eshine-project and a Python AI backend in Fashion-AI-Backend. The two parts are decoupled and communicate over HTTP.
2. Current frontend runtime: The main UI is a Vite + React app (package.json, vite.config.js, src/main.jsx, src/App.jsx). That makes the browser the primary runtime for the storefront and user interaction layer.
3. Frontend UI composition: The React app is organized into reusable components (Header, Footer, ProductDetails) and pages (HomePage, MenPage, WomenPage, CollectionsPage, NewArrivalsPage, CartPage, ProductPage, AIStylistPage). This suggests a routed ecommerce experience with category browsing, product detail viewing, cart flow, and an AI styling entry point.
4. Client-side state and catalog data: src/context/TryOnContext.jsx indicates shared frontend state for try-on/styling interactions. src/data/products/index.js is a bundled product catalog source, so at least part of the merchandising data lives in the client bundle rather than a database.
5. Asset and product image structure: Product images are stored as organized folders under PIC/Male and PIC/Female, split by Top Wear and Bottom Wear categories with subtypes like jeans, cargo, kurta, shirt, etc. This folder taxonomy is important because it reflects the recommendation and browsing dimensions used by the UI and model.
6. Legacy/static frontend: There is also an older static site under ESHINE-Front-End/landing-page with plain index.html, index.css, and subpages/ files. This looks like a pre-React or alternate landing-page implementation kept alongside the newer app, so an architecture diagram should treat it as a separate frontend surface, not the main runtime path.
7. Backend service boundary: Fashion-AI-Backend/backend/app.py is the service entry point, with recommendation logic in backend/recommend.py. This backend is the AI-facing boundary that the frontend would call for smart product suggestions or outfit recommendations.
8. Backend ML pipeline: The backend’s AI layer includes ai_model/train.py, ai_model/preprocess.py, and a persisted model.pkl. That indicates an offline training/preprocessing step producing a serialized model, which the API loads at runtime for inference.
9. Training and evaluation data: The backend ships its own datasets in Fashion-AI-Backend/data/, including fashion_recommendation_products_dataset.csv, kaggle_styles.csv, and test-query files. These are the model’s source and validation inputs, so the recommendation system is data-driven and file-backed rather than dependent on an external database.
10. Frontend/backend data flow: A typical flow is: user browses products in the React storefront → selects a category or product → frontend either uses local product data or requests the AI backend from the AIStylistPage → backend computes recommendations from the model and dataset → frontend renders suggested products/outfits. The cart and browsing flows stay client-side, while AI inference crosses the service boundary.
11. Deployment characteristics: The system appears stateless at the API layer and file-backed for content/model assets. There is no evidence of a relational database, message queue, or third-party API dependency in the tree; most persistence is via bundled CSVs, image assets, and the serialized model file.
12. Extra ML code in the frontend tree: There is also an ai_model folder under ESHINE-Front-End/eshine-project, which suggests duplicated or experimental ML code alongside the main app. For architecture purposes, the deployable AI service is still the separate Fashion-AI-Backend; the frontend-side ML folder looks like supporting or prototype code.
13. What to draw in the diagram: Model the repo as three major areas: React storefront, legacy static landing pages, and Python AI recommendation service. Connect the React app to the backend only through the AI styling/recommendation path, and show product images/catalog data as local assets feeding the frontend and model.
Main entry points: App.jsx App shell · pages Pages · app.py API app · recommend.py Recommender
Components 17
React storefront
Primary browser app for browsing, cart, and AI styling
- Vite app · Main storefront runtime built with Vite and React
ESHINE-Front-End/eshine-project - App shell · Browser entry and top-level application composition
ESHINE-Front-End/eshine-project/src/App.jsx - Pages · Category, product, cart, and AI styling screens
ESHINE-Front-End/eshine-project/src/pages - Components · Shared header, footer, and product detail building blocks
ESHINE-Front-End/eshine-project/src/components - Try-on state · Client-side state for styling and try-on interactions
ESHINE-Front-End/eshine-project/src/context/TryOnContext.jsx - Catalog data · Bundled product data used by the storefront
ESHINE-Front-End/eshine-project/src/data/products/index.js - Product images · Organized fashion image folders by gender and garment type
ESHINE-Front-End/eshine-project/PIC - Frontend AI code · Extra AI-related code living inside the frontend tree
ESHINE-Front-End/eshine-project/ai_model
Legacy landing pages
Older static frontend surface kept alongside the React app
- Static site · Older landing-page implementation with separate HTML/CSS pages
ESHINE-Front-End/landing-page - Legacy subpages · Old men, women, cart, and product listing pages
ESHINE-Front-End/landing-page/subpages
AI backend
Python recommendation service plus offline model assets
- API app · Backend service entry point for recommendation requests
Fashion-AI-Backend/backend/app.py - Recommender · Core recommendation and ranking logic
Fashion-AI-Backend/backend/recommend.py - Model file · Persisted trained model used at inference time
Fashion-AI-Backend/ai_model/model.pkl - Training · Model training workflow
Fashion-AI-Backend/ai_model/train.py - Preprocess · Dataset preparation and feature shaping for training
Fashion-AI-Backend/ai_model/preprocess.py - Datasets · Product and style datasets plus test queries
Fashion-AI-Backend/data - Backend deps · Backend Python dependency specification
Fashion-AI-Backend/backend/requirements.txt
Connections 19
- Vite app → App shell: boots · Vite loads the React application shell
- App shell → Pages: routes to · App shell composes the routed experience
- App shell → Components: uses · Shared UI pieces are embedded across pages
- App shell → Try-on state: shares state · Try-on and styling state flows through context
- App shell → Catalog data: reads · Storefront uses bundled merchandising data
- App shell → Product images: renders · Product views resolve assets from the image library
- Pages → Components: composes · Pages are built from reusable UI blocks
- Pages → Catalog data: filters · Category and product screens filter local catalog data
- Pages → Product images: shows · Listing and detail pages display product imagery
- Frontend AI code → Vite app: supports · Experimental AI code co-located with the frontend
- Static site → Legacy subpages: contains · Static site includes independent subpages
- API app → Recommender: delegates · HTTP requests are handled by the recommendation layer
- Recommender → Model file: loads · Inference uses the persisted trained model
- Training → Preprocess: prepares · Training depends on preprocessing step
- Training → Model file: produces · Offline training outputs the serialized model
- Preprocess → Datasets: consumes · Training data is sourced from repository datasets
- Recommender → Datasets: uses · Inference relies on local product and style data
- App shell → API app: calls · AI styling page crosses the service boundary over HTTP
- API app → Backend deps: depends on · Service runtime packages are defined separately