# alicegupta24/fitai architecture

> Architecture diagram of the GitHub repository alicegupta24/fitai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alicegupta24/fitai
- Repository: https://github.com/alicegupta24/fitai

## Overview

##### Project type and purpose
- FitAI is a Python-based full-stack web application (built on Streamlit) that serves as a virtual shopping assistant.
- It persists user history in a local SQLite database.

##### File structure
- Top level:
- README.md – project overview, tech stack, models
- ai.py, updatedai.py – entry points for the Streamlit UI and orchestration of inference pipelines
- Implicit components (not in file tree but described in README):
- Model artifacts (`.h5`, `.pkl` files) for CNN, NN, Random Forest, recommendation engine
- SQLite file for data storage
- Potential data directory for synthetic data generation & training scripts

##### README for additional insights
- Core libraries & frameworks: Streamlit (UI), TensorFlow & Keras, scikit-learn, MediaPipe, OpenCV
- External integrations: Google Shopping API, local SQLite for ‘User History’
- Offline ML pipeline: synthetic data generator → model training → model artifact storage

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Web Browser"]:::ui
    subgraph "Application Layer"
        UI["Streamlit UI Controller"]:::ui
        subgraph "Inference Pipeline"
            Pose["Pose Detection (MediaPipe)"]:::ai
            FaceSkin["Face Detection & Skin-Tone Analyzer"]:::ai
            Body["Body Shape Classifier (NN + RF)"]:::ai
            Gender["Gender Predictor (VGG16 CNN)"]:::ai
            Rec["Recommendation Engine (scikit-learn)"]:::ai
        end
        DB["User History (SQLite)"]:::db
        Google["Google Shopping API"]:::ext
    end

    subgraph "Offline Training Pipeline" 
        style Offline dashed
        Gen["Synthetic Data Generator"]:::offline
        Train["Model Trainer"]:::offline
        Store["Model Store (Artifacts)"]:::offline
        Gen --> Train
        Train --> Store
    end

    Browser -->|interacts| UI
    UI -->|uploads image| Pose
    Pose --> FaceSkin
    FaceSkin --> Body
    Body --> Gender
    Gender --> Rec
    Rec --> UI
    Rec --> DB
    UI -->|query history| DB
    UI -->|fetch links| Google
    UI --> Rec

    Documentation["Project Documentation (README)"]:::docs

    click UI "https://github.com/alicegupta24/fitai/blob/main/ai.py"
    click UI "https://github.com/alicegupta24/fitai/blob/main/updatedai.py"
    click Documentation "https://github.com/alicegupta24/fitai/blob/main/README.md"

    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef ai fill:#90EE90,stroke:#000,stroke-width:1px
    classDef db fill:#FFA500,stroke:#000,stroke-width:1px
    classDef ext fill:#FFD700,stroke:#000,stroke-width:1px
    classDef offline fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef docs fill:#FFB6C1,stroke:#000,stroke-width:1px
```
