# strike-22/linkedin-ai-post-generator architecture

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

- Interactive diagram: https://gitdiagram.com/strike-22/linkedin-ai-post-generator
- Repository: https://github.com/strike-22/linkedin-ai-post-generator

## Overview

This product supports creating and publishing educational LinkedIn posts: users discover or generate a topic, configure a post, generate and edit its text, optionally create or upload an image, then publish immediately or schedule publishing. The backend also handles LinkedIn OAuth, profile lookup, and publish history. The README documents these capabilities, while excerpts confirm the principal API-to-service calls and scheduled worker behavior. The frontend excerpt is partial, so UI-to-route links beyond the visible calls are not asserted.

Main entry points: [`backend/server.js`](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/server.js) (HTTP routes), [`backend/services/scheduler.js`](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/scheduler.js) (Job scheduling and worker), [`app.js`](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/app.js) (Post editor), [`backend/services/geminiImageGenerator.js`](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/geminiImageGenerator.js) (Infographic generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Post creation UI"]
  node_frontend["Post editor<br/>[app.js]"]
  node_web["Static app shell<br/>[index.html]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP routes<br/>[server.js]"]
end

subgraph group_content["Content generation"]
  node_topics["Topic discovery<br/>[trendFetcher.js]"]
  node_postgen["Post and topic generation<br/>[postGenerator.js]"]
  node_imagegen["Infographic generation"]
  node_imagefiles[("Generated image files")]
end

subgraph group_publish["Publishing and schedule"]
  node_linkedin["LinkedIn OAuth and posts<br/>[linkedin.js]"]
  node_log[("Publish history<br/>[publishLog.js]")]
  node_scheduler["Job scheduling and worker<br/>[scheduler.js]"]
  node_redisconfig["Redis connection<br/>[redis.js]"]
end

node_user(("Creator"))
node_gemini{{"Google Gemini"}}
node_linkedinservice{{"LinkedIn"}}
node_redis[("Redis queue store")]

node_user -->|"creates posts"| node_frontend
node_web -->|"hosts interface"| node_frontend
node_frontend -->|"requests topics"| node_server
node_frontend -->|"schedules daily"| node_server
node_frontend -->|"publishes text"| node_server
node_server -->|"fetches topics"| node_topics
node_server -->|"generates topics and posts"| node_postgen
node_server -->|"generates infographics"| node_imagegen
node_postgen -->|"generates content"| node_gemini
node_imagegen -->|"generates images"| node_gemini
node_imagegen -->|"writes image files"| node_imagefiles
node_server -->|"handles OAuth and publishing"| node_linkedin
node_linkedin -->|"requests profile and posts"| node_linkedinservice
node_server -->|"records and reads history"| node_log
node_server -->|"manages schedules"| node_scheduler
node_scheduler -->|"uses connection"| node_redisconfig
node_redisconfig -->|"connects to"| node_redis
node_scheduler -->|"generates scheduled posts"| node_postgen
node_scheduler -->|"publishes scheduled posts"| node_linkedin
node_scheduler -->|"records outcomes"| node_log

click node_frontend "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/app.js"
click node_web "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/index.html"
click node_server "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/server.js"
click node_topics "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/trendFetcher.js"
click node_postgen "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/postGenerator.js"
click node_imagegen "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/geminiImageGenerator.js"
click node_linkedin "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/linkedin.js"
click node_log "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/publishLog.js"
click node_scheduler "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/scheduler.js"
click node_redisconfig "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/config/redis.js"
click node_imagefiles "https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/geminiImageGenerator.js"

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_frontend,node_web toneBlue
class node_server,node_redis toneAmber
class node_topics,node_postgen,node_imagegen,node_imagefiles toneMint
class node_linkedin,node_log,node_scheduler,node_redisconfig toneRose
class node_user,node_gemini,node_linkedinservice toneIndigo
```

## Components

### Post creation UI

- [Post editor](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/app.js): `app.js`
- [Static app shell](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/index.html): `index.html`

### Backend API

- [HTTP routes](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/server.js): `backend/server.js`

### Content generation

- [Topic discovery](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/trendFetcher.js): `backend/services/trendFetcher.js`
- [Post and topic generation](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/postGenerator.js): `backend/services/postGenerator.js`
- [Infographic generation](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/geminiImageGenerator.js): `backend/services/geminiImageGenerator.js`
- [Generated image files](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/geminiImageGenerator.js): `backend/services/geminiImageGenerator.js`

### Publishing and schedule

- [LinkedIn OAuth and posts](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/linkedin.js): `backend/services/linkedin.js`
- [Publish history](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/publishLog.js): `backend/services/publishLog.js`
- [Job scheduling and worker](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/services/scheduler.js): `backend/services/scheduler.js`
- [Redis connection](https://github.com/strike-22/linkedin-ai-post-generator/blob/main/backend/config/redis.js): `backend/config/redis.js`

### Other components

- **Creator**
- **Google Gemini**
- **LinkedIn**
- **Redis queue store**

## Connections

- Creator → Post editor: creates posts (evidence: `README.md`)
- Static app shell → Post editor: hosts interface (evidence: `README.md`)
- Post editor → HTTP routes: requests topics (evidence: `app.js`)
- Post editor → HTTP routes: schedules daily (evidence: `app.js`)
- Post editor → HTTP routes: publishes text (evidence: `app.js`)
- HTTP routes → Topic discovery: fetches topics (evidence: `backend/server.js`)
- HTTP routes → Post and topic generation: generates topics and posts (evidence: `backend/server.js`)
- HTTP routes → Infographic generation: generates infographics (evidence: `backend/server.js`)
- Post and topic generation → Google Gemini: generates content (evidence: `backend/services/postGenerator.js`)
- Infographic generation → Google Gemini: generates images (evidence: `backend/services/geminiImageGenerator.js`)
- Infographic generation → Generated image files: writes image files (evidence: `backend/services/geminiImageGenerator.js`)
- HTTP routes → LinkedIn OAuth and posts: handles OAuth and publishing (evidence: `backend/server.js`)
- LinkedIn OAuth and posts → LinkedIn: requests profile and posts (evidence: `backend/services/linkedin.js`)
- HTTP routes → Publish history: records and reads history (evidence: `backend/server.js`)
- HTTP routes → Job scheduling and worker: manages schedules (evidence: `backend/server.js`)
- Job scheduling and worker → Redis connection: uses connection (evidence: `backend/services/scheduler.js`)
- Redis connection → Redis queue store: connects to (evidence: `backend/config/redis.js`)
- Job scheduling and worker → Post and topic generation: generates scheduled posts (evidence: `backend/services/scheduler.js`)
- Job scheduling and worker → LinkedIn OAuth and posts: publishes scheduled posts (evidence: `backend/services/scheduler.js`)
- Job scheduling and worker → Publish history: records outcomes (evidence: `backend/services/scheduler.js`)
