# viggoz/producthunt-daily-hot architecture

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

- Interactive diagram: https://gitdiagram.com/viggoz/producthunt-daily-hot
- Repository: https://github.com/viggoz/producthunt-daily-hot

## Overview

This repository automates a daily Chinese-language Product Hunt top-products digest. The primary workflow fetches the prior day’s products, enriches entries with images, Chinese keywords and translations, renders Markdown, and stores dated results in `data/`; the README also documents scheduled or manual GitHub Actions runs and commits. A separate repair script fills missing image links in existing files. The graph reflects the README and supplied source excerpts; unsampled workflow details and script internals are not inferred beyond documented behavior.

Main entry points: [`scripts/product_hunt_list_to_md.py`](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py) (Digest generator), [`.github/workflows/generate_markdown.yml`](https://github.com/viggoz/producthunt-daily-hot/blob/main/.github/workflows/generate_markdown.yml) (GitHub Actions), [`scripts/fix_images.py`](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/fix_images.py) (Image repair processor), [`data`](https://github.com/viggoz/producthunt-daily-hot/tree/main/data) (Dated digest files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Digest generation"]
  node_automation["GitHub Actions"]
  node_generator["Digest generator"]
  node_producthunt{{"Product Hunt API"}}
  node_image_lookup["Image lookup"]
  node_keyword_generation["Keyword generation"]
  node_translation["Chinese translation"]
  node_openai{{"OpenAI API"}}
  node_markdown["Markdown rendering"]
  node_commit["GitHub commit"]
end

subgraph group_repair["Image repair"]
  node_repair_script["Image repair processor<br/>[fix_images.py]"]
  node_repair_api{{"Product Hunt API"}}
  node_product_page{{"Product page metadata"}}
end

subgraph group_archive["Published archive"]
  node_archive["Dated digest files"]
end

node_maintainer(("Repository maintainer"))
node_schedule(("Daily/manual trigger"))
node_repair_command(("Repair command"))
node_website{{"Online digest site"}}
node_downstream{{"Downstream repository"}}

node_maintainer -->|"configures"| node_automation
node_schedule -->|"triggers"| node_automation
node_automation -->|"runs"| node_generator
node_generator -->|"fetches products"| node_producthunt
node_generator -->|"gets images"| node_image_lookup
node_image_lookup -->|"reads metadata"| node_product_page
node_generator -->|"generates keywords"| node_keyword_generation
node_generator -->|"translates text"| node_translation
node_keyword_generation -->|"requests generation"| node_openai
node_translation -->|"requests translation"| node_openai
node_generator -->|"renders entries"| node_markdown
node_markdown -->|"writes daily file"| node_archive
node_automation -->|"commits results"| node_commit
node_archive -->|"published online"| node_website
node_repair_command -->|"runs"| node_repair_script
node_repair_script -->|"updates missing images"| node_archive
node_repair_script -->|"queries images"| node_repair_api
node_repair_script -->|"reads fallback metadata"| node_product_page
node_automation -.->|"notifies optionally"| node_downstream

click node_automation "https://github.com/viggoz/producthunt-daily-hot/blob/main/.github/workflows/generate_markdown.yml"
click node_generator "https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py"
click node_image_lookup "https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py"
click node_keyword_generation "https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py"
click node_translation "https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py"
click node_markdown "https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py"
click node_archive "https://github.com/viggoz/producthunt-daily-hot/tree/main/data"
click node_commit "https://github.com/viggoz/producthunt-daily-hot/blob/main/.github/workflows/generate_markdown.yml"
click node_repair_script "https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/fix_images.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_automation,node_generator,node_producthunt,node_image_lookup,node_keyword_generation,node_translation,node_openai,node_markdown,node_commit toneBlue
class node_repair_script,node_repair_api,node_product_page toneAmber
class node_archive toneMint
class node_maintainer,node_schedule,node_repair_command,node_website,node_downstream toneIndigo
```

## Components

### Digest generation

- [GitHub Actions](https://github.com/viggoz/producthunt-daily-hot/blob/main/.github/workflows/generate_markdown.yml): `.github/workflows/generate_markdown.yml`
- [Digest generator](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py): `scripts/product_hunt_list_to_md.py`
- **Product Hunt API**
- [Image lookup](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py): `scripts/product_hunt_list_to_md.py`
- [Keyword generation](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py): `scripts/product_hunt_list_to_md.py`
- [Chinese translation](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py): `scripts/product_hunt_list_to_md.py`
- **OpenAI API**
- [Markdown rendering](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/product_hunt_list_to_md.py): `scripts/product_hunt_list_to_md.py`
- [GitHub commit](https://github.com/viggoz/producthunt-daily-hot/blob/main/.github/workflows/generate_markdown.yml): `.github/workflows/generate_markdown.yml`

### Image repair

- [Image repair processor](https://github.com/viggoz/producthunt-daily-hot/blob/main/scripts/fix_images.py): `scripts/fix_images.py`
- **Product Hunt API**
- **Product page metadata**

### Published archive

- [Dated digest files](https://github.com/viggoz/producthunt-daily-hot/tree/main/data): `data`

### Other components

- **Repository maintainer**
- **Daily/manual trigger**
- **Repair command**
- **Online digest site**
- **Downstream repository**

## Connections

- Repository maintainer → GitHub Actions: configures (evidence: `README.md`)
- Daily/manual trigger → GitHub Actions: triggers (evidence: `README.md`)
- GitHub Actions → Digest generator: runs (evidence: `README.md`)
- Digest generator → Product Hunt API: fetches products (evidence: `scripts/product_hunt_list_to_md.py`)
- Digest generator → Image lookup: gets images (evidence: `scripts/product_hunt_list_to_md.py`)
- Image lookup → Product page metadata: reads metadata (evidence: `scripts/product_hunt_list_to_md.py`)
- Digest generator → Keyword generation: generates keywords (evidence: `scripts/product_hunt_list_to_md.py`)
- Digest generator → Chinese translation: translates text (evidence: `scripts/product_hunt_list_to_md.py`)
- Keyword generation → OpenAI API: requests generation (evidence: `scripts/product_hunt_list_to_md.py`)
- Chinese translation → OpenAI API: requests translation (evidence: `scripts/product_hunt_list_to_md.py`)
- Digest generator → Markdown rendering: renders entries (evidence: `scripts/product_hunt_list_to_md.py`)
- Markdown rendering → Dated digest files: writes daily file (evidence: `README.md`)
- GitHub Actions → GitHub commit: commits results (evidence: `README.md`)
- Dated digest files → Online digest site: published online (evidence: `README.md`)
- Repair command → Image repair processor: runs (evidence: `scripts/fix_images.py`)
- Image repair processor → Dated digest files: updates missing images (evidence: `scripts/fix_images.py`)
- Image repair processor → Product Hunt API: queries images (evidence: `scripts/fix_images.py`)
- Image repair processor → Product page metadata: reads fallback metadata (evidence: `scripts/fix_images.py`)
- GitHub Actions → Downstream repository: notifies optionally (evidence: `README.md`)
