# originalmeow0503-pixel/ai-project architecture

> Architecture diagram of the GitHub repository originalmeow0503-pixel/ai-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/originalmeow0503-pixel/ai-project
- Repository: https://github.com/originalmeow0503-pixel/ai-project

## Overview

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: [`ESHINE-Front-End/eshine-project/src/App.jsx`](https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/App.jsx) (App shell), [`ESHINE-Front-End/eshine-project/src/pages`](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/src/pages) (Pages), [`Fashion-AI-Backend/backend/app.py`](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/app.py) (API app), [`Fashion-AI-Backend/backend/recommend.py`](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/recommend.py) (Recommender)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React storefront"]
  node_react_app["Vite app<br/>react runtime"]
  node_react_entry["App shell<br/>ui entry<br/>[App.jsx]"]
  node_pages["Pages<br/>routed views"]
  node_components["Components"]
  node_state["Try-on state<br/>shared context<br/>[TryOnContext.jsx]"]
  node_catalog["Catalog data<br/>local catalog<br/>[index.js]"]
  node_images["Product images<br/>asset library"]
  node_frontend_ml["Frontend AI code<br/>prototype ml"]
end

subgraph group_legacy["Legacy landing pages"]
  node_landing_page["Static site<br/>static frontend"]
  node_legacy_pages["Legacy subpages<br/>static routes"]
end

subgraph group_backend["AI backend"]
  node_api_entry["API app<br/>python api<br/>[app.py]"]
  node_recommend["Recommender<br/>inference logic<br/>[recommend.py]"]
  node_model_artifact["Model file<br/>serialized model<br/>[model.pkl]"]
  node_train_pipeline["Training<br/>[train.py]"]
  node_preprocess["Preprocess<br/>feature prep<br/>[preprocess.py]"]
  node_datasets[("Datasets<br/>csv data")]
  node_backend_requirements["Backend deps<br/>python deps<br/>[requirements.txt]"]
end

node_react_app -->|"boots"| node_react_entry
node_react_entry -->|"routes to"| node_pages
node_react_entry -->|"uses"| node_components
node_react_entry -->|"shares state"| node_state
node_react_entry -->|"reads"| node_catalog
node_react_entry -->|"renders"| node_images
node_pages -->|"composes"| node_components
node_pages -->|"filters"| node_catalog
node_pages -->|"shows"| node_images
node_frontend_ml -.->|"supports"| node_react_app
node_landing_page -->|"contains"| node_legacy_pages
node_api_entry -->|"delegates"| node_recommend
node_recommend -->|"loads"| node_model_artifact
node_train_pipeline -->|"prepares"| node_preprocess
node_train_pipeline -->|"produces"| node_model_artifact
node_preprocess -->|"consumes"| node_datasets
node_recommend -->|"uses"| node_datasets
node_react_entry -->|"calls"| node_api_entry
node_api_entry -->|"depends on"| node_backend_requirements

click node_react_app "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project"
click node_react_entry "https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/App.jsx"
click node_pages "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/src/pages"
click node_components "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/src/components"
click node_state "https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/context/TryOnContext.jsx"
click node_catalog "https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/data/products/index.js"
click node_images "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/PIC"
click node_frontend_ml "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/ai_model"
click node_landing_page "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/landing-page"
click node_legacy_pages "https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/landing-page/subpages"
click node_api_entry "https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/app.py"
click node_recommend "https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/recommend.py"
click node_model_artifact "https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/ai_model/model.pkl"
click node_train_pipeline "https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/ai_model/train.py"
click node_preprocess "https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/ai_model/preprocess.py"
click node_datasets "https://github.com/originalmeow0503-pixel/ai-project/tree/main/Fashion-AI-Backend/data"
click node_backend_requirements "https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/requirements.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_react_app,node_react_entry,node_pages,node_components,node_state,node_catalog,node_images,node_frontend_ml toneBlue
class node_landing_page,node_legacy_pages toneAmber
class node_api_entry,node_recommend,node_model_artifact,node_train_pipeline,node_preprocess,node_datasets,node_backend_requirements toneMint
```

## Components

### React storefront

Primary browser app for browsing, cart, and AI styling

- [Vite app](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project): react runtime · Main storefront runtime built with Vite and React · `ESHINE-Front-End/eshine-project`
- [App shell](https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/App.jsx): ui entry · Browser entry and top-level application composition · `ESHINE-Front-End/eshine-project/src/App.jsx`
- [Pages](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/src/pages): routed views · Category, product, cart, and AI styling screens · `ESHINE-Front-End/eshine-project/src/pages`
- [Components](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/src/components): ui components · Shared header, footer, and product detail building blocks · `ESHINE-Front-End/eshine-project/src/components`
- [Try-on state](https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/context/TryOnContext.jsx): shared context · Client-side state for styling and try-on interactions · `ESHINE-Front-End/eshine-project/src/context/TryOnContext.jsx`
- [Catalog data](https://github.com/originalmeow0503-pixel/ai-project/blob/main/ESHINE-Front-End/eshine-project/src/data/products/index.js): local catalog · Bundled product data used by the storefront · `ESHINE-Front-End/eshine-project/src/data/products/index.js`
- [Product images](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/PIC): asset library · Organized fashion image folders by gender and garment type · `ESHINE-Front-End/eshine-project/PIC`
- [Frontend AI code](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/eshine-project/ai_model): prototype ml · 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](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/landing-page): static frontend · Older landing-page implementation with separate HTML/CSS pages · `ESHINE-Front-End/landing-page`
- [Legacy subpages](https://github.com/originalmeow0503-pixel/ai-project/tree/main/ESHINE-Front-End/landing-page/subpages): static routes · 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](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/app.py): python api · Backend service entry point for recommendation requests · `Fashion-AI-Backend/backend/app.py`
- [Recommender](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/recommend.py): inference logic · Core recommendation and ranking logic · `Fashion-AI-Backend/backend/recommend.py`
- [Model file](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/ai_model/model.pkl): serialized model · Persisted trained model used at inference time · `Fashion-AI-Backend/ai_model/model.pkl`
- [Training](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/ai_model/train.py): offline training · Model training workflow · `Fashion-AI-Backend/ai_model/train.py`
- [Preprocess](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/ai_model/preprocess.py): feature prep · Dataset preparation and feature shaping for training · `Fashion-AI-Backend/ai_model/preprocess.py`
- [Datasets](https://github.com/originalmeow0503-pixel/ai-project/tree/main/Fashion-AI-Backend/data): csv data · Product and style datasets plus test queries · `Fashion-AI-Backend/data`
- [Backend deps](https://github.com/originalmeow0503-pixel/ai-project/blob/main/Fashion-AI-Backend/backend/requirements.txt): python deps · Backend Python dependency specification · `Fashion-AI-Backend/backend/requirements.txt`

## Connections

- 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
