# sarthakbakshi-sar/test architecture

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

- Interactive diagram: https://gitdiagram.com/sarthakbakshi-sar/test
- Repository: https://github.com/sarthakbakshi-sar/test

## Overview

Viral Finance Content Machine is a CLI that discovers finance topics, ranks them, generates X threads and Substack drafts, saves both as Markdown, and can optionally post threads to X. The graph follows calls visible in the excerpts; source-specific fetching and external API interactions are shown where the fetcher and publisher excerpts identify them. The README is empty, and unsampled fetcher details are not inferred.

Main entry points: [`main.py`](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/main.py) (Run workflow), [`src/fetcher.py`](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/fetcher.py) (Discover topics), [`src/publisher.py`](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/publisher.py) (Save and post), [`src/generator.py`](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/generator.py) (Generate content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["CLI orchestration"]
  node_main["Run workflow<br/>[main.py]"]
end

subgraph group_content["Topic and content pipeline"]
  node_fetcher["Discover topics<br/>[fetcher.py]"]
  node_scorer["Rank topics<br/>[scorer.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_generator["Generate content<br/>[generator.py]"]
end

subgraph group_integrations["External integrations"]
  node_rss["Finance RSS feeds"]
  node_reddit["Reddit"]
  node_hackernews["Hacker News"]
  node_trends["Google Trends"]
  node_claude["Anthropic Claude"]
  node_x["X platform"]
end

subgraph group_delivery["Content delivery"]
  node_publisher["Save and post<br/>[publisher.py]"]
  node_files["Markdown output"]
end

node_user(("CLI user"))

node_user -->|"runs CLI"| node_main
node_main -->|"fetches topics"| node_fetcher
node_fetcher -->|"reads feeds"| node_rss
node_fetcher -->|"fetches posts"| node_reddit
node_fetcher -->|"queries API"| node_hackernews
node_fetcher -->|"queries trends"| node_trends
node_fetcher -->|"creates topics"| node_models
node_main -->|"ranks topics"| node_scorer
node_scorer -->|"scores topics"| node_models
node_main -->|"generates drafts"| node_generator
node_generator -->|"requests generation"| node_claude
node_generator -->|"creates drafts"| node_models
node_main -->|"saves drafts"| node_publisher
node_main -->|"posts optionally"| node_publisher
node_publisher -->|"writes Markdown"| node_files
node_publisher -->|"posts thread"| node_x

click node_main "https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/main.py"
click node_fetcher "https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/fetcher.py"
click node_scorer "https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/scorer.py"
click node_models "https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/models.py"
click node_generator "https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/generator.py"
click node_publisher "https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/publisher.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_main,node_user toneBlue
class node_fetcher,node_scorer,node_models,node_generator toneAmber
class node_rss,node_reddit,node_hackernews,node_trends,node_claude,node_x toneMint
class node_publisher,node_files toneRose
```

## Components

### CLI orchestration

- [Run workflow](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/main.py): `main.py`

### Topic and content pipeline

- [Discover topics](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/fetcher.py): `src/fetcher.py`
- [Rank topics](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/scorer.py): `src/scorer.py`
- [Domain models](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/models.py): `src/models.py`
- [Generate content](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/generator.py): `src/generator.py`

### External integrations

- **Finance RSS feeds**
- **Reddit**
- **Hacker News**
- **Google Trends**
- **Anthropic Claude**
- **X platform**

### Content delivery

- [Save and post](https://github.com/sarthakbakshi-sar/test/blob/claude/viral-content-tool-YuiLv/src/publisher.py): `src/publisher.py`
- **Markdown output**

### Other components

- **CLI user**

## Connections

- CLI user → Run workflow: runs CLI (evidence: `main.py`)
- Run workflow → Discover topics: fetches topics (evidence: `main.py`)
- Discover topics → Finance RSS feeds: reads feeds (evidence: `src/fetcher.py`)
- Discover topics → Reddit: fetches posts (evidence: `src/fetcher.py`)
- Discover topics → Hacker News: queries API (evidence: `src/fetcher.py`)
- Discover topics → Google Trends: queries trends (evidence: `src/fetcher.py`)
- Discover topics → Domain models: creates topics (evidence: `src/fetcher.py`)
- Run workflow → Rank topics: ranks topics (evidence: `main.py`)
- Rank topics → Domain models: scores topics (evidence: `src/scorer.py`)
- Run workflow → Generate content: generates drafts (evidence: `main.py`)
- Generate content → Anthropic Claude: requests generation (evidence: `src/generator.py`)
- Generate content → Domain models: creates drafts (evidence: `src/generator.py`)
- Run workflow → Save and post: saves drafts (evidence: `main.py`)
- Run workflow → Save and post: posts optionally (evidence: `main.py`)
- Save and post → Markdown output: writes Markdown (evidence: `src/publisher.py`)
- Save and post → X platform: posts thread (evidence: `src/publisher.py`)
