# soheylebrahimzadeh/linkedin-content-engine architecture

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

- Interactive diagram: https://gitdiagram.com/soheylebrahimzadeh/linkedin-content-engine
- Repository: https://github.com/soheylebrahimzadeh/linkedin-content-engine

## Overview

linkedin-content-engine is a privacy-first LinkedIn content workflow: an owner provides identity and verified stories, develops strategy and research, prepares and checks a post, decides on imagery, and explicitly approves it before publication. The CLI and scheduler support preparation; publishing can be owner-triggered or scheduled through the Cloudflare Worker. Results and readiness are surfaced through analytics and a read-only dashboard. The graph combines documented workflow links with source-index references; several unsampled capabilities are represented at their exact directories, and their internal call paths are not inferred.

Main entry points: [`src/lce/cli.py`](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/cli.py) (CLI workflow), [`src/lce/scheduler.py`](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/scheduler.py) (Preparation scheduler), [`src/lce/store.py`](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/store.py) (Private data files), [`src/lce/qa.py`](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/qa.py) (Content audit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Identity and authoring"]
  node_cli["CLI workflow<br/>[cli.py]"]
  node_identity["Identity interview<br/>[interview.py]"]
  node_brand["Brand strategy<br/>[brand.py]"]
  node_research["Research candidates<br/>[research.py]"]
  node_planning["Content planning<br/>[planning.py]"]
  node_posts["Post lifecycle<br/>[posts.py]"]
end

subgraph group_quality["Checks and approval"]
  node_privacy["Privacy safeguards"]
  node_qa["Content audit<br/>[qa.py]"]
  node_images["Image decision<br/>[images.py]"]
  node_approval["Human approval<br/>[approval.py]"]
end

subgraph group_operations["Scheduling and publishing"]
  node_scheduler["Preparation scheduler<br/>[scheduler.py]"]
  node_schedule["Cadence and slots<br/>[schedule.py]"]
  node_publishing["Provider publishing<br/>[publishing.py]"]
  node_linkedin["LinkedIn publisher<br/>[linkedin.py]"]
end

subgraph group_cloud["Cloud publishing"]
  node_cloud_api["Cloud API<br/>[api.ts]"]
  node_cloud_runner["Consent-based runner<br/>[runner.ts]"]
  node_cloud_db[("Cloud D1 state<br/>[db.ts]")]
  node_cloud_linkedin["Cloud LinkedIn<br/>[linkedin.ts]"]
end

subgraph group_insight["Results and visibility"]
  node_analytics["Performance learning<br/>[analytics.py]"]
  node_readiness["Workflow readiness<br/>[readiness.py]"]
  node_dashboard["Read-only dashboard"]
end

node_owner(("Content owner"))
node_linkedin_service(("LinkedIn API"))
node_private_store[("Private data files<br/>[store.py]")]

node_owner -->|"runs workflow"| node_cli
node_cli -->|"supports interview"| node_identity
node_cli -->|"invokes research"| node_research
node_cli -->|"invokes planning"| node_planning
node_cli -->|"invokes strategy"| node_brand
node_cli -->|"runs checks"| node_qa
node_cli -->|"records approval"| node_approval
node_cli -->|"runs automation"| node_scheduler
node_cli -->|"publishes approved"| node_publishing
node_identity -.->|"stores profile"| node_private_store
node_research -->|"stores candidates"| node_private_store
node_planning -.->|"selects topics"| node_posts
node_posts -->|"persists lifecycle"| node_private_store
node_privacy -->|"scans private data"| node_private_store
node_qa -->|"checks post"| node_posts
node_qa -->|"checks exposure"| node_privacy
node_approval -->|"updates state"| node_posts
node_approval -->|"binds image hash"| node_images
node_scheduler -->|"runs audit"| node_qa
node_scheduler -->|"handles approval"| node_approval
node_scheduler -->|"handles imagery"| node_images
node_scheduler -->|"loads cadence"| node_schedule
node_scheduler -->|"reads state"| node_private_store
node_publishing -.->|"dispatches provider"| node_linkedin
node_linkedin -->|"publishes post"| node_linkedin_service
node_cli -->|"invokes analytics"| node_analytics
node_cli -->|"checks readiness"| node_readiness
node_cli -->|"serves dashboard"| node_dashboard
node_analytics -->|"reads history"| node_private_store
node_dashboard -->|"reads snapshot"| node_private_store
node_owner -->|"manages consent"| node_cloud_api
node_cloud_api -->|"reads and writes"| node_cloud_db
node_cloud_api -.->|"registers routes"| node_cloud_runner
node_cloud_runner -->|"loads due consent"| node_cloud_db
node_cloud_runner -.->|"publishes due post"| node_cloud_linkedin
node_cloud_linkedin -.->|"publishes post"| node_linkedin_service

click node_cli "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/cli.py"
click node_identity "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/interview.py"
click node_brand "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/brand.py"
click node_research "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/research.py"
click node_planning "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/planning.py"
click node_posts "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/posts.py"
click node_privacy "https://github.com/soheylebrahimzadeh/linkedin-content-engine/tree/main/src/lce/privacy"
click node_qa "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/qa.py"
click node_images "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/images.py"
click node_approval "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/approval.py"
click node_scheduler "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/scheduler.py"
click node_schedule "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/schedule.py"
click node_publishing "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/publishing.py"
click node_linkedin "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/publish/linkedin.py"
click node_analytics "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/analytics.py"
click node_readiness "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/readiness.py"
click node_dashboard "https://github.com/soheylebrahimzadeh/linkedin-content-engine/tree/main/src/lce/dashboard"
click node_cloud_api "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/api.ts"
click node_cloud_runner "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/runner.ts"
click node_cloud_db "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/db.ts"
click node_cloud_linkedin "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/linkedin.ts"
click node_private_store "https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/store.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_cli,node_identity,node_brand,node_research,node_planning,node_posts toneBlue
class node_privacy,node_qa,node_images,node_approval,node_private_store toneAmber
class node_scheduler,node_schedule,node_publishing,node_linkedin,node_linkedin_service toneMint
class node_cloud_api,node_cloud_runner,node_cloud_db,node_cloud_linkedin toneRose
class node_analytics,node_readiness,node_dashboard,node_owner toneIndigo
```

## Components

### Identity and authoring

- [CLI workflow](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/cli.py): `src/lce/cli.py`
- [Identity interview](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/interview.py): `src/lce/interview.py`
- [Brand strategy](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/brand.py): `src/lce/brand.py`
- [Research candidates](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/research.py): `src/lce/research.py`
- [Content planning](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/planning.py): `src/lce/planning.py`
- [Post lifecycle](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/posts.py): `src/lce/posts.py`

### Checks and approval

- [Privacy safeguards](https://github.com/soheylebrahimzadeh/linkedin-content-engine/tree/main/src/lce/privacy): `src/lce/privacy`
- [Content audit](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/qa.py): `src/lce/qa.py`
- [Image decision](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/images.py): `src/lce/images.py`
- [Human approval](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/approval.py): `src/lce/approval.py`

### Scheduling and publishing

- [Preparation scheduler](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/scheduler.py): `src/lce/scheduler.py`
- [Cadence and slots](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/schedule.py): `src/lce/schedule.py`
- [Provider publishing](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/publishing.py): `src/lce/publishing.py`
- [LinkedIn publisher](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/publish/linkedin.py): `src/lce/publish/linkedin.py`

### Cloud publishing

- [Cloud API](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/api.ts): `cloud/src/api.ts`
- [Consent-based runner](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/runner.ts): `cloud/src/runner.ts`
- [Cloud D1 state](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/db.ts): `cloud/src/db.ts`
- [Cloud LinkedIn](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/cloud/src/linkedin.ts): `cloud/src/linkedin.ts`

### Results and visibility

- [Performance learning](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/analytics.py): `src/lce/analytics.py`
- [Workflow readiness](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/readiness.py): `src/lce/readiness.py`
- [Read-only dashboard](https://github.com/soheylebrahimzadeh/linkedin-content-engine/tree/main/src/lce/dashboard): `src/lce/dashboard`

### Other components

- **Content owner**
- **LinkedIn API**
- [Private data files](https://github.com/soheylebrahimzadeh/linkedin-content-engine/blob/main/src/lce/store.py): `src/lce/store.py`

## Connections

- Content owner → CLI workflow: runs workflow
- CLI workflow → Identity interview: supports interview (evidence: `src/lce/cli.py`)
- CLI workflow → Research candidates: invokes research (evidence: `src/lce/cli.py`)
- CLI workflow → Content planning: invokes planning (evidence: `src/lce/cli.py`)
- CLI workflow → Brand strategy: invokes strategy (evidence: `src/lce/cli.py`)
- CLI workflow → Content audit: runs checks (evidence: `src/lce/cli.py`)
- CLI workflow → Human approval: records approval (evidence: `src/lce/cli.py`)
- CLI workflow → Preparation scheduler: runs automation (evidence: `src/lce/cli.py`)
- CLI workflow → Provider publishing: publishes approved (evidence: `src/lce/cli.py`)
- Identity interview → Private data files: stores profile
- Research candidates → Private data files: stores candidates (evidence: `src/lce/research.py`)
- Content planning → Post lifecycle: selects topics
- Post lifecycle → Private data files: persists lifecycle (evidence: `src/lce/posts.py`)
- Privacy safeguards → Private data files: scans private data (evidence: `src/lce/privacy/scan.py`)
- Content audit → Post lifecycle: checks post (evidence: `src/lce/qa.py`)
- Content audit → Privacy safeguards: checks exposure (evidence: `src/lce/qa.py`)
- Human approval → Post lifecycle: updates state (evidence: `src/lce/approval.py`)
- Human approval → Image decision: binds image hash (evidence: `src/lce/approval.py`)
- Preparation scheduler → Content audit: runs audit (evidence: `src/lce/scheduler.py`)
- Preparation scheduler → Human approval: handles approval (evidence: `src/lce/scheduler.py`)
- Preparation scheduler → Image decision: handles imagery (evidence: `src/lce/scheduler.py`)
- Preparation scheduler → Cadence and slots: loads cadence (evidence: `src/lce/scheduler.py`)
- Preparation scheduler → Private data files: reads state (evidence: `src/lce/scheduler.py`)
- Provider publishing → LinkedIn publisher: dispatches provider
- LinkedIn publisher → LinkedIn API: publishes post (evidence: `src/lce/publish/linkedin.py`)
- CLI workflow → Performance learning: invokes analytics (evidence: `src/lce/cli.py`)
- CLI workflow → Workflow readiness: checks readiness (evidence: `src/lce/cli.py`)
- CLI workflow → Read-only dashboard: serves dashboard (evidence: `src/lce/cli.py`)
- Performance learning → Private data files: reads history (evidence: `src/lce/analytics.py`)
- Read-only dashboard → Private data files: reads snapshot (evidence: `src/lce/dashboard/server.py`)
- Content owner → Cloud API: manages consent
- Cloud API → Cloud D1 state: reads and writes (evidence: `cloud/src/api.ts`)
- Cloud API → Consent-based runner: registers routes (evidence: `cloud/src/api.ts`)
- Consent-based runner → Cloud D1 state: loads due consent (evidence: `cloud/src/runner.ts`)
- Consent-based runner → Cloud LinkedIn: publishes due post (evidence: `cloud/src/runner.ts`)
- Cloud LinkedIn → LinkedIn API: publishes post
