# ainan-ahmed/wardrobeassistant architecture

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

- Interactive diagram: https://gitdiagram.com/ainan-ahmed/wardrobeassistant
- Repository: https://github.com/ainan-ahmed/wardrobeassistant

## Overview

wardrobeAssistant is a local-first wardrobe manager: users add garment photos, which are cataloged and searchable, then browse inventory, request weather- and occasion-aware outfit suggestions, chat with Aura, and review wardrobe analytics. The graph covers the UI-to-API paths, ingestion and retrieval stages, AI agents, and persisted state. Source excerpts establish most backend calls; some README-described capabilities (including browser geolocation and weather lookup) are shown as documented but their implementation paths were not sampled.

Main entry points: [`frontend/src/App.tsx`](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/App.tsx) (App shell), [`backend/routers/items.py`](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/items.py) (Wardrobe endpoints), [`backend/routers/outfits.py`](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/outfits.py) (Outfit endpoints), [`backend/routers/chat.py`](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/chat.py) (Chat endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Wardrobe UI"]
  node_app["App shell<br/>[App.tsx]"]
  node_wardrobe_ui["Inventory UI"]
  node_ingestion_ui["Photo ingestion"]
  node_outfits_ui["Outfit planner<br/>[OutfitsTab.tsx]"]
  node_assistant_ui["Style assistant<br/>[AssistantTab.tsx]"]
  node_analytics_ui["Closet analytics<br/>[AnalyticsTab.tsx]"]
  node_home_ui["Home dashboard<br/>[HomeTab.tsx]"]
end

subgraph group_api["Backend API"]
  node_api_server["FastAPI server<br/>[main.py]"]
  node_item_api["Wardrobe endpoints<br/>[items.py]"]
  node_outfit_api["Outfit endpoints<br/>[outfits.py]"]
  node_chat_api["Chat endpoints<br/>[chat.py]"]
end

subgraph group_ai["AI Services"]
  node_ingestion["Garment cataloging<br/>[vision_pipeline.py]"]
  node_vector_search["Semantic retrieval<br/>[llm_engine.py]"]
  node_agents["Stylist and outfit agents<br/>[agents.py]"]
  node_memory["Conversation memory<br/>[memory.py]"]
end

subgraph group_state["Wardrobe State"]
  node_models["Domain records<br/>[models.py]"]
  node_database[("PostgreSQL + pgvector<br/>[database.py]")]
end

node_user(("Wardrobe user"))
node_weather["Open-Meteo weather"]

node_user -->|"uses"| node_app
node_app -.->|"requests"| node_api_server
node_app -->|"renders"| node_wardrobe_ui
node_app -.->|"renders"| node_ingestion_ui
node_app -->|"renders"| node_outfits_ui
node_app -->|"renders"| node_assistant_ui
node_app -->|"renders"| node_analytics_ui
node_app -->|"renders"| node_home_ui
node_wardrobe_ui -.->|"loads items"| node_item_api
node_ingestion_ui -->|"submits photos"| node_app
node_app -->|"uploads photos"| node_item_api
node_outfits_ui -.->|"requests looks"| node_outfit_api
node_outfit_api -->|"retrieves matches"| node_vector_search
node_outfit_api -->|"requests recommendation"| node_agents
node_weather -.->|"supplies forecast"| node_outfits_ui
node_assistant_ui -.->|"sends messages"| node_chat_api
node_chat_api -->|"runs stylist"| node_agents
node_chat_api -->|"schedules consolidation"| node_memory
node_item_api -->|"processes garment"| node_ingestion
node_item_api -->|"embeds search"| node_vector_search
node_ingestion -->|"creates item"| node_models
node_vector_search -->|"queries items"| node_models
node_agents -->|"reads closet"| node_models
node_memory -.->|"updates profile"| node_models
node_item_api -.->|"persists items"| node_database
node_outfit_api -.->|"persists outfits"| node_database
node_chat_api -.->|"persists messages"| node_database
node_analytics_ui -.->|"summarizes closet"| node_wardrobe_ui

click node_app "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/App.tsx"
click node_wardrobe_ui "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/domains/wardrobe/components/ClosetInventory.tsx"
click node_ingestion_ui "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/domains/wardrobe/components/ApparelIngestion.tsx"
click node_outfits_ui "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/OutfitsTab.tsx"
click node_assistant_ui "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/AssistantTab.tsx"
click node_analytics_ui "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/AnalyticsTab.tsx"
click node_home_ui "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/HomeTab.tsx"
click node_api_server "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/main.py"
click node_item_api "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/items.py"
click node_outfit_api "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/outfits.py"
click node_chat_api "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/chat.py"
click node_ingestion "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/vision_pipeline.py"
click node_vector_search "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/llm_engine.py"
click node_agents "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/agents.py"
click node_memory "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/memory.py"
click node_models "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/models.py"
click node_database "https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/database.py"

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_app,node_wardrobe_ui,node_ingestion_ui,node_outfits_ui,node_assistant_ui,node_analytics_ui,node_home_ui,node_user toneBlue
class node_api_server,node_item_api,node_outfit_api,node_chat_api toneAmber
class node_ingestion,node_vector_search,node_agents,node_memory toneMint
class node_models,node_database toneRose
class node_weather toneIndigo
```

## Components

### Wardrobe UI

- [App shell](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Inventory UI](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/domains/wardrobe/components/ClosetInventory.tsx): `frontend/src/domains/wardrobe/components/ClosetInventory.tsx`
- [Photo ingestion](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/domains/wardrobe/components/ApparelIngestion.tsx): `frontend/src/domains/wardrobe/components/ApparelIngestion.tsx`
- [Outfit planner](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/OutfitsTab.tsx): `frontend/src/pages/OutfitsTab.tsx`
- [Style assistant](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/AssistantTab.tsx): `frontend/src/pages/AssistantTab.tsx`
- [Closet analytics](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/AnalyticsTab.tsx): `frontend/src/pages/AnalyticsTab.tsx`
- [Home dashboard](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/frontend/src/pages/HomeTab.tsx): `frontend/src/pages/HomeTab.tsx`

### Backend API

- [FastAPI server](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/main.py): `backend/main.py`
- [Wardrobe endpoints](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/items.py): `backend/routers/items.py`
- [Outfit endpoints](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/outfits.py): `backend/routers/outfits.py`
- [Chat endpoints](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/routers/chat.py): `backend/routers/chat.py`

### AI Services

- [Garment cataloging](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/vision_pipeline.py): `backend/services/vision_pipeline.py`
- [Semantic retrieval](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/llm_engine.py): `backend/services/llm_engine.py`
- [Stylist and outfit agents](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/agents.py): `backend/services/agents.py`
- [Conversation memory](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/services/memory.py): `backend/services/memory.py`

### Wardrobe State

- [Domain records](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/models.py): `backend/models.py`
- [PostgreSQL + pgvector](https://github.com/ainan-ahmed/wardrobeassistant/blob/main/backend/database.py): `backend/database.py`

### Other components

- **Wardrobe user**
- **Open-Meteo weather**

## Connections

- Wardrobe user → App shell: uses (evidence: `frontend/src/App.tsx`)
- App shell → FastAPI server: requests
- App shell → Inventory UI: renders (evidence: `frontend/src/App.tsx`)
- App shell → Photo ingestion: renders
- App shell → Outfit planner: renders (evidence: `frontend/src/App.tsx`)
- App shell → Style assistant: renders (evidence: `frontend/src/App.tsx`)
- App shell → Closet analytics: renders (evidence: `frontend/src/App.tsx`)
- App shell → Home dashboard: renders (evidence: `frontend/src/App.tsx`)
- Inventory UI → Wardrobe endpoints: loads items
- Photo ingestion → App shell: submits photos
- App shell → Wardrobe endpoints: uploads photos (evidence: `frontend/src/App.tsx`)
- Outfit planner → Outfit endpoints: requests looks
- Outfit endpoints → Semantic retrieval: retrieves matches (evidence: `backend/routers/outfits.py`)
- Outfit endpoints → Stylist and outfit agents: requests recommendation (evidence: `backend/routers/outfits.py`)
- Open-Meteo weather → Outfit planner: supplies forecast (evidence: `README.md`)
- Style assistant → Chat endpoints: sends messages
- Chat endpoints → Stylist and outfit agents: runs stylist (evidence: `backend/routers/chat.py`)
- Chat endpoints → Conversation memory: schedules consolidation (evidence: `backend/routers/chat.py`)
- Wardrobe endpoints → Garment cataloging: processes garment (evidence: `backend/routers/items.py`)
- Wardrobe endpoints → Semantic retrieval: embeds search (evidence: `backend/routers/items.py`)
- Garment cataloging → Domain records: creates item (evidence: `backend/services/vision_pipeline.py`)
- Semantic retrieval → Domain records: queries items (evidence: `backend/services/llm_engine.py`)
- Stylist and outfit agents → Domain records: reads closet (evidence: `backend/services/agents.py`)
- Conversation memory → Domain records: updates profile (evidence: `backend/services/memory.py`)
- Wardrobe endpoints → PostgreSQL + pgvector: persists items (evidence: `backend/routers/items.py`)
- Outfit endpoints → PostgreSQL + pgvector: persists outfits (evidence: `backend/routers/outfits.py`)
- Chat endpoints → PostgreSQL + pgvector: persists messages (evidence: `backend/routers/chat.py`)
- Closet analytics → Inventory UI: summarizes closet
