# estimateflake2/red-m-linkedin-post architecture

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

- Interactive diagram: https://gitdiagram.com/estimateflake2/red-m-linkedin-post
- Repository: https://github.com/estimateflake2/red-m-linkedin-post

## Overview

This is a one-file automation app that creates and optionally publishes a weekly #redMonday LinkedIn post. Its main workflow gathers Houston event information, selects the next future event when available, generates and saves post text, then publishes it unless run in dry-run mode. The README documents the overall workflow and fallback behavior; the source excerpt shows the HTTP integrations and post-generation logic, but omits parts of the main orchestration and saving code.

Main entry points: [`red_monday_bot.py`](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py) (CLI workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_event_data["Event discovery"]
  node_calendar["Houston calendar<br/>[red_monday_bot.py]"]
  node_redm["redM calendar site"]
  node_event_parse["Event extraction<br/>[red_monday_bot.py]"]
  node_event_select["Upcoming event selection<br/>[red_monday_bot.py]"]
end

subgraph group_content["Post generation"]
  node_prompt["Post prompt<br/>[red_monday_bot.py]"]
  node_groq["Groq generation<br/>[red_monday_bot.py]"]
  node_groq_api["Groq API"]
end

subgraph group_delivery["Post delivery"]
  node_cli["CLI workflow<br/>[red_monday_bot.py]"]
  node_post_save["Generated post file"]
  node_linkedin_publish["LinkedIn publishing<br/>[red_monday_bot.py]"]
end

node_operator(("Operator"))
node_linkedin_api["LinkedIn API"]

node_operator -->|"runs"| node_cli
node_cli -->|"checks calendar"| node_calendar
node_calendar -->|"fetches page"| node_redm
node_calendar -->|"parses events"| node_event_parse
node_event_parse -->|"provides events"| node_event_select
node_cli -->|"requests post"| node_prompt
node_event_select -->|"supplies next event"| node_prompt
node_prompt -->|"builds messages"| node_groq
node_groq -->|"requests completion"| node_groq_api
node_groq -->|"saves generated text"| node_post_save
node_cli -->|"publishes unless dry-run"| node_linkedin_publish
node_linkedin_publish -->|"creates post"| node_linkedin_api

click node_cli "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py"
click node_calendar "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py"
click node_event_parse "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py"
click node_event_select "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py"
click node_prompt "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py"
click node_groq "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py"
click node_linkedin_publish "https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.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_calendar,node_redm,node_event_parse,node_event_select toneBlue
class node_prompt,node_groq,node_groq_api toneAmber
class node_cli,node_post_save,node_linkedin_publish,node_linkedin_api toneMint
class node_operator toneIndigo
```

## Components

### Event discovery

- [Houston calendar](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`
- **redM calendar site**
- [Event extraction](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`
- [Upcoming event selection](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`

### Post generation

- [Post prompt](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`
- [Groq generation](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`
- **Groq API**

### Post delivery

- [CLI workflow](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`
- **Generated post file**
- [LinkedIn publishing](https://github.com/estimateflake2/red-m-linkedin-post/blob/main/red_monday_bot.py): `red_monday_bot.py`

### Other components

- **Operator**
- **LinkedIn API**

## Connections

- Operator → CLI workflow: runs (evidence: `README.md`)
- CLI workflow → Houston calendar: checks calendar (evidence: `README.md`)
- Houston calendar → redM calendar site: fetches page (evidence: `red_monday_bot.py`)
- Houston calendar → Event extraction: parses events (evidence: `README.md`)
- Event extraction → Upcoming event selection: provides events (evidence: `README.md`)
- CLI workflow → Post prompt: requests post (evidence: `README.md`)
- Upcoming event selection → Post prompt: supplies next event (evidence: `README.md`)
- Post prompt → Groq generation: builds messages (evidence: `red_monday_bot.py`)
- Groq generation → Groq API: requests completion (evidence: `red_monday_bot.py`)
- Groq generation → Generated post file: saves generated text (evidence: `README.md`)
- CLI workflow → LinkedIn publishing: publishes unless dry-run (evidence: `README.md`)
- LinkedIn publishing → LinkedIn API: creates post (evidence: `red_monday_bot.py`)
