# sharadhak30/fitfindr architecture

> Architecture diagram of the GitHub repository sharadhak30/fitfindr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharadhak30/fitfindr
- Repository: https://github.com/sharadhak30/fitfindr

## Overview

FitFindr is a small secondhand-shopping assistant: a user searches mock resale listings, reviews a selected item’s price and trend context, gets an outfit styled around their closet, and receives a shareable caption. The Gradio interface also supports listing previews, history, and reusable profile memory. The agent owns the conditional workflow and session state; tools implement each shopping and styling stage. Source excerpts and README document the tool flow and data loading. Some UI-to-agent wiring and UI details are unsampled, so that connection is marked unverified.

Main entry points: [`agent.py`](https://github.com/sharadhak30/fitfindr/blob/main/agent.py) (Session planner), [`utils/data_loader.py`](https://github.com/sharadhak30/fitfindr/blob/main/utils/data_loader.py) (Data loader), [`app.py`](https://github.com/sharadhak30/fitfindr/blob/main/app.py) (Gradio interface), [`tools.py`](https://github.com/sharadhak30/fitfindr/blob/main/tools.py) (Listing search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_ui["Gradio interface<br/>[app.py]"]
  node_history[("History and profiles<br/>[app.py]")]
end

subgraph group_workflow["Agent workflow"]
  node_agent["Session planner<br/>[agent.py]"]
end

subgraph group_tools["Shopping tools"]
  node_search["Listing search<br/>[tools.py]"]
  node_pricing["Price comparison<br/>[tools.py]"]
  node_trends["Trend context<br/>[tools.py]"]
  node_styling["Outfit suggestion<br/>[tools.py]"]
  node_caption["Fit caption<br/>[tools.py]"]
end

subgraph group_data["Catalog data"]
  node_loader["Data loader<br/>[data_loader.py]"]
  node_listings[("Mock listings<br/>[listings.json]")]
  node_wardrobe["Wardrobe schema"]
end

node_user(("Shopper"))
node_groq{{"Groq API"}}

node_user -->|"uses"| node_ui
node_ui -.->|"runs workflow"| node_agent
node_ui -->|"loads listings"| node_loader
node_ui -->|"updates"| node_history
node_agent -->|"searches"| node_search
node_agent -->|"compares price"| node_pricing
node_agent -->|"checks trends"| node_trends
node_agent -->|"requests outfit"| node_styling
node_agent -->|"creates caption"| node_caption
node_agent -->|"loads default closet"| node_loader
node_search -->|"loads listings"| node_loader
node_pricing -->|"loads comparables"| node_loader
node_loader -->|"reads"| node_listings
node_loader -->|"reads"| node_wardrobe
node_styling -.->|"generates text"| node_groq
node_caption -.->|"generates text"| node_groq

click node_ui "https://github.com/sharadhak30/fitfindr/blob/main/app.py"
click node_history "https://github.com/sharadhak30/fitfindr/blob/main/app.py"
click node_agent "https://github.com/sharadhak30/fitfindr/blob/main/agent.py"
click node_search "https://github.com/sharadhak30/fitfindr/blob/main/tools.py"
click node_pricing "https://github.com/sharadhak30/fitfindr/blob/main/tools.py"
click node_trends "https://github.com/sharadhak30/fitfindr/blob/main/tools.py"
click node_styling "https://github.com/sharadhak30/fitfindr/blob/main/tools.py"
click node_caption "https://github.com/sharadhak30/fitfindr/blob/main/tools.py"
click node_loader "https://github.com/sharadhak30/fitfindr/blob/main/utils/data_loader.py"
click node_listings "https://github.com/sharadhak30/fitfindr/blob/main/data/listings.json"
click node_wardrobe "https://github.com/sharadhak30/fitfindr/blob/main/data/wardrobe_schema.json"

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_ui,node_history toneBlue
class node_agent toneAmber
class node_search,node_pricing,node_trends,node_styling,node_caption,node_groq toneMint
class node_loader,node_listings,node_wardrobe toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Gradio interface](https://github.com/sharadhak30/fitfindr/blob/main/app.py): `app.py`
- [History and profiles](https://github.com/sharadhak30/fitfindr/blob/main/app.py): `app.py`

### Agent workflow

- [Session planner](https://github.com/sharadhak30/fitfindr/blob/main/agent.py): `agent.py`

### Shopping tools

- [Listing search](https://github.com/sharadhak30/fitfindr/blob/main/tools.py): `tools.py`
- [Price comparison](https://github.com/sharadhak30/fitfindr/blob/main/tools.py): `tools.py`
- [Trend context](https://github.com/sharadhak30/fitfindr/blob/main/tools.py): `tools.py`
- [Outfit suggestion](https://github.com/sharadhak30/fitfindr/blob/main/tools.py): `tools.py`
- [Fit caption](https://github.com/sharadhak30/fitfindr/blob/main/tools.py): `tools.py`

### Catalog data

- [Data loader](https://github.com/sharadhak30/fitfindr/blob/main/utils/data_loader.py): `utils/data_loader.py`
- [Mock listings](https://github.com/sharadhak30/fitfindr/blob/main/data/listings.json): `data/listings.json`
- [Wardrobe schema](https://github.com/sharadhak30/fitfindr/blob/main/data/wardrobe_schema.json): `data/wardrobe_schema.json`

### Other components

- **Shopper**
- **Groq API**

## Connections

- Shopper → Gradio interface: uses (evidence: `README.md`)
- Gradio interface → Session planner: runs workflow (evidence: `app.py`)
- Gradio interface → Data loader: loads listings (evidence: `app.py`)
- Gradio interface → History and profiles: updates (evidence: `README.md`)
- Session planner → Listing search: searches (evidence: `agent.py`)
- Session planner → Price comparison: compares price (evidence: `agent.py`)
- Session planner → Trend context: checks trends (evidence: `agent.py`)
- Session planner → Outfit suggestion: requests outfit (evidence: `agent.py`)
- Session planner → Fit caption: creates caption (evidence: `agent.py`)
- Session planner → Data loader: loads default closet (evidence: `agent.py`)
- Listing search → Data loader: loads listings (evidence: `tools.py`)
- Price comparison → Data loader: loads comparables (evidence: `tools.py`)
- Data loader → Mock listings: reads (evidence: `utils/data_loader.py`)
- Data loader → Wardrobe schema: reads (evidence: `utils/data_loader.py`)
- Outfit suggestion → Groq API: generates text (evidence: `tools.py`)
- Fit caption → Groq API: generates text (evidence: `tools.py`)
