# meetmulik/fashion-outfit-generator architecture

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

- Interactive diagram: https://gitdiagram.com/meetmulik/fashion-outfit-generator
- Repository: https://github.com/meetmulik/fashion-outfit-generator

## Overview

Outfitter is a fashion-outfit web app: users sign in, describe an outfit or occasion in chat, receive AI-generated suggestions, and can generate and save outfit images for later viewing. The React client routes users through authentication and account/outfit pages; image generation is handled by an Express API and an external image service. The README also documents saved outfits and Google authentication. Some page implementations were not sampled, so their internal data flows are left unverified rather than inferred.

Main entry points: [`client/src/App.js`](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/App.js) (App routing), [`client/src/pages/Login.jsx`](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Login.jsx) (Google login), [`client/src/pages/Chat.jsx`](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Chat.jsx) (Outfit chat), [`server/app.js`](https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/app.js) (Express routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App routing<br/>[App.js]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_hero["Landing hero<br/>[Hero.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_orders["Previous orders<br/>[Orders.jsx]"]
  node_profile["Profile page<br/>[Profile.jsx]"]
  node_about["About page<br/>[About.jsx]"]
end

subgraph group_identity["Identity and state"]
  node_login["Google login<br/>[Login.jsx]"]
  node_protected["Route guard<br/>[ProtectedRoute.js]"]
  node_state["App state<br/>[StateProvider.js]"]
  node_reducer["User reducer<br/>[reducer.js]"]
  node_firebase[("Firebase services<br/>[firebase-config.js]")]
end

subgraph group_generation["Outfit generation"]
  node_chat["Outfit chat<br/>[Chat.jsx]"]
  node_myoutfits["Saved outfits<br/>[MyOutfits.jsx]"]
end

subgraph group_backend["Generation backend"]
  node_express["Express routes<br/>[app.js]"]
  node_openai["Text generation"]
  node_openai_config["OpenAI client<br/>[openaiConfig.js]"]
  node_leap["Image generation API"]
end

node_user(("Visitor"))
node_openai_service{{"OpenAI service"}}
node_leap_service{{"Leap image service"}}
node_google{{"Google sign-in"}}

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"guards chat"| node_protected
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_myoutfits
node_app -->|"routes to"| node_about
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_home -->|"renders"| node_hero
node_login -->|"authenticates with"| node_google
node_login -->|"dispatches user"| node_state
node_login -->|"uses app config"| node_firebase
node_state -->|"applies actions"| node_reducer
node_protected -->|"checks user state"| node_state
node_chat -->|"requests text"| node_openai_service
node_chat -->|"requests image generation"| node_express
node_express -->|"routes image requests"| node_leap
node_express -->|"routes meta requests"| node_openai
node_leap -->|"creates and fetches images"| node_leap_service
node_openai -->|"uses client"| node_openai_config
node_openai_config -.->|"configures"| node_openai_service
node_chat -->|"reads and saves images"| node_firebase
node_myoutfits -.->|"loads saved outfits"| node_firebase
node_user -->|"signs in"| node_login

click node_app "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/App.js"
click node_home "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Home.jsx"
click node_hero "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/components/Hero.jsx"
click node_navbar "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/components/Navbar.jsx"
click node_footer "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/components/Footer.jsx"
click node_login "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Login.jsx"
click node_protected "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/ProtectedRoute.js"
click node_state "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/context/StateProvider.js"
click node_reducer "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/context/reducer.js"
click node_firebase "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/utils/firebase-config.js"
click node_chat "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Chat.jsx"
click node_myoutfits "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/MyOutfits.jsx"
click node_orders "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Orders.jsx"
click node_profile "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Profile.jsx"
click node_about "https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/About.jsx"
click node_express "https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/app.js"
click node_openai "https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/controllers/openaiController.js"
click node_openai_config "https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/config/openaiConfig.js"
click node_leap "https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/controllers/leapApiController.js"

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_home,node_hero,node_navbar,node_footer,node_orders,node_profile,node_about toneBlue
class node_login,node_protected,node_state,node_reducer,node_firebase toneAmber
class node_chat,node_myoutfits toneMint
class node_express,node_openai,node_openai_config,node_leap toneRose
class node_user,node_openai_service,node_leap_service,node_google toneIndigo
```

## Components

### Client experience

- [App routing](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/App.js): `client/src/App.js`
- [Home page](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Landing hero](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/components/Hero.jsx): `client/src/components/Hero.jsx`
- [Navigation](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [Footer](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/components/Footer.jsx): `client/src/components/Footer.jsx`
- [Previous orders](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Orders.jsx): `client/src/pages/Orders.jsx`
- [Profile page](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Profile.jsx): `client/src/pages/Profile.jsx`
- [About page](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/About.jsx): `client/src/pages/About.jsx`

### Identity and state

- [Google login](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Route guard](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/ProtectedRoute.js): `client/src/pages/ProtectedRoute.js`
- [App state](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/context/StateProvider.js): `client/src/context/StateProvider.js`
- [User reducer](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/context/reducer.js): `client/src/context/reducer.js`
- [Firebase services](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/utils/firebase-config.js): `client/src/utils/firebase-config.js`

### Outfit generation

- [Outfit chat](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/Chat.jsx): `client/src/pages/Chat.jsx`
- [Saved outfits](https://github.com/meetmulik/fashion-outfit-generator/blob/main/client/src/pages/MyOutfits.jsx): `client/src/pages/MyOutfits.jsx`

### Generation backend

- [Express routes](https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/app.js): `server/app.js`
- [Text generation](https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/controllers/openaiController.js): `server/controllers/openaiController.js`
- [OpenAI client](https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/config/openaiConfig.js): `server/config/openaiConfig.js`
- [Image generation API](https://github.com/meetmulik/fashion-outfit-generator/blob/main/server/controllers/leapApiController.js): `server/controllers/leapApiController.js`

### Other components

- **Visitor**
- **OpenAI service**
- **Leap image service**
- **Google sign-in**

## Connections

- Visitor → App routing: uses (evidence: `README.md`)
- App routing → Home page: routes to (evidence: `client/src/App.js`)
- App routing → Google login: routes to (evidence: `client/src/App.js`)
- App routing → Route guard: guards chat (evidence: `client/src/App.js`)
- App routing → Previous orders: routes to (evidence: `client/src/App.js`)
- App routing → Profile page: routes to (evidence: `client/src/App.js`)
- App routing → Saved outfits: routes to (evidence: `client/src/App.js`)
- App routing → About page: routes to (evidence: `client/src/App.js`)
- App routing → Navigation: renders (evidence: `client/src/App.js`)
- App routing → Footer: renders (evidence: `client/src/App.js`)
- Home page → Landing hero: renders (evidence: `client/src/pages/Home.jsx`)
- Google login → Google sign-in: authenticates with (evidence: `client/src/pages/Login.jsx`)
- Google login → App state: dispatches user (evidence: `client/src/pages/Login.jsx`)
- Google login → Firebase services: uses app config (evidence: `client/src/pages/Login.jsx`)
- App state → User reducer: applies actions (evidence: `client/src/index.js`)
- Route guard → App state: checks user state (evidence: `client/src/pages/ProtectedRoute.js`)
- Outfit chat → OpenAI service: requests text (evidence: `client/src/pages/Chat.jsx`)
- Outfit chat → Express routes: requests image generation (evidence: `client/src/pages/Chat.jsx`)
- Express routes → Image generation API: routes image requests (evidence: `server/app.js`)
- Express routes → Text generation: routes meta requests (evidence: `server/app.js`)
- Image generation API → Leap image service: creates and fetches images (evidence: `server/controllers/leapApiController.js`)
- Text generation → OpenAI client: uses client (evidence: `server/controllers/openaiController.js`)
- OpenAI client → OpenAI service: configures
- Outfit chat → Firebase services: reads and saves images (evidence: `client/src/pages/Chat.jsx`)
- Saved outfits → Firebase services: loads saved outfits (evidence: `client/src/pages/MyOutfits.jsx`)
- Visitor → Google login: signs in (evidence: `README.md`)
