# thdwlndjs/lg-clos-it architecture

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

- Interactive diagram: https://gitdiagram.com/thdwlndjs/lg-clos-it
- Repository: https://github.com/thdwlndjs/lg-clos-it

## Overview

Smart Wardrobe is a wardrobe and outfit-management prototype with a six-menu web frontend and a FastAPI backend. Users manage garments and private images, get outfit recommendations, save and share outfits, record wear and care activity, and use storage-planning and virtual-try-on features. The frontend talks to the backend API; backend workflows use persistent database and object storage, with background workers for asynchronous work and a separate renderer for outfit cards. README documents several capabilities whose internal implementation was not sampled, so those links are shown at subsystem level.

Main entry points: [`backend/app/main.py`](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/main.py) (HTTP API), [`backend/app/infrastructure/db/sprint1_repository.py`](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/db/sprint1_repository.py) (Wardrobe database), [`backend/app/application/vton_worker.py`](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/vton_worker.py) (Virtual try-on), [`backend/app/application/assets.py`](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/assets.py) (Wardrobe and assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_web["Six-menu frontend<br/>[main.jsx]"]
  node_mirror["Mirror experience<br/>[App.tsx]"]
  node_client_api["Backend client<br/>[backendClient.ts]"]
end

subgraph group_api["API workflows"]
  node_backend_api["HTTP API<br/>[main.py]"]
  node_garments["Wardrobe and assets<br/>[assets.py]"]
  node_recommendations["Context and outfits<br/>[sprint2.py]"]
  node_wear_care["Wear and care<br/>[sprint5.py]"]
  node_storage_plan["Storage planning<br/>[storage_worker.py]"]
  node_virtual_tryon["Virtual try-on<br/>[vton_worker.py]"]
  node_fitroom["Fitroom integration<br/>[fitroom.py]"]
  node_shopping["Shopping integration<br/>[shopping.py]"]
end

subgraph group_async["Async processing"]
  node_cards["Card rendering<br/>[card_worker.py]"]
  node_worker_dispatch["Worker dispatch<br/>[celery_app.py]"]
end

subgraph group_data["Persistence"]
  node_db[("Wardrobe database")]
  node_object_storage[("Private object storage<br/>[object_storage.py]")]
end

subgraph group_integrations["External services"]
  node_renderer["Card renderer<br/>[server.mjs]"]
  node_vton_provider["VTON provider<br/>[vton.py]"]
end

node_user(("Wardrobe user"))
node_object_store_service[("S3-compatible store")]

node_user -->|"uses"| node_web
node_web -->|"opens"| node_mirror
node_mirror -->|"requests data"| node_client_api
node_client_api -->|"calls API"| node_backend_api
node_backend_api -->|"routes requests"| node_garments
node_backend_api -->|"routes requests"| node_recommendations
node_backend_api -->|"routes requests"| node_wear_care
node_backend_api -->|"routes requests"| node_storage_plan
node_backend_api -->|"routes requests"| node_virtual_tryon
node_backend_api -->|"registers routes"| node_fitroom
node_backend_api -->|"registers routes"| node_shopping
node_garments -->|"reads and writes"| node_db
node_garments -->|"stores assets"| node_object_storage
node_object_storage -->|"uses S3"| node_object_store_service
node_recommendations -.->|"persists outfits"| node_db
node_wear_care -.->|"persists records"| node_db
node_storage_plan -->|"loads and saves plans"| node_db
node_virtual_tryon -->|"loads job inputs"| node_db
node_virtual_tryon -->|"reads images"| node_object_storage
node_virtual_tryon -->|"submits fitting"| node_vton_provider
node_cards -.->|"persists cards"| node_db
node_cards -.->|"requests rendering"| node_renderer
node_worker_dispatch -.->|"runs jobs"| node_storage_plan
node_worker_dispatch -.->|"runs jobs"| node_cards

click node_web "https://github.com/thdwlndjs/lg-clos-it/blob/main/web/src/main.jsx"
click node_mirror "https://github.com/thdwlndjs/lg-clos-it/blob/main/web/src/mirror/source/App.tsx"
click node_client_api "https://github.com/thdwlndjs/lg-clos-it/blob/main/web/src/mirror/source/integrations/backendClient.ts"
click node_backend_api "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/main.py"
click node_garments "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/assets.py"
click node_recommendations "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/sprint2.py"
click node_wear_care "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/sprint5.py"
click node_storage_plan "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/storage_worker.py"
click node_virtual_tryon "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/vton_worker.py"
click node_fitroom "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/api/v1/fitroom.py"
click node_shopping "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/api/v1/shopping.py"
click node_cards "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/card_worker.py"
click node_worker_dispatch "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/workers/celery_app.py"
click node_db "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/db/sprint1_repository.py"
click node_object_storage "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/adapters/object_storage.py"
click node_renderer "https://github.com/thdwlndjs/lg-clos-it/blob/main/renderer/src/server.mjs"
click node_vton_provider "https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/adapters/vton.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_web,node_mirror,node_client_api,node_user toneBlue
class node_backend_api,node_garments,node_recommendations,node_wear_care,node_storage_plan,node_virtual_tryon,node_fitroom,node_shopping,node_object_store_service toneAmber
class node_cards,node_worker_dispatch toneMint
class node_db,node_object_storage toneRose
class node_renderer,node_vton_provider toneIndigo
```

## Components

### Web experience

- [Six-menu frontend](https://github.com/thdwlndjs/lg-clos-it/blob/main/web/src/main.jsx): `web/src/main.jsx`
- [Mirror experience](https://github.com/thdwlndjs/lg-clos-it/blob/main/web/src/mirror/source/App.tsx): `web/src/mirror/source/App.tsx`
- [Backend client](https://github.com/thdwlndjs/lg-clos-it/blob/main/web/src/mirror/source/integrations/backendClient.ts): `web/src/mirror/source/integrations/backendClient.ts`

### API workflows

- [HTTP API](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/main.py): `backend/app/main.py`
- [Wardrobe and assets](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/assets.py): `backend/app/application/assets.py`
- [Context and outfits](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/sprint2.py): `backend/app/application/sprint2.py`
- [Wear and care](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/sprint5.py): `backend/app/application/sprint5.py`
- [Storage planning](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/storage_worker.py): `backend/app/application/storage_worker.py`
- [Virtual try-on](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/vton_worker.py): `backend/app/application/vton_worker.py`
- [Fitroom integration](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/api/v1/fitroom.py): `backend/app/api/v1/fitroom.py`
- [Shopping integration](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/api/v1/shopping.py): `backend/app/api/v1/shopping.py`

### Async processing

- [Card rendering](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/application/card_worker.py): `backend/app/application/card_worker.py`
- [Worker dispatch](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/workers/celery_app.py): `backend/app/workers/celery_app.py`

### Persistence

- [Wardrobe database](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/db/sprint1_repository.py): `backend/app/infrastructure/db/sprint1_repository.py`
- [Private object storage](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/adapters/object_storage.py): `backend/app/infrastructure/adapters/object_storage.py`

### External services

- [Card renderer](https://github.com/thdwlndjs/lg-clos-it/blob/main/renderer/src/server.mjs): `renderer/src/server.mjs`
- [VTON provider](https://github.com/thdwlndjs/lg-clos-it/blob/main/backend/app/infrastructure/adapters/vton.py): `backend/app/infrastructure/adapters/vton.py`

### Other components

- **Wardrobe user**
- **S3-compatible store**

## Connections

- Wardrobe user → Six-menu frontend: uses (evidence: `README.md`)
- Six-menu frontend → Mirror experience: opens (evidence: `web/src/main.jsx`)
- Mirror experience → Backend client: requests data (evidence: `web/src/mirror/source/App.tsx`)
- Backend client → HTTP API: calls API (evidence: `web/src/mirror/source/integrations/backendClient.ts`)
- HTTP API → Wardrobe and assets: routes requests (evidence: `backend/app/main.py`)
- HTTP API → Context and outfits: routes requests (evidence: `backend/app/main.py`)
- HTTP API → Wear and care: routes requests (evidence: `backend/app/main.py`)
- HTTP API → Storage planning: routes requests (evidence: `README.md`)
- HTTP API → Virtual try-on: routes requests (evidence: `backend/app/main.py`)
- HTTP API → Fitroom integration: registers routes (evidence: `backend/app/main.py`)
- HTTP API → Shopping integration: registers routes (evidence: `backend/app/main.py`)
- Wardrobe and assets → Wardrobe database: reads and writes (evidence: `backend/app/application/assets.py`)
- Wardrobe and assets → Private object storage: stores assets (evidence: `backend/app/application/assets.py`)
- Private object storage → S3-compatible store: uses S3 (evidence: `backend/app/infrastructure/adapters/object_storage.py`)
- Context and outfits → Wardrobe database: persists outfits (evidence: `README.md`)
- Wear and care → Wardrobe database: persists records (evidence: `README.md`)
- Storage planning → Wardrobe database: loads and saves plans (evidence: `backend/app/application/storage_worker.py`)
- Virtual try-on → Wardrobe database: loads job inputs (evidence: `backend/app/application/vton_worker.py`)
- Virtual try-on → Private object storage: reads images (evidence: `backend/app/application/vton_worker.py`)
- Virtual try-on → VTON provider: submits fitting (evidence: `backend/app/application/vton_worker.py`)
- Card rendering → Wardrobe database: persists cards (evidence: `backend/app/application/card_worker.py`)
- Card rendering → Card renderer: requests rendering (evidence: `README.md`)
- Worker dispatch → Storage planning: runs jobs (evidence: `backend/app/workers/storage.py`)
- Worker dispatch → Card rendering: runs jobs (evidence: `backend/app/application/card_worker.py`)
