# akshitahuja/social_post architecture

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

- Interactive diagram: https://gitdiagram.com/akshitahuja/social_post
- Repository: https://github.com/akshitahuja/social_post

## Overview

SocialMedia Content Studio is a local, human-reviewed workflow for turning an idea into researched LinkedIn content and an infographic, then publishing only after separate approval and confirmation. The web app accepts ideas and review actions; the pipeline clarifies ambiguity, researches evidence, drafts the post, designs and renders the graphic, and persists each revision. Optional LinkedIn OAuth and publishing are separate from generation. The map follows the README and sampled wiring; some route and workflow implementation was omitted, so uncertain links are not shown.

Main entry points: [`src/social_post/workflow.py`](https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py) (Pipeline engine), [`src/social_post/app.py`](https://github.com/akshitahuja/social_post/blob/main/src/social_post/app.py) (FastAPI app), [`src/social_post/linkedin.py`](https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.py) (LinkedIn client), [`src/social_post/agents.py`](https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py) (Evidence research)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web review"]
  node_app["FastAPI app<br/>[app.py]"]
  node_views["Review templates"]
end

subgraph group_pipeline["Content pipeline"]
  node_engine["Pipeline engine<br/>[workflow.py]"]
  node_clarify["Topic clarification<br/>[agents.py]"]
  node_research["Evidence research<br/>[agents.py]"]
  node_draft["Post drafting<br/>[agents.py]"]
  node_visual["Visual design<br/>[agents.py]"]
  node_renderer["Infographic renderer<br/>[renderer.py]"]
  node_revision["Targeted revision<br/>[workflow.py]"]
end

subgraph group_state["Workflow state"]
  node_models["Domain schemas<br/>[models.py]"]
  node_repository[("Workflow repository<br/>[storage.py]")]
  node_checkpoints[("Flow checkpoints<br/>[workflow.py]")]
  node_images["Rendered PNGs<br/>[config.py]"]
end

subgraph group_publish["LinkedIn publishing"]
  node_publisher["Publishing service<br/>[linkedin.py]"]
  node_linkedin["LinkedIn client<br/>[linkedin.py]"]
  node_tokens[("OAuth token store<br/>[linkedin.py]")]
end

subgraph group_integrations["AI integrations"]
  node_groq["Groq LLM"]
  node_serper["Serper search"]
  node_linkedin_service["LinkedIn API"]
end

node_user(("Content creator"))

node_user -->|"submits and reviews"| node_app
node_app -->|"renders pages"| node_views
node_app -->|"starts and reviews"| node_engine
node_app -->|"reads workflow"| node_repository
node_app -->|"confirms publish"| node_publisher
node_app -->|"handles OAuth"| node_linkedin
node_engine -->|"loads and saves"| node_repository
node_engine -->|"requests interpretation"| node_clarify
node_engine -->|"requests research"| node_research
node_engine -->|"requests post"| node_draft
node_engine -->|"requests visual brief"| node_visual
node_engine -->|"renders brief"| node_renderer
node_engine -->|"runs revisions"| node_revision
node_engine -->|"persists flow"| node_checkpoints
node_renderer -->|"writes PNG"| node_images
node_clarify -->|"calls LLM"| node_groq
node_research -->|"searches evidence"| node_serper
node_research -->|"synthesizes research"| node_groq
node_draft -->|"generates post"| node_groq
node_visual -->|"designs brief"| node_groq
node_publisher -->|"loads and records"| node_repository
node_publisher -->|"publishes approved post"| node_linkedin
node_linkedin -->|"loads and saves tokens"| node_tokens
node_linkedin -->|"exchanges and publishes"| node_linkedin_service

click node_app "https://github.com/akshitahuja/social_post/blob/main/src/social_post/app.py"
click node_views "https://github.com/akshitahuja/social_post/tree/main/src/social_post/templates"
click node_engine "https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py"
click node_clarify "https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py"
click node_research "https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py"
click node_draft "https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py"
click node_visual "https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py"
click node_renderer "https://github.com/akshitahuja/social_post/blob/main/src/social_post/renderer.py"
click node_revision "https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py"
click node_models "https://github.com/akshitahuja/social_post/blob/main/src/social_post/models.py"
click node_repository "https://github.com/akshitahuja/social_post/blob/main/src/social_post/storage.py"
click node_checkpoints "https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py"
click node_images "https://github.com/akshitahuja/social_post/blob/main/src/social_post/config.py"
click node_publisher "https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.py"
click node_linkedin "https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.py"
click node_tokens "https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.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_app,node_views toneBlue
class node_engine,node_clarify,node_research,node_draft,node_visual,node_renderer,node_revision toneAmber
class node_models,node_repository,node_checkpoints,node_images toneMint
class node_publisher,node_linkedin,node_tokens toneRose
class node_groq,node_serper,node_linkedin_service,node_user toneIndigo
```

## Components

### Web review

- [FastAPI app](https://github.com/akshitahuja/social_post/blob/main/src/social_post/app.py): `src/social_post/app.py`
- [Review templates](https://github.com/akshitahuja/social_post/tree/main/src/social_post/templates): `src/social_post/templates`

### Content pipeline

- [Pipeline engine](https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py): `src/social_post/workflow.py`
- [Topic clarification](https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py): `src/social_post/agents.py`
- [Evidence research](https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py): `src/social_post/agents.py`
- [Post drafting](https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py): `src/social_post/agents.py`
- [Visual design](https://github.com/akshitahuja/social_post/blob/main/src/social_post/agents.py): `src/social_post/agents.py`
- [Infographic renderer](https://github.com/akshitahuja/social_post/blob/main/src/social_post/renderer.py): `src/social_post/renderer.py`
- [Targeted revision](https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py): `src/social_post/workflow.py`

### Workflow state

- [Domain schemas](https://github.com/akshitahuja/social_post/blob/main/src/social_post/models.py): `src/social_post/models.py`
- [Workflow repository](https://github.com/akshitahuja/social_post/blob/main/src/social_post/storage.py): `src/social_post/storage.py`
- [Flow checkpoints](https://github.com/akshitahuja/social_post/blob/main/src/social_post/workflow.py): `src/social_post/workflow.py`
- [Rendered PNGs](https://github.com/akshitahuja/social_post/blob/main/src/social_post/config.py): `src/social_post/config.py`

### LinkedIn publishing

- [Publishing service](https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.py): `src/social_post/linkedin.py`
- [LinkedIn client](https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.py): `src/social_post/linkedin.py`
- [OAuth token store](https://github.com/akshitahuja/social_post/blob/main/src/social_post/linkedin.py): `src/social_post/linkedin.py`

### AI integrations

- **Groq LLM**
- **Serper search**
- **LinkedIn API**

### Other components

- **Content creator**

## Connections

- Content creator → FastAPI app: submits and reviews
- FastAPI app → Review templates: renders pages
- FastAPI app → Pipeline engine: starts and reviews
- FastAPI app → Workflow repository: reads workflow
- FastAPI app → Publishing service: confirms publish
- FastAPI app → LinkedIn client: handles OAuth
- Pipeline engine → Workflow repository: loads and saves
- Pipeline engine → Topic clarification: requests interpretation
- Pipeline engine → Evidence research: requests research
- Pipeline engine → Post drafting: requests post
- Pipeline engine → Visual design: requests visual brief
- Pipeline engine → Infographic renderer: renders brief
- Pipeline engine → Targeted revision: runs revisions
- Pipeline engine → Flow checkpoints: persists flow
- Infographic renderer → Rendered PNGs: writes PNG
- Topic clarification → Groq LLM: calls LLM
- Evidence research → Serper search: searches evidence
- Evidence research → Groq LLM: synthesizes research
- Post drafting → Groq LLM: generates post
- Visual design → Groq LLM: designs brief
- Publishing service → Workflow repository: loads and records
- Publishing service → LinkedIn client: publishes approved post
- LinkedIn client → OAuth token store: loads and saves tokens
- LinkedIn client → LinkedIn API: exchanges and publishes
