# kushalaroraa/postflowai architecture

> Architecture diagram of the GitHub repository kushalaroraa/postflowai, 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/kushalaroraa/postflowai
- Repository: https://github.com/kushalaroraa/postflowai

## Overview

PostFlowAI takes a user from a topic and persona/style choices through AI-generated copy and timing advice, editing and image attachment, then saving, scheduling, tracking, or publishing a post. The React client uses the Express API; post data is modeled in MongoDB, and AI generation uses Gemini. The README also documents dashboard and calendar capabilities. Their page paths are present in the tree, but their implementation details were not sampled, so only their documented role is represented.

Main entry points: [`server/controllers/postController.js`](https://github.com/kushalaroraa/postflowai/blob/main/server/controllers/postController.js) (Post controller), [`client/src/App.jsx`](https://github.com/kushalaroraa/postflowai/blob/main/client/src/App.jsx) (Client router), [`server/routes/posts.js`](https://github.com/kushalaroraa/postflowai/blob/main/server/routes/posts.js) (Post routes), [`client/src/pages/GeneratePost.jsx`](https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/GeneratePost.jsx) (AI Studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Content workspace"]
  node_app["Client router<br/>[App.jsx]"]
  node_landing["Landing page<br/>[LandingPage.jsx]"]
  node_generate["AI Studio<br/>[GeneratePost.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_calendar["Calendar<br/>[CalendarView.jsx]"]
  node_postcard["Post card<br/>[PostCard.jsx]"]
end

subgraph group_api["Post API"]
  node_server["Express server<br/>[index.js]"]
  node_postroutes["Post routes<br/>[posts.js]"]
  node_uploadroute["Upload route<br/>[uploads.js]"]
  node_controller["Post controller<br/>[postController.js]"]
end

subgraph group_ai["AI generation"]
  node_executor["Post generator<br/>[executor.js]"]
  node_logger["AI call logger<br/>[logger.js]"]
end

subgraph group_data["Storage and publishing"]
  node_memory["Post memory<br/>[memory.js]"]
  node_postmodel["Post model<br/>[Post.js]"]
  node_mongodb[("MongoDB")]
  node_xintegration["X integration<br/>[x.js]"]
end

node_user(("User"))
node_x(("X platform"))
node_gemini(("Google Gemini"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_generate
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_calendar
node_dashboard -->|"renders posts"| node_postcard
node_calendar -->|"renders posts"| node_postcard
node_generate -->|"requests generation"| node_postroutes
node_generate -->|"uploads image"| node_uploadroute
node_generate -->|"updates schedule"| node_postroutes
node_postcard -->|"manages posts"| node_postroutes
node_server -->|"mounts routes"| node_postroutes
node_server -->|"mounts routes"| node_uploadroute
node_postroutes -->|"dispatches requests"| node_controller
node_controller -->|"generates content"| node_executor
node_executor -->|"requests generation"| node_gemini
node_executor -->|"logs call"| node_logger
node_controller -->|"logs generation"| node_logger
node_controller -->|"saves generated post"| node_memory
node_controller -->|"reads and updates"| node_postmodel
node_postmodel -->|"persists posts"| node_mongodb
node_controller -->|"publishes post"| node_xintegration
node_xintegration -.->|"simulates publishing"| node_x

click node_app "https://github.com/kushalaroraa/postflowai/blob/main/client/src/App.jsx"
click node_landing "https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/LandingPage.jsx"
click node_generate "https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/GeneratePost.jsx"
click node_dashboard "https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/Dashboard.jsx"
click node_calendar "https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/CalendarView.jsx"
click node_postcard "https://github.com/kushalaroraa/postflowai/blob/main/client/src/components/PostCard.jsx"
click node_server "https://github.com/kushalaroraa/postflowai/blob/main/server/index.js"
click node_postroutes "https://github.com/kushalaroraa/postflowai/blob/main/server/routes/posts.js"
click node_uploadroute "https://github.com/kushalaroraa/postflowai/blob/main/server/routes/uploads.js"
click node_controller "https://github.com/kushalaroraa/postflowai/blob/main/server/controllers/postController.js"
click node_executor "https://github.com/kushalaroraa/postflowai/blob/main/agent/executor.js"
click node_logger "https://github.com/kushalaroraa/postflowai/blob/main/agent/logger.js"
click node_memory "https://github.com/kushalaroraa/postflowai/blob/main/agent/memory.js"
click node_postmodel "https://github.com/kushalaroraa/postflowai/blob/main/server/models/Post.js"
click node_xintegration "https://github.com/kushalaroraa/postflowai/blob/main/server/integrations/x.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_app,node_landing,node_generate,node_dashboard,node_calendar,node_postcard,node_user toneBlue
class node_server,node_postroutes,node_uploadroute,node_controller toneAmber
class node_executor,node_logger toneMint
class node_memory,node_postmodel,node_mongodb,node_xintegration toneRose
class node_x,node_gemini toneIndigo
```

## Components

### Content workspace

- [Client router](https://github.com/kushalaroraa/postflowai/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Landing page](https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/LandingPage.jsx): `client/src/pages/LandingPage.jsx`
- [AI Studio](https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/GeneratePost.jsx): `client/src/pages/GeneratePost.jsx`
- [Dashboard](https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Calendar](https://github.com/kushalaroraa/postflowai/blob/main/client/src/pages/CalendarView.jsx): `client/src/pages/CalendarView.jsx`
- [Post card](https://github.com/kushalaroraa/postflowai/blob/main/client/src/components/PostCard.jsx): `client/src/components/PostCard.jsx`

### Post API

- [Express server](https://github.com/kushalaroraa/postflowai/blob/main/server/index.js): `server/index.js`
- [Post routes](https://github.com/kushalaroraa/postflowai/blob/main/server/routes/posts.js): `server/routes/posts.js`
- [Upload route](https://github.com/kushalaroraa/postflowai/blob/main/server/routes/uploads.js): `server/routes/uploads.js`
- [Post controller](https://github.com/kushalaroraa/postflowai/blob/main/server/controllers/postController.js): `server/controllers/postController.js`

### AI generation

- [Post generator](https://github.com/kushalaroraa/postflowai/blob/main/agent/executor.js): `agent/executor.js`
- [AI call logger](https://github.com/kushalaroraa/postflowai/blob/main/agent/logger.js): `agent/logger.js`

### Storage and publishing

- [Post memory](https://github.com/kushalaroraa/postflowai/blob/main/agent/memory.js): `agent/memory.js`
- [Post model](https://github.com/kushalaroraa/postflowai/blob/main/server/models/Post.js): `server/models/Post.js`
- **MongoDB**
- [X integration](https://github.com/kushalaroraa/postflowai/blob/main/server/integrations/x.js): `server/integrations/x.js`

### Other components

- **User**
- **X platform**
- **Google Gemini**

## Connections

- User → Client router: uses
- Client router → Landing page: routes to
- Client router → AI Studio: routes to
- Client router → Dashboard: routes to
- Client router → Calendar: routes to
- Dashboard → Post card: renders posts
- Calendar → Post card: renders posts
- AI Studio → Post routes: requests generation
- AI Studio → Upload route: uploads image
- AI Studio → Post routes: updates schedule
- Post card → Post routes: manages posts
- Express server → Post routes: mounts routes
- Express server → Upload route: mounts routes
- Post routes → Post controller: dispatches requests
- Post controller → Post generator: generates content
- Post generator → Google Gemini: requests generation
- Post generator → AI call logger: logs call
- Post controller → AI call logger: logs generation
- Post controller → Post memory: saves generated post
- Post controller → Post model: reads and updates
- Post model → MongoDB: persists posts
- Post controller → X integration: publishes post
- X integration → X platform: simulates publishing
