# 27sayan/hashtagx architecture

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

- Interactive diagram: https://gitdiagram.com/27sayan/hashtagx
- Repository: https://github.com/27sayan/hashtagx

## Overview

HashtagX is an interactive tool for generating hashtag variants from a name and optional keywords, searching X for matching tweets, and optionally saving results to CSV. The main workflow runs the generator, loads its output, gathers search preferences, then searches and presents matching tweet links. The search routine owns pagination, rate-limit waits, filtering, and CSV writes. The excerpts show these responsibilities and calls; configuration-file contents and the external X service implementation were not sampled.

Main entry points: [`hashtagx.py`](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py) (Interactive workflow), [`generator.py`](https://github.com/27sayan/hashtagx/blob/main/generator.py) (Hashtag generator), [`keywords.txt`](https://github.com/27sayan/hashtagx/blob/main/keywords.txt) (Keyword input), [`config.ini`](https://github.com/27sayan/hashtagx/blob/main/config.ini) (X credentials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Hashtag generation"]
  node_generator["Hashtag generator<br/>[generator.py]"]
  node_keywords["Keyword input<br/>[keywords.txt]"]
  node_hashtag_load["Hashtag loading<br/>[hashtagx.py]"]
end

subgraph group_search["X search"]
  node_workflow["Interactive workflow<br/>[hashtagx.py]"]
  node_credentials["X credentials<br/>[config.ini]"]
  node_tweet_search["Tweet search<br/>[hashtagx.py]"]
  node_pagination["Search pagination<br/>[hashtagx.py]"]
end

subgraph group_results["Results and output"]
  node_matching["Hashtag matching<br/>[hashtagx.py]"]
  node_link_output["Link output<br/>[hashtagx.py]"]
  node_csv_output["CSV export<br/>[hashtagx.py]"]
  node_csv_file["Tweet CSV"]
end

node_user(("User"))
node_x_service["X service"]

node_user -->|"starts"| node_workflow
node_workflow -->|"runs"| node_generator
node_user -->|"enters name"| node_generator
node_generator -->|"reads"| node_keywords
node_generator -->|"writes hashtags"| node_hashtag_load
node_workflow -->|"loads hashtags"| node_hashtag_load
node_workflow -->|"reads"| node_credentials
node_workflow -->|"starts search"| node_tweet_search
node_tweet_search -->|"logs in and searches"| node_x_service
node_tweet_search -->|"fetches pages"| node_pagination
node_pagination -->|"requests next page"| node_x_service
node_tweet_search -->|"filters tweets"| node_matching
node_matching -->|"prints links"| node_link_output
node_matching -->|"provides tweet data"| node_csv_output
node_csv_output -->|"writes rows"| node_csv_file

click node_workflow "https://github.com/27sayan/hashtagx/blob/main/hashtagx.py"
click node_generator "https://github.com/27sayan/hashtagx/blob/main/generator.py"
click node_keywords "https://github.com/27sayan/hashtagx/blob/main/keywords.txt"
click node_credentials "https://github.com/27sayan/hashtagx/blob/main/config.ini"
click node_hashtag_load "https://github.com/27sayan/hashtagx/blob/main/hashtagx.py"
click node_tweet_search "https://github.com/27sayan/hashtagx/blob/main/hashtagx.py"
click node_pagination "https://github.com/27sayan/hashtagx/blob/main/hashtagx.py"
click node_matching "https://github.com/27sayan/hashtagx/blob/main/hashtagx.py"
click node_link_output "https://github.com/27sayan/hashtagx/blob/main/hashtagx.py"
click node_csv_output "https://github.com/27sayan/hashtagx/blob/main/hashtagx.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_generator,node_keywords,node_hashtag_load,node_user toneBlue
class node_workflow,node_credentials,node_tweet_search,node_pagination toneAmber
class node_matching,node_link_output,node_csv_output,node_csv_file toneMint
class node_x_service toneIndigo
```

## Components

### Hashtag generation

- [Hashtag generator](https://github.com/27sayan/hashtagx/blob/main/generator.py): `generator.py`
- [Keyword input](https://github.com/27sayan/hashtagx/blob/main/keywords.txt): `keywords.txt`
- [Hashtag loading](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`

### X search

- [Interactive workflow](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`
- [X credentials](https://github.com/27sayan/hashtagx/blob/main/config.ini): `config.ini`
- [Tweet search](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`
- [Search pagination](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`

### Results and output

- [Hashtag matching](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`
- [Link output](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`
- [CSV export](https://github.com/27sayan/hashtagx/blob/main/hashtagx.py): `hashtagx.py`
- **Tweet CSV**

### Other components

- **User**
- **X service**

## Connections

- User → Interactive workflow: starts (evidence: `Readme.md`)
- Interactive workflow → Hashtag generator: runs (evidence: `hashtagx.py`)
- User → Hashtag generator: enters name (evidence: `generator.py`)
- Hashtag generator → Keyword input: reads (evidence: `generator.py`)
- Hashtag generator → Hashtag loading: writes hashtags (evidence: `generator.py`)
- Interactive workflow → Hashtag loading: loads hashtags (evidence: `hashtagx.py`)
- Interactive workflow → X credentials: reads (evidence: `hashtagx.py`)
- Interactive workflow → Tweet search: starts search (evidence: `hashtagx.py`)
- Tweet search → X service: logs in and searches (evidence: `hashtagx.py`)
- Tweet search → Search pagination: fetches pages (evidence: `hashtagx.py`)
- Search pagination → X service: requests next page (evidence: `hashtagx.py`)
- Tweet search → Hashtag matching: filters tweets (evidence: `hashtagx.py`)
- Hashtag matching → Link output: prints links (evidence: `hashtagx.py`)
- Hashtag matching → CSV export: provides tweet data (evidence: `hashtagx.py`)
- CSV export → Tweet CSV: writes rows (evidence: `hashtagx.py`)
