# vickyilovemymother/vp-ai architecture

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

- Interactive diagram: https://gitdiagram.com/vickyilovemymother/vp-ai
- Repository: https://github.com/vickyilovemymother/vp-ai

## Overview

VP-AI is a fashion creation and virtual try-on application. Users enter the React app to work with garment designs, generate AI imagery, and try outfits on; account, pricing, and setup flows support that experience. The app also includes video generation and image-reconstruction capabilities. Its browser services use Firebase for authentication and Firestore data, while an Express server exposes Gemini AI routes. Source excerpts show the main UI and several service relationships, but not all component internals or all API routing details.

Main entry points: [`src/App.tsx`](https://github.com/vickyilovemymother/vp-ai/blob/main/src/App.tsx) (Fashion workspace), [`src/services/geminiService.ts`](https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/geminiService.ts) (AI client service), [`src/services/videoService.ts`](https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/videoService.ts) (Video creation), [`src/components/AuthModal.tsx`](https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/AuthModal.tsx) (Sign-in UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Creation experience"]
  node_creator["Fashion workspace<br/>[App.tsx]"]
  node_designer["Garment designer<br/>[DesignerPanel.tsx]"]
  node_tryon["Virtual try-on<br/>[VirtualTryOn.tsx]"]
  node_video["Video creation<br/>[videoService.ts]"]
  node_reconstruction["3D reconstruction"]
  node_setup["Setup guide<br/>[SetupGuide.tsx]"]
end

subgraph group_identity["Accounts and plans"]
  node_authmodal["Sign-in UI<br/>[AuthModal.tsx]"]
  node_authstate["Auth state<br/>[AuthContext.tsx]"]
  node_authservice["Auth service<br/>[authService.ts]"]
  node_pricing["Pricing UI<br/>[PricingModal.tsx]"]
end

subgraph group_ai["AI generation"]
  node_geminiservice["AI client service<br/>[geminiService.ts]"]
  node_geminiroutes["Gemini API routes<br/>[gemini.ts]"]
  node_gemini["Google Gemini"]
end

subgraph group_platform["Application platform"]
  node_firebase["Firebase client<br/>[firebase.ts]"]
  node_firestore[("Firestore")]
  node_server["Express API<br/>[server.ts]"]
end

node_user(("Creator"))

node_user -->|"uses"| node_creator
node_creator -->|"renders"| node_designer
node_creator -->|"renders"| node_tryon
node_creator -->|"renders"| node_setup
node_creator -->|"renders"| node_pricing
node_creator -->|"renders"| node_authmodal
node_creator -->|"generates images"| node_geminiservice
node_creator -->|"reads and writes"| node_firestore
node_creator -->|"uses"| node_video
node_authmodal -->|"uses"| node_authstate
node_authstate -->|"delegates"| node_authservice
node_authservice -->|"authenticates and syncs"| node_firebase
node_firebase -->|"initializes"| node_firestore
node_video -->|"requests analysis"| node_geminiservice
node_geminiservice -.->|"sends AI requests"| node_server
node_server -->|"mounts routes"| node_geminiroutes
node_geminiroutes -->|"calls"| node_gemini
node_creator -.->|"uses"| node_reconstruction

click node_creator "https://github.com/vickyilovemymother/vp-ai/blob/main/src/App.tsx"
click node_designer "https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/DesignerPanel.tsx"
click node_tryon "https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/VirtualTryOn.tsx"
click node_video "https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/videoService.ts"
click node_reconstruction "https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/reconstructionService.ts"
click node_setup "https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/SetupGuide.tsx"
click node_authmodal "https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/AuthModal.tsx"
click node_authstate "https://github.com/vickyilovemymother/vp-ai/blob/main/src/context/AuthContext.tsx"
click node_authservice "https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/authService.ts"
click node_pricing "https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/PricingModal.tsx"
click node_firebase "https://github.com/vickyilovemymother/vp-ai/blob/main/src/lib/firebase.ts"
click node_server "https://github.com/vickyilovemymother/vp-ai/blob/main/server.ts"
click node_geminiservice "https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/geminiService.ts"
click node_geminiroutes "https://github.com/vickyilovemymother/vp-ai/blob/main/server/gemini.ts"

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_creator,node_designer,node_tryon,node_video,node_reconstruction,node_setup toneBlue
class node_authmodal,node_authstate,node_authservice,node_pricing toneAmber
class node_geminiservice,node_geminiroutes,node_gemini toneMint
class node_firebase,node_firestore,node_server toneRose
class node_user toneIndigo
```

## Components

### Creation experience

- [Fashion workspace](https://github.com/vickyilovemymother/vp-ai/blob/main/src/App.tsx): `src/App.tsx`
- [Garment designer](https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/DesignerPanel.tsx): `src/components/DesignerPanel.tsx`
- [Virtual try-on](https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/VirtualTryOn.tsx): `src/components/VirtualTryOn.tsx`
- [Video creation](https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/videoService.ts): `src/services/videoService.ts`
- [3D reconstruction](https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/reconstructionService.ts): `src/services/reconstructionService.ts`
- [Setup guide](https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/SetupGuide.tsx): `src/components/SetupGuide.tsx`

### Accounts and plans

- [Sign-in UI](https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Auth state](https://github.com/vickyilovemymother/vp-ai/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Auth service](https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/authService.ts): `src/services/authService.ts`
- [Pricing UI](https://github.com/vickyilovemymother/vp-ai/blob/main/src/components/PricingModal.tsx): `src/components/PricingModal.tsx`

### AI generation

- [AI client service](https://github.com/vickyilovemymother/vp-ai/blob/main/src/services/geminiService.ts): `src/services/geminiService.ts`
- [Gemini API routes](https://github.com/vickyilovemymother/vp-ai/blob/main/server/gemini.ts): `server/gemini.ts`
- **Google Gemini**

### Application platform

- [Firebase client](https://github.com/vickyilovemymother/vp-ai/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Firestore**
- [Express API](https://github.com/vickyilovemymother/vp-ai/blob/main/server.ts): `server.ts`

### Other components

- **Creator**

## Connections

- Creator → Fashion workspace: uses
- Fashion workspace → Garment designer: renders (evidence: `src/App.tsx`)
- Fashion workspace → Virtual try-on: renders (evidence: `src/App.tsx`)
- Fashion workspace → Setup guide: renders (evidence: `src/App.tsx`)
- Fashion workspace → Pricing UI: renders (evidence: `src/App.tsx`)
- Fashion workspace → Sign-in UI: renders (evidence: `src/App.tsx`)
- Fashion workspace → AI client service: generates images (evidence: `src/App.tsx`)
- Fashion workspace → Firestore: reads and writes (evidence: `src/App.tsx`)
- Fashion workspace → Video creation: uses (evidence: `src/App.tsx`)
- Sign-in UI → Auth state: uses (evidence: `src/components/AuthModal.tsx`)
- Auth state → Auth service: delegates (evidence: `src/context/AuthContext.tsx`)
- Auth service → Firebase client: authenticates and syncs (evidence: `src/services/authService.ts`)
- Firebase client → Firestore: initializes (evidence: `src/lib/firebase.ts`)
- Video creation → AI client service: requests analysis (evidence: `src/services/videoService.ts`)
- AI client service → Express API: sends AI requests
- Express API → Gemini API routes: mounts routes (evidence: `server.ts`)
- Gemini API routes → Google Gemini: calls (evidence: `server/gemini.ts`)
- Fashion workspace → 3D reconstruction: uses
