# jaisurya2823/vidcraft-ai architecture

> Architecture diagram of the GitHub repository jaisurya2823/vidcraft-ai, 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/jaisurya2823/vidcraft-ai
- Repository: https://github.com/jaisurya2823/vidcraft-ai

## Overview

VidCraft AI turns a product photo and brand details into promotional media, with a browser UI backed by an Express API and Cloudinary transformations. The main workflow is upload, prepare a product cutout and generated background, compose branded motion media, then return delivery URLs and format variants. The UI also supports generation history; the API exposes health and asset-analysis endpoints. The README documents frontend behavior not visible in the sampled HTML, so those connections are cited to the README.

Main entry points: [`server/server.js`](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js) (Generate endpoint), [`public/index.html`](https://github.com/jaisurya2823/vidcraft-ai/blob/main/public/index.html) (Upload and results UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_browser["Upload and results UI<br/>[index.html]"]
end

subgraph group_api["Application API"]
  node_generate["Generate endpoint<br/>[server.js]"]
  node_history["History endpoint<br/>[server.js]"]
  node_asset["Asset analysis endpoint<br/>[server.js]"]
  node_health["Health endpoint<br/>[server.js]"]
end

subgraph group_media["Media generation"]
  node_upload["Photo upload and metadata<br/>[server.js]"]
  node_cutout["Background removal<br/>[server.js]"]
  node_scene["Generated background<br/>[server.js]"]
  node_composition["Brand composition<br/>[server.js]"]
  node_motion["Motion output<br/>[server.js]"]
  node_social["Social formats<br/>[server.js]"]
end

subgraph group_cloud["Cloudinary services"]
  node_cloudinary["Cloudinary media platform"]
end

node_user(("Business user"))

node_user -->|"provides details"| node_browser
node_browser -->|"submits photo"| node_generate
node_generate -->|"accepts photo"| node_upload
node_upload -->|"uploads and tags"| node_cloudinary
node_generate -->|"builds cutout URL"| node_cutout
node_generate -->|"builds scene URL"| node_scene
node_generate -->|"builds composite URL"| node_composition
node_generate -->|"builds motion URL"| node_motion
node_generate -->|"builds format URLs"| node_social
node_cutout -->|"transforms asset"| node_cloudinary
node_scene -->|"generates background"| node_cloudinary
node_composition -->|"composites layers"| node_cloudinary
node_motion -->|"applies zoompan"| node_cloudinary
node_social -->|"creates variants"| node_cloudinary
node_generate -->|"returns media URLs"| node_browser
node_browser -->|"loads history"| node_history
node_history -->|"searches tagged assets"| node_cloudinary
node_asset -->|"reads asset details"| node_cloudinary

click node_browser "https://github.com/jaisurya2823/vidcraft-ai/blob/main/public/index.html"
click node_generate "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_upload "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_cutout "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_scene "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_composition "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_motion "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_social "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_history "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_asset "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js"
click node_health "https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.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_browser,node_user toneBlue
class node_generate,node_history,node_asset,node_health toneAmber
class node_upload,node_cutout,node_scene,node_composition,node_motion,node_social toneMint
class node_cloudinary toneRose
```

## Components

### User experience

- [Upload and results UI](https://github.com/jaisurya2823/vidcraft-ai/blob/main/public/index.html): `public/index.html`

### Application API

- [Generate endpoint](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [History endpoint](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Asset analysis endpoint](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Health endpoint](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`

### Media generation

- [Photo upload and metadata](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Background removal](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Generated background](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Brand composition](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Motion output](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`
- [Social formats](https://github.com/jaisurya2823/vidcraft-ai/blob/main/server/server.js): `server/server.js`

### Cloudinary services

- **Cloudinary media platform**

### Other components

- **Business user**

## Connections

- Business user → Upload and results UI: provides details (evidence: `README.md`)
- Upload and results UI → Generate endpoint: submits photo (evidence: `README.md`)
- Generate endpoint → Photo upload and metadata: accepts photo (evidence: `server/server.js`)
- Photo upload and metadata → Cloudinary media platform: uploads and tags (evidence: `server/server.js`)
- Generate endpoint → Background removal: builds cutout URL (evidence: `server/server.js`)
- Generate endpoint → Generated background: builds scene URL (evidence: `server/server.js`)
- Generate endpoint → Brand composition: builds composite URL (evidence: `server/server.js`)
- Generate endpoint → Motion output: builds motion URL (evidence: `server/server.js`)
- Generate endpoint → Social formats: builds format URLs (evidence: `server/server.js`)
- Background removal → Cloudinary media platform: transforms asset (evidence: `server/server.js`)
- Generated background → Cloudinary media platform: generates background (evidence: `server/server.js`)
- Brand composition → Cloudinary media platform: composites layers (evidence: `server/server.js`)
- Motion output → Cloudinary media platform: applies zoompan (evidence: `server/server.js`)
- Social formats → Cloudinary media platform: creates variants (evidence: `server/server.js`)
- Generate endpoint → Upload and results UI: returns media URLs (evidence: `README.md`)
- Upload and results UI → History endpoint: loads history (evidence: `README.md`)
- History endpoint → Cloudinary media platform: searches tagged assets (evidence: `server/server.js`)
- Asset analysis endpoint → Cloudinary media platform: reads asset details (evidence: `server/server.js`)
