# muneeb-islam/growth-engine architecture

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

- Interactive diagram: https://gitdiagram.com/muneeb-islam/growth-engine
- Repository: https://github.com/muneeb-islam/growth-engine

## Overview

Growth Engine Demo is a small e-commerce ad-operations pipeline: scrape brand and competitor products, generate angle-based ad variants, create matching landing-page records, seed simulated performance, then display results in a dashboard and public landing pages. The README documents the pipeline order; sampled scripts show their database operations and DeepSeek call. The Prisma schema and database wiring are represented from the tree and README, but the schema itself was not excerpted.

Main entry points: [`lib/prisma.ts`](https://github.com/muneeb-islam/growth-engine/blob/main/lib/prisma.ts) (Prisma Client), [`scripts/generate-hooks.ts`](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/generate-hooks.ts) (Copy Generator), [`scripts/scrape.ts`](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/scrape.ts) (Product Scraper), [`scripts/generate-landing-pages.ts`](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/generate-landing-pages.ts) (Page Record Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Product Collection"]
  node_scraper["Product Scraper<br/>[scrape.ts]"]
  node_orm["Prisma Client<br/>[prisma.ts]"]
  node_database[("Growth Data<br/>[schema.prisma]")]
end

subgraph group_creative["Ad Creative"]
  node_copygen["Copy Generator<br/>[generate-hooks.ts]"]
end

subgraph group_delivery["Pages and Metrics"]
  node_pagegen["Page Record Generator"]
  node_metricgen["Metric Simulator<br/>[seed-metrics.ts]"]
end

subgraph group_application["Web Application"]
  node_dashboard["Performance Dashboard<br/>[page.tsx]"]
  node_landing["Public Landing Page<br/>[page.tsx]"]
end

node_operator(("Pipeline Operator"))
node_stores["Brand Stores"]
node_deepseek{{"DeepSeek API"}}

node_operator -->|"runs first"| node_scraper
node_operator -->|"runs next"| node_copygen
node_operator -->|"runs next"| node_pagegen
node_operator -->|"runs next"| node_metricgen
node_stores -->|"provides product data"| node_scraper
node_scraper -->|"writes scraped records"| node_orm
node_copygen -->|"reads products and saves hooks"| node_orm
node_copygen -->|"requests ad variants"| node_deepseek
node_pagegen -->|"reads hooks; creates pages"| node_orm
node_metricgen -->|"reads pages; creates metrics"| node_orm
node_dashboard -->|"queries performance data"| node_orm
node_landing -->|"looks up page by slug"| node_orm
node_orm -.->|"persists and reads"| node_database
node_operator -->|"views results"| node_dashboard
node_operator -->|"visits ad page"| node_landing

click node_scraper "https://github.com/muneeb-islam/growth-engine/blob/main/scripts/scrape.ts"
click node_copygen "https://github.com/muneeb-islam/growth-engine/blob/main/scripts/generate-hooks.ts"
click node_pagegen "https://github.com/muneeb-islam/growth-engine/blob/main/scripts/generate-landing-pages.ts"
click node_metricgen "https://github.com/muneeb-islam/growth-engine/blob/main/scripts/seed-metrics.ts"
click node_dashboard "https://github.com/muneeb-islam/growth-engine/blob/main/app/dashboard/page.tsx"
click node_landing "https://github.com/muneeb-islam/growth-engine/blob/main/app/lp/%5Bslug%5D/page.tsx"
click node_orm "https://github.com/muneeb-islam/growth-engine/blob/main/lib/prisma.ts"
click node_database "https://github.com/muneeb-islam/growth-engine/blob/main/prisma/schema.prisma"

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_scraper,node_orm,node_database toneBlue
class node_copygen toneAmber
class node_pagegen,node_metricgen,node_deepseek toneMint
class node_dashboard,node_landing toneRose
class node_operator,node_stores toneIndigo
```

## Components

### Product Collection

- [Product Scraper](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/scrape.ts): `scripts/scrape.ts`
- [Prisma Client](https://github.com/muneeb-islam/growth-engine/blob/main/lib/prisma.ts): `lib/prisma.ts`
- [Growth Data](https://github.com/muneeb-islam/growth-engine/blob/main/prisma/schema.prisma): `prisma/schema.prisma`

### Ad Creative

- [Copy Generator](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/generate-hooks.ts): `scripts/generate-hooks.ts`

### Pages and Metrics

- [Page Record Generator](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/generate-landing-pages.ts): `scripts/generate-landing-pages.ts`
- [Metric Simulator](https://github.com/muneeb-islam/growth-engine/blob/main/scripts/seed-metrics.ts): `scripts/seed-metrics.ts`

### Web Application

- [Performance Dashboard](https://github.com/muneeb-islam/growth-engine/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Public Landing Page](https://github.com/muneeb-islam/growth-engine/blob/main/app/lp/%5Bslug%5D/page.tsx): `app/lp/[slug]/page.tsx`

### Other components

- **Pipeline Operator**
- **Brand Stores**
- **DeepSeek API**

## Connections

- Pipeline Operator → Product Scraper: runs first (evidence: `README.md`)
- Pipeline Operator → Copy Generator: runs next (evidence: `README.md`)
- Pipeline Operator → Page Record Generator: runs next (evidence: `README.md`)
- Pipeline Operator → Metric Simulator: runs next (evidence: `README.md`)
- Brand Stores → Product Scraper: provides product data (evidence: `scripts/scrape.ts`)
- Product Scraper → Prisma Client: writes scraped records (evidence: `scripts/scrape.ts`)
- Copy Generator → Prisma Client: reads products and saves hooks (evidence: `scripts/generate-hooks.ts`)
- Copy Generator → DeepSeek API: requests ad variants (evidence: `scripts/generate-hooks.ts`)
- Page Record Generator → Prisma Client: reads hooks; creates pages (evidence: `scripts/generate-landing-pages.ts`)
- Metric Simulator → Prisma Client: reads pages; creates metrics (evidence: `scripts/seed-metrics.ts`)
- Performance Dashboard → Prisma Client: queries performance data (evidence: `app/dashboard/page.tsx`)
- Public Landing Page → Prisma Client: looks up page by slug (evidence: `app/lp/[slug]/page.tsx`)
- Prisma Client → Growth Data: persists and reads (evidence: `README.md`)
- Pipeline Operator → Performance Dashboard: views results (evidence: `README.md`)
- Pipeline Operator → Public Landing Page: visits ad page (evidence: `README.md`)
