# imdeepanshukashyap/ai-ads-generator-editor- architecture

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

- Interactive diagram: https://gitdiagram.com/imdeepanshukashyap/ai-ads-generator-editor-
- Repository: https://github.com/imdeepanshukashyap/ai-ads-generator-editor-
- Video tour (about a minute): https://gitdiagram.com/imdeepanshukashyap/ai-ads-generator-editor-/video

## Overview

AdGen-Studio is a web application for creating AI-generated product-ad images and videos, managing generations, and sharing or publishing social content. The main user flow is routed through the React client to authenticated project APIs, which invoke Google AI generation and persist project data; payment, social publishing, and administration are distinct capabilities. The README provides no further product detail, so feature coverage relies on the source index and shown route/controller excerpts; unsampled page behavior is not inferred.

Main entry points: [`client/src/App.tsx`](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/App.tsx) (React app routes), [`server/server.ts`](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/server.ts) (HTTP server), [`client/src/configs/axios.ts`](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/configs/axios.ts) (HTTP client), [`server/controllers/projectController.ts`](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/projectController.ts) (Project generation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["React app routes<br/>[App.tsx]"]
  node_generator["Ad generator<br/>[Genetator.tsx]"]
  node_results["Generation results<br/>[Result.tsx]"]
  node_mygenerations["My generations<br/>[MyGenerations.tsx]"]
  node_community["Community feed<br/>[Community.tsx]"]
  node_share["Share dialog<br/>[ShareModal.tsx]"]
  node_plans["Plans and checkout<br/>[Plans.tsx]"]
  node_api_client["HTTP client<br/>[axios.ts]"]
end

subgraph group_api["API and access"]
  node_server["HTTP server<br/>[server.ts]"]
  node_project_routes["Project routes<br/>[projectRoutes.ts]"]
  node_auth["User authentication<br/>[auth.ts]"]
end

subgraph group_creation["Ad creation"]
  node_project_controller["Project generation API"]
  node_ai["Google AI generation<br/>[googleAiService.ts]"]
  node_projects_db[("Project data<br/>[prisma.ts]")]
  node_cloudinary["Cloudinary media"]
end

subgraph group_commerce["Payments and admin"]
  node_payment_routes["Payment routes<br/>[paymentRoutes.ts]"]
  node_payment_controller["Payment API"]
  node_payment_service["Payment and credits<br/>[paymentService.ts]"]
  node_razorpay["Razorpay gateway<br/>[razorpayGateway.ts]"]
  node_admin_routes["Admin routes<br/>[adminRoutes.ts]"]
  node_admin_controller["Admin API<br/>[adminController.ts]"]
  node_admin_service["Admin queries<br/>[adminService.ts]"]
  node_model_library["Model library API"]
end

subgraph group_social["Social publishing"]
  node_social_routes["Social routes<br/>[socialRoutes.ts]"]
  node_social_controller["Social account and post API"]
  node_social_ui["Social feed and sharing<br/>[Community.tsx]"]
  node_social_service["Platform publishing<br/>[meta.ts]"]
  node_youtube_service["YouTube publishing<br/>[youtube.ts]"]
  node_publisher["Scheduled publisher<br/>[publisher.ts]"]
  node_social_db[("Social account data<br/>[prisma.ts]")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_generator
node_app -->|"routes to"| node_results
node_app -->|"routes to"| node_mygenerations
node_app -->|"routes to"| node_community
node_app -->|"routes to"| node_plans
node_generator -.->|"calls API"| node_api_client
node_results -.->|"calls API"| node_api_client
node_mygenerations -.->|"calls API"| node_api_client
node_community -->|"calls API"| node_api_client
node_share -->|"used by"| node_community
node_plans -.->|"calls API"| node_api_client
node_api_client -.->|"sends requests"| node_server
node_server -->|"mounts"| node_project_routes
node_project_routes -->|"protects"| node_auth
node_project_routes -->|"dispatches"| node_project_controller
node_project_controller -->|"generates media"| node_ai
node_project_controller -->|"reads and writes"| node_projects_db
node_project_controller -->|"uploads media"| node_cloudinary
node_server -->|"mounts"| node_payment_routes
node_payment_routes -->|"dispatches"| node_payment_controller
node_payment_controller -->|"handles checkout"| node_payment_service
node_payment_service -.->|"uses gateway"| node_razorpay
node_server -->|"mounts"| node_admin_routes
node_admin_routes -->|"dispatches"| node_admin_controller
node_admin_routes -->|"dispatches"| node_model_library
node_admin_controller -->|"delegates queries"| node_admin_service
node_server -->|"mounts"| node_social_routes
node_social_routes -->|"dispatches"| node_social_controller
node_social_ui -->|"opens"| node_share
node_social_controller -->|"publishes to Meta"| node_social_service
node_social_controller -->|"uploads to YouTube"| node_youtube_service
node_social_controller -->|"reads and writes"| node_social_db
node_server -->|"starts scheduler"| node_publisher
node_publisher -->|"publishes to Meta"| node_social_service
node_publisher -->|"publishes to YouTube"| node_youtube_service
node_publisher -->|"loads scheduled posts"| node_social_db

click node_app "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/App.tsx"
click node_generator "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Genetator.tsx"
click node_results "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Result.tsx"
click node_mygenerations "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/MyGenerations.tsx"
click node_community "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Community.tsx"
click node_share "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/components/ShareModal.tsx"
click node_plans "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Plans.tsx"
click node_api_client "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/configs/axios.ts"
click node_server "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/server.ts"
click node_project_routes "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/projectRoutes.ts"
click node_auth "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/middlewares/auth.ts"
click node_project_controller "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/projectController.ts"
click node_ai "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/googleAiService.ts"
click node_projects_db "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/configs/prisma.ts"
click node_payment_routes "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/paymentRoutes.ts"
click node_payment_controller "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/paymentController.ts"
click node_payment_service "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/paymentService.ts"
click node_razorpay "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/razorpayGateway.ts"
click node_admin_routes "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/adminRoutes.ts"
click node_admin_controller "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/adminController.ts"
click node_admin_service "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/adminService.ts"
click node_model_library "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/modelLibraryController.ts"
click node_social_routes "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/socialRoutes.ts"
click node_social_controller "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/socialController.ts"
click node_social_ui "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Community.tsx"
click node_social_service "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/social/meta.ts"
click node_youtube_service "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/social/youtube.ts"
click node_publisher "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/jobs/publisher.ts"
click node_social_db "https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/configs/prisma.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_app,node_generator,node_results,node_mygenerations,node_community,node_share,node_plans,node_api_client,node_user toneBlue
class node_server,node_project_routes,node_auth toneAmber
class node_project_controller,node_ai,node_projects_db,node_cloudinary toneMint
class node_payment_routes,node_payment_controller,node_payment_service,node_razorpay,node_admin_routes,node_admin_controller,node_admin_service,node_model_library toneRose
class node_social_routes,node_social_controller,node_social_ui,node_social_service,node_youtube_service,node_publisher,node_social_db toneIndigo
```

## Components

### Web client

- [React app routes](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Ad generator](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Genetator.tsx): `client/src/pages/Genetator.tsx`
- [Generation results](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Result.tsx): `client/src/pages/Result.tsx`
- [My generations](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/MyGenerations.tsx): `client/src/pages/MyGenerations.tsx`
- [Community feed](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Community.tsx): `client/src/pages/Community.tsx`
- [Share dialog](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/components/ShareModal.tsx): `client/src/components/ShareModal.tsx`
- [Plans and checkout](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Plans.tsx): `client/src/pages/Plans.tsx`
- [HTTP client](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/configs/axios.ts): `client/src/configs/axios.ts`

### API and access

- [HTTP server](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/server.ts): `server/server.ts`
- [Project routes](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/projectRoutes.ts): `server/routes/projectRoutes.ts`
- [User authentication](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/middlewares/auth.ts): `server/middlewares/auth.ts`

### Ad creation

- [Project generation API](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/projectController.ts): `server/controllers/projectController.ts`
- [Google AI generation](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/googleAiService.ts): `server/services/googleAiService.ts`
- [Project data](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/configs/prisma.ts): `server/configs/prisma.ts`
- **Cloudinary media**

### Payments and admin

- [Payment routes](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/paymentRoutes.ts): `server/routes/paymentRoutes.ts`
- [Payment API](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/paymentController.ts): `server/controllers/paymentController.ts`
- [Payment and credits](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/paymentService.ts): `server/services/paymentService.ts`
- [Razorpay gateway](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/razorpayGateway.ts): `server/services/razorpayGateway.ts`
- [Admin routes](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/adminRoutes.ts): `server/routes/adminRoutes.ts`
- [Admin API](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/adminController.ts): `server/controllers/adminController.ts`
- [Admin queries](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/adminService.ts): `server/services/adminService.ts`
- [Model library API](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/modelLibraryController.ts): `server/controllers/modelLibraryController.ts`

### Social publishing

- [Social routes](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/routes/socialRoutes.ts): `server/routes/socialRoutes.ts`
- [Social account and post API](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/controllers/socialController.ts): `server/controllers/socialController.ts`
- [Social feed and sharing](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/client/src/pages/Community.tsx): `client/src/pages/Community.tsx`
- [Platform publishing](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/social/meta.ts): `server/services/social/meta.ts`
- [YouTube publishing](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/services/social/youtube.ts): `server/services/social/youtube.ts`
- [Scheduled publisher](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/jobs/publisher.ts): `server/jobs/publisher.ts`
- [Social account data](https://github.com/imdeepanshukashyap/ai-ads-generator-editor-/blob/main/server/configs/prisma.ts): `server/configs/prisma.ts`

### Other components

- **User**

## Connections

- User → React app routes: uses (evidence: `client/src/App.tsx`)
- React app routes → Ad generator: routes to (evidence: `client/src/App.tsx`)
- React app routes → Generation results: routes to (evidence: `client/src/App.tsx`)
- React app routes → My generations: routes to (evidence: `client/src/App.tsx`)
- React app routes → Community feed: routes to (evidence: `client/src/App.tsx`)
- React app routes → Plans and checkout: routes to (evidence: `client/src/App.tsx`)
- Ad generator → HTTP client: calls API
- Generation results → HTTP client: calls API
- My generations → HTTP client: calls API
- Community feed → HTTP client: calls API (evidence: `client/src/pages/Community.tsx`)
- Share dialog → Community feed: used by (evidence: `client/src/components/ShareModal.tsx`)
- Plans and checkout → HTTP client: calls API
- HTTP client → HTTP server: sends requests
- HTTP server → Project routes: mounts (evidence: `server/server.ts`)
- Project routes → User authentication: protects (evidence: `server/routes/projectRoutes.ts`)
- Project routes → Project generation API: dispatches (evidence: `server/routes/projectRoutes.ts`)
- Project generation API → Google AI generation: generates media (evidence: `server/controllers/projectController.ts`)
- Project generation API → Project data: reads and writes (evidence: `server/controllers/projectController.ts`)
- Project generation API → Cloudinary media: uploads media (evidence: `server/controllers/projectController.ts`)
- HTTP server → Payment routes: mounts (evidence: `server/server.ts`)
- Payment routes → Payment API: dispatches (evidence: `server/routes/paymentRoutes.ts`)
- Payment API → Payment and credits: handles checkout (evidence: `server/controllers/paymentController.ts`)
- Payment and credits → Razorpay gateway: uses gateway
- HTTP server → Admin routes: mounts (evidence: `server/server.ts`)
- Admin routes → Admin API: dispatches (evidence: `server/routes/adminRoutes.ts`)
- Admin routes → Model library API: dispatches (evidence: `server/routes/adminRoutes.ts`)
- Admin API → Admin queries: delegates queries (evidence: `server/controllers/adminController.ts`)
- HTTP server → Social routes: mounts (evidence: `server/server.ts`)
- Social routes → Social account and post API: dispatches (evidence: `server/routes/socialRoutes.ts`)
- Social feed and sharing → Share dialog: opens (evidence: `client/src/components/ShareModal.tsx`)
- Social account and post API → Platform publishing: publishes to Meta (evidence: `server/controllers/socialController.ts`)
- Social account and post API → YouTube publishing: uploads to YouTube (evidence: `server/controllers/socialController.ts`)
- Social account and post API → Social account data: reads and writes (evidence: `server/controllers/socialController.ts`)
- HTTP server → Scheduled publisher: starts scheduler (evidence: `server/server.ts`)
- Scheduled publisher → Platform publishing: publishes to Meta (evidence: `server/jobs/publisher.ts`)
- Scheduled publisher → YouTube publishing: publishes to YouTube (evidence: `server/jobs/publisher.ts`)
- Scheduled publisher → Social account data: loads scheduled posts (evidence: `server/jobs/publisher.ts`)
