# markmircea/reddit-ai-auto-advertising-commenting-bot architecture

> Architecture diagram of the GitHub repository markmircea/reddit-ai-auto-advertising-commenting-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/markmircea/reddit-ai-auto-advertising-commenting-bot
- Repository: https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot

## Overview

#### Purpose and Entry Point
Reddit AI Commenter Pro is a desktop Python workflow for scraping Reddit posts, generating candidate AI comments, presenting them for human review, and posting selected comments. The primary source entry point is `reddit_scraper_gui.py`, launched with `python reddit_scraper_gui.py`. A packaged Windows distribution is available at `dist/RedditScraperGUI.exe`.

#### GUI-Orchestrated Application Flow
`reddit_scraper_gui.py` is the application coordinator and user-facing boundary. It collects Reddit credentials, subreddit targets, and scrape settings; starts the scrape/generation/review workflow; and ultimately triggers posting of user-selected comments. The README references modular GUI and scraper files, but those modules are not present in this tree, so the checked-in GUI script is the authoritative visible implementation path: `reddit_scraper_gui.py`.

#### Reddit Collection and Posting Boundary
Reddit interaction is the principal external-service boundary: authentication uses a supplied Reddit username/password, scraping reads posts and comments from configured subreddits, and the final stage writes approved replies back to Reddit. `reddit_scraper.py` exists as a legacy implementation; the README explicitly identifies it as removable old-version code. Avoid treating it as the primary architecture without inspecting its behavior.

#### AI Comment Generation and Review Gate
The central processing pipeline is: scraped Reddit content → AI-generated comments → user review/selection → Reddit posting. Human review is an intentional control boundary rather than fully autonomous posting. The README also identifies spaCy’s `en_core_web_md` model as a required runtime asset and notes optional/neural word-vector similarity behavior, making local NLP processing materially relevant to generation or relevance filtering.

#### Persistent Settings and Operational Logs
Application configuration is persisted in `settings.json`; packaged execution also ships a separate runtime copy at `dist/settings.json`. Logging is emitted to `log.txt` in source-oriented execution and `dist/log.txt` for the distributable. These files form the key operational state and diagnostics boundary:
- `settings.json`
- `log.txt`
- `dist/settings.json`
- `dist/log.txt`

#### Runtime, Packaging, and Delivery
The source runtime is Python 3.8+ with dependencies declared in `requirements.txt`, plus the externally installed spaCy language model. Windows distribution is produced with PyInstaller-style artifacts: `RedditScraperGUI.spec` defines the build, `build/RedditScraperGUI/` contains intermediate analysis/package output, and `dist/RedditScraperGUI.exe` is the deployable executable. The embedded package artifact `build/RedditScraperGUI/RedditScraperGUI.pkg` indicates the executable bundles application dependencies for end users.

#### Ancillary Web Assets
`index.html`, `script.js`, and `styles.css` are present but are not referenced by the README’s desktop execution path. Treat them as separate or supporting assets until code inspection establishes an integration with `reddit_scraper_gui.py`; do not assume the repository is a web application.

Main entry points: [`reddit_scraper_gui.py`](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/reddit_scraper_gui.py) (GUI coordinator), [`dist/RedditScraperGUI.exe`](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/RedditScraperGUI.exe) (Windows executable), [`build/RedditScraperGUI/RedditScraperGUI.pkg`](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/build/RedditScraperGUI/RedditScraperGUI.pkg) (Bundled package artifact), [`requirements.txt`](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/requirements.txt) (Python dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workflow"]
  node_gui["GUI coordinator<br/>Python entry point"]
  node_collection["Content collection<br/>pipeline stage"]
  node_nlp["Local NLP processing<br/>spaCy runtime asset"]
  node_spacy_model["en_core_web_md<br/>spaCy model"]
  node_generation["AI comment generation<br/>pipeline stage"]
  node_review["Human review and selection<br/>control gate"]
  node_posting["Approved comment posting<br/>pipeline stage"]
end

subgraph group_runtime["Runtime state"]
  node_settings["Source settings<br/>persistent configuration<br/>[settings.json]"]
  node_logs["Source log<br/>operational log<br/>[log.txt]"]
  node_requirements["Python dependencies<br/>dependency manifest<br/>[requirements.txt]"]
end

subgraph group_delivery["Windows delivery"]
  node_spec["PyInstaller build spec<br/>packaging definition"]
  node_build_package["Bundled package artifact<br/>PyInstaller artifact"]
  node_executable["Windows executable<br/>deployable application"]
  node_dist_settings["Packaged settings<br/>runtime configuration<br/>[settings.json]"]
  node_dist_logs["Packaged log<br/>operational log<br/>[log.txt]"]
end

node_reddit{{"Reddit<br/>external service"}}

node_gui -->|"loads and saves"| node_settings
node_gui -->|"starts"| node_collection
node_collection -->|"reads authenticated content"| node_reddit
node_collection -->|"supplies scraped content"| node_nlp
node_spacy_model -->|"provides language vectors"| node_nlp
node_nlp -->|"supports filtering or relevance"| node_generation
node_generation -->|"candidate comments"| node_review
node_review -->|"selected comments"| node_posting
node_posting -->|"writes replies"| node_reddit
node_gui -->|"emits diagnostics"| node_logs
node_requirements -.->|"provides Python runtime dependencies"| node_gui
node_spec -->|"builds"| node_build_package
node_build_package -->|"bundled into"| node_executable
node_executable -->|"uses"| node_dist_settings
node_executable -->|"emits diagnostics"| node_dist_logs

click node_gui "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/reddit_scraper_gui.py"
click node_settings "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/settings.json"
click node_logs "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/log.txt"
click node_requirements "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/requirements.txt"
click node_spec "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/RedditScraperGUI.spec"
click node_build_package "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/build/RedditScraperGUI/RedditScraperGUI.pkg"
click node_executable "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/RedditScraperGUI.exe"
click node_dist_settings "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/settings.json"
click node_dist_logs "https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/log.txt"

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_gui,node_collection,node_nlp,node_spacy_model,node_generation,node_review,node_posting toneBlue
class node_settings,node_logs,node_requirements toneAmber
class node_spec,node_build_package,node_executable,node_dist_settings,node_dist_logs toneMint
class node_reddit toneNeutral
```

## Components

### Desktop workflow

- [GUI coordinator](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/reddit_scraper_gui.py): Python entry point · Collects settings and orchestrates scrape, review, and posting. · `reddit_scraper_gui.py`
- **Content collection**: pipeline stage · Reads posts and comments from selected subreddits.
- **Local NLP processing**: spaCy runtime asset · Supports relevance or similarity behavior.
- **en_core_web_md**: spaCy model · Required externally installed language model.
- **AI comment generation**: pipeline stage · Produces candidate comments from scraped content.
- **Human review and selection**: control gate · Users approve comments before posting.
- **Approved comment posting**: pipeline stage

### Runtime state

- [Source settings](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/settings.json): persistent configuration · `settings.json`
- [Source log](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/log.txt): operational log · `log.txt`
- [Python dependencies](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/requirements.txt): dependency manifest · `requirements.txt`

### Windows delivery

- [PyInstaller build spec](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/RedditScraperGUI.spec): packaging definition · `RedditScraperGUI.spec`
- [Bundled package artifact](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/build/RedditScraperGUI/RedditScraperGUI.pkg): PyInstaller artifact · Intermediate package containing application dependencies. · `build/RedditScraperGUI/RedditScraperGUI.pkg`
- [Windows executable](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/RedditScraperGUI.exe): deployable application · `dist/RedditScraperGUI.exe`
- [Packaged settings](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/settings.json): runtime configuration · `dist/settings.json`
- [Packaged log](https://github.com/markmircea/reddit-ai-auto-advertising-commenting-bot/blob/main/dist/log.txt): operational log · `dist/log.txt`

### Other components

- **Reddit**: external service · Authentication, content reads, and approved-comment writes.

## Connections

- GUI coordinator → Source settings: loads and saves
- GUI coordinator → Content collection: starts
- Content collection → Reddit: reads authenticated content
- Content collection → Local NLP processing: supplies scraped content
- en_core_web_md → Local NLP processing: provides language vectors
- Local NLP processing → AI comment generation: supports filtering or relevance
- AI comment generation → Human review and selection: candidate comments
- Human review and selection → Approved comment posting: selected comments
- Approved comment posting → Reddit: writes replies
- GUI coordinator → Source log: emits diagnostics
- Python dependencies → GUI coordinator: provides Python runtime dependencies
- PyInstaller build spec → Bundled package artifact: builds
- Bundled package artifact → Windows executable: bundled into
- Windows executable → Packaged settings: uses
- Windows executable → Packaged log: emits diagnostics
