# google-marketing-solutions/feedgen architecture

> Architecture diagram of the GitHub repository google-marketing-solutions/feedgen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google-marketing-solutions/feedgen
- Repository: https://github.com/google-marketing-solutions/feedgen

## Overview

FeedGen optimizes merchant product feeds through a Google Sheets sidebar: users configure generation, submit feed rows, and review scored suggestions before exporting approved content as a supplemental feed. The Apps Script app coordinates title and description generation, optional landing-page and image context, attribute filling, scoring, and sheet-based validation. The repository also documents a BigQuery processing alternative and includes a separate Cloud Function for batch attribute enrichment. The main workflow is evidenced by the README and partial app excerpt; links for unsampled BigQuery behavior are limited to documented capabilities.

Main entry points: [`src/app.ts`](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts) (Workflow coordinator), [`src/helpers/vertex.ts`](https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/vertex.ts) (Model client), [`enrichment/src/main.py`](https://github.com/google-marketing-solutions/feedgen/blob/main/enrichment/src/main.py) (Batch enrichment), [`src/static/index.html`](https://github.com/google-marketing-solutions/feedgen/blob/main/src/static/index.html) (Sidebar UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sheets_app["Sheets application"]
  node_app["Workflow coordinator<br/>[app.ts]"]
  node_ui["Sidebar UI<br/>[index.html]"]
  node_config["Feed configuration<br/>[config.ts]"]
  node_sheets[("Google Sheets")]
  node_cache[("Page cache")]
  node_logger["Run logging<br/>[logger.ts]"]
end

subgraph group_content_generation["Content generation"]
  node_prompt_generation["Prompt assembly<br/>[app.ts]"]
  node_landing_page["Page context fetch<br/>[util.ts]"]
  node_image_context["Image understanding<br/>[vertex.ts]"]
  node_vertex_helper["Model client<br/>[vertex.ts]"]
  node_content_scoring["Content scoring<br/>[app.ts]"]
  node_attribute_fill["Attribute filling<br/>[app.ts]"]
end

subgraph group_feed_outputs["Feed outputs"]
  node_validation["Human validation<br/>[app.ts]"]
  node_supplemental_feed["Supplemental feed<br/>[app.ts]"]
end

subgraph group_batch_alternatives["Batch alternatives"]
  node_bigquery["BigQuery processing"]
  node_enrichment["Batch enrichment<br/>[main.py]"]
  node_cloud_storage[("Cloud Storage")]
  node_gemini_batch["Gemini batch"]
end

node_merchant(("Merchant"))
node_web_page["Product web page"]
node_vertex_ai["Vertex AI"]
node_merchant_center["Merchant Center"]

node_merchant -->|"launches"| node_ui
node_ui -->|"invokes"| node_app
node_app -->|"reads settings"| node_config
node_app -->|"reads feed"| node_sheets
node_app -->|"builds prompts"| node_prompt_generation
node_prompt_generation -.->|"adds page context"| node_landing_page
node_landing_page -.->|"fetches content"| node_web_page
node_app -.->|"caches page data"| node_cache
node_app -.->|"uses image context"| node_image_context
node_app -->|"requests generation"| node_vertex_helper
node_vertex_helper -->|"calls model API"| node_vertex_ai
node_vertex_helper -.->|"downloads image"| node_image_context
node_app -->|"scores content"| node_content_scoring
node_app -->|"fills attributes"| node_attribute_fill
node_app -->|"writes suggestions"| node_validation
node_validation -->|"stores review rows"| node_sheets
node_merchant -->|"reviews suggestions"| node_sheets
node_app -->|"writes approved feed"| node_sheets
node_app -->|"logs activity"| node_logger
node_sheets -->|"provides export data"| node_supplemental_feed
node_supplemental_feed -->|"supplements catalog"| node_merchant_center
node_merchant -.->|"processes feed"| node_bigquery
node_merchant -.->|"submits batch request"| node_enrichment
node_enrichment -.->|"reads and writes CSV"| node_cloud_storage
node_enrichment -.->|"creates batch job"| node_gemini_batch
node_gemini_batch -.->|"stores predictions"| node_cloud_storage

click node_app "https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts"
click node_ui "https://github.com/google-marketing-solutions/feedgen/blob/main/src/static/index.html"
click node_config "https://github.com/google-marketing-solutions/feedgen/blob/main/src/config.ts"
click node_logger "https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/logger.ts"
click node_prompt_generation "https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts"
click node_landing_page "https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/util.ts"
click node_image_context "https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/vertex.ts"
click node_vertex_helper "https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/vertex.ts"
click node_content_scoring "https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts"
click node_attribute_fill "https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts"
click node_validation "https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts"
click node_supplemental_feed "https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts"
click node_bigquery "https://github.com/google-marketing-solutions/feedgen/tree/main/bigquery"
click node_enrichment "https://github.com/google-marketing-solutions/feedgen/blob/main/enrichment/src/main.py"

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_ui,node_config,node_sheets,node_cache,node_logger toneBlue
class node_prompt_generation,node_landing_page,node_image_context,node_vertex_helper,node_content_scoring,node_attribute_fill toneAmber
class node_validation,node_supplemental_feed toneMint
class node_bigquery,node_enrichment,node_cloud_storage,node_gemini_batch toneRose
class node_merchant,node_web_page,node_vertex_ai,node_merchant_center toneIndigo
```

## Components

### Sheets application

- [Workflow coordinator](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts): `src/app.ts`
- [Sidebar UI](https://github.com/google-marketing-solutions/feedgen/blob/main/src/static/index.html): `src/static/index.html`
- [Feed configuration](https://github.com/google-marketing-solutions/feedgen/blob/main/src/config.ts): `src/config.ts`
- **Google Sheets**
- **Page cache**
- [Run logging](https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/logger.ts): `src/helpers/logger.ts`

### Content generation

- [Prompt assembly](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts): `src/app.ts`
- [Page context fetch](https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/util.ts): `src/helpers/util.ts`
- [Image understanding](https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/vertex.ts): `src/helpers/vertex.ts`
- [Model client](https://github.com/google-marketing-solutions/feedgen/blob/main/src/helpers/vertex.ts): `src/helpers/vertex.ts`
- [Content scoring](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts): `src/app.ts`
- [Attribute filling](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts): `src/app.ts`

### Feed outputs

- [Human validation](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts): `src/app.ts`
- [Supplemental feed](https://github.com/google-marketing-solutions/feedgen/blob/main/src/app.ts): `src/app.ts`

### Batch alternatives

- [BigQuery processing](https://github.com/google-marketing-solutions/feedgen/tree/main/bigquery): `bigquery`
- [Batch enrichment](https://github.com/google-marketing-solutions/feedgen/blob/main/enrichment/src/main.py): `enrichment/src/main.py`
- **Cloud Storage**
- **Gemini batch**

### Other components

- **Merchant**
- **Product web page**
- **Vertex AI**
- **Merchant Center**

## Connections

- Merchant → Sidebar UI: launches
- Sidebar UI → Workflow coordinator: invokes
- Workflow coordinator → Feed configuration: reads settings
- Workflow coordinator → Google Sheets: reads feed
- Workflow coordinator → Prompt assembly: builds prompts
- Prompt assembly → Page context fetch: adds page context
- Page context fetch → Product web page: fetches content
- Workflow coordinator → Page cache: caches page data
- Workflow coordinator → Image understanding: uses image context
- Workflow coordinator → Model client: requests generation
- Model client → Vertex AI: calls model API
- Model client → Image understanding: downloads image
- Workflow coordinator → Content scoring: scores content
- Workflow coordinator → Attribute filling: fills attributes
- Workflow coordinator → Human validation: writes suggestions
- Human validation → Google Sheets: stores review rows
- Merchant → Google Sheets: reviews suggestions
- Workflow coordinator → Google Sheets: writes approved feed
- Workflow coordinator → Run logging: logs activity
- Google Sheets → Supplemental feed: provides export data
- Supplemental feed → Merchant Center: supplements catalog
- Merchant → BigQuery processing: processes feed
- Merchant → Batch enrichment: submits batch request
- Batch enrichment → Cloud Storage: reads and writes CSV
- Batch enrichment → Gemini batch: creates batch job
- Gemini batch → Cloud Storage: stores predictions
