# superclerkhq/postclerk architecture

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

- Interactive diagram: https://gitdiagram.com/superclerkhq/postclerk
- Repository: https://github.com/superclerkhq/postclerk

## Overview

Postclerk is a social publishing workspace: users connect accounts, prepare network-specific posts with media and scheduling, then manage drafts, queued posts, calendar/feed views, and analytics. The browser UI calls the app’s Cloudflare Worker, which brokers authenticated requests to Superclerk; the README says the Worker stores no product data. The graph includes the documented MCP assistant capability. Several screens and Worker internals were not excerpted, so those subsystem links rely on README statements rather than claims of inspected implementation.

Main entry points: [`src/components/social/social-view.tsx`](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-view.tsx) (Publishing views), [`src/api/client.ts`](https://github.com/superclerkhq/postclerk/blob/main/src/api/client.ts) (Social API client), [`src/components/social/social-composer.tsx`](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-composer.tsx) (Post composer), [`worker/index.ts`](https://github.com/superclerkhq/postclerk/blob/main/worker/index.ts) (Cloudflare Worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Workspace entry"]
  node_workspace["Workspace shell<br/>[workspace.tsx]"]
end

subgraph group_publishing["Post publishing"]
  node_social_views["Publishing views<br/>[social-view.tsx]"]
  node_composer["Post composer"]
  node_platform_fields["Platform settings"]
  node_media_library["Media library<br/>[social-media.tsx]"]
  node_social_logic["Post rules and queries<br/>[social.ts]"]
end

subgraph group_accounts["Accounts and insights"]
  node_account_management["Social accounts"]
  node_analytics["Account and post analytics"]
  node_network_pages["Network destinations<br/>[social-pages.ts]"]
end

subgraph group_service["API and assistant service"]
  node_api_facade["Social API client<br/>[client.ts]"]
  node_api_types["Social API types<br/>[social.ts]"]
  node_worker["Cloudflare Worker<br/>[index.ts]"]
  node_superclerk{{"Superclerk API"}}
  node_assistant_page["AI assistants page"]
end

node_browser_user(("Workspace user"))
node_mcp_client(("MCP assistant client"))

node_browser_user -->|"opens workspace"| node_workspace
node_workspace -->|"shows views"| node_social_views
node_social_views -->|"opens editor"| node_composer
node_composer -->|"configures destinations"| node_platform_fields
node_composer -->|"selects media"| node_media_library
node_composer -->|"uses post rules"| node_social_logic
node_social_views -->|"renders account setup"| node_account_management
node_social_views -->|"shows analytics"| node_analytics
node_social_views -->|"shows feed preview"| node_media_library
node_account_management -->|"loads and changes accounts"| node_api_facade
node_composer -->|"creates and edits posts"| node_api_facade
node_media_library -->|"loads and uploads media"| node_api_facade
node_social_views -->|"loads post views"| node_api_facade
node_social_logic -->|"queries Superclerk"| node_api_facade
node_api_facade -->|"sends API requests"| node_worker
node_worker -->|"proxies authorized calls"| node_superclerk
node_browser_user -->|"signs in"| node_worker
node_workspace -->|"opens assistant setup"| node_assistant_page
node_mcp_client -->|"calls MCP endpoint"| node_worker
node_worker -->|"trades OAuth code"| node_superclerk
node_network_pages -.->|"uses network types"| node_api_types

click node_workspace "https://github.com/superclerkhq/postclerk/blob/main/src/workspace.tsx"
click node_social_views "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-view.tsx"
click node_composer "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-composer.tsx"
click node_platform_fields "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-platform-fields.tsx"
click node_media_library "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-media.tsx"
click node_social_logic "https://github.com/superclerkhq/postclerk/blob/main/src/lib/social.ts"
click node_account_management "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-accounts.tsx"
click node_analytics "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-analytics.tsx"
click node_network_pages "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-pages.ts"
click node_api_facade "https://github.com/superclerkhq/postclerk/blob/main/src/api/client.ts"
click node_api_types "https://github.com/superclerkhq/postclerk/blob/main/src/api/social.ts"
click node_worker "https://github.com/superclerkhq/postclerk/blob/main/worker/index.ts"
click node_assistant_page "https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-assistants.tsx"

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_workspace,node_browser_user,node_mcp_client toneBlue
class node_social_views,node_composer,node_platform_fields,node_media_library,node_social_logic toneAmber
class node_account_management,node_analytics,node_network_pages toneMint
class node_api_facade,node_api_types,node_worker,node_superclerk,node_assistant_page toneRose
```

## Components

### Workspace entry

- [Workspace shell](https://github.com/superclerkhq/postclerk/blob/main/src/workspace.tsx): `src/workspace.tsx`

### Post publishing

- [Publishing views](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-view.tsx): `src/components/social/social-view.tsx`
- [Post composer](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-composer.tsx): `src/components/social/social-composer.tsx`
- [Platform settings](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-platform-fields.tsx): `src/components/social/social-platform-fields.tsx`
- [Media library](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-media.tsx): `src/components/social/social-media.tsx`
- [Post rules and queries](https://github.com/superclerkhq/postclerk/blob/main/src/lib/social.ts): `src/lib/social.ts`

### Accounts and insights

- [Social accounts](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-accounts.tsx): `src/components/social/social-accounts.tsx`
- [Account and post analytics](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-analytics.tsx): `src/components/social/social-analytics.tsx`
- [Network destinations](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-pages.ts): `src/components/social/social-pages.ts`

### API and assistant service

- [Social API client](https://github.com/superclerkhq/postclerk/blob/main/src/api/client.ts): `src/api/client.ts`
- [Social API types](https://github.com/superclerkhq/postclerk/blob/main/src/api/social.ts): `src/api/social.ts`
- [Cloudflare Worker](https://github.com/superclerkhq/postclerk/blob/main/worker/index.ts): `worker/index.ts`
- **Superclerk API**
- [AI assistants page](https://github.com/superclerkhq/postclerk/blob/main/src/components/social/social-assistants.tsx): `src/components/social/social-assistants.tsx`

### Other components

- **Workspace user**
- **MCP assistant client**

## Connections

- Workspace user → Workspace shell: opens workspace (evidence: `README.md`)
- Workspace shell → Publishing views: shows views (evidence: `src/workspace.tsx`)
- Publishing views → Post composer: opens editor (evidence: `README.md`)
- Post composer → Platform settings: configures destinations (evidence: `src/components/social/social-composer.tsx`)
- Post composer → Media library: selects media (evidence: `src/components/social/social-composer.tsx`)
- Post composer → Post rules and queries: uses post rules (evidence: `src/components/social/social-composer.tsx`)
- Publishing views → Social accounts: renders account setup (evidence: `src/components/social/social-view.tsx`)
- Publishing views → Account and post analytics: shows analytics (evidence: `README.md`)
- Publishing views → Media library: shows feed preview (evidence: `src/components/social/social-view.tsx`)
- Social accounts → Social API client: loads and changes accounts (evidence: `src/components/social/social-accounts.tsx`)
- Post composer → Social API client: creates and edits posts (evidence: `src/components/social/social-composer.tsx`)
- Media library → Social API client: loads and uploads media (evidence: `src/components/social/social-media.tsx`)
- Publishing views → Social API client: loads post views (evidence: `src/components/social/social-view.tsx`)
- Post rules and queries → Social API client: queries Superclerk (evidence: `src/lib/social.ts`)
- Social API client → Cloudflare Worker: sends API requests (evidence: `README.md`)
- Cloudflare Worker → Superclerk API: proxies authorized calls (evidence: `README.md`)
- Workspace user → Cloudflare Worker: signs in (evidence: `README.md`)
- Workspace shell → AI assistants page: opens assistant setup (evidence: `src/workspace.tsx`)
- MCP assistant client → Cloudflare Worker: calls MCP endpoint (evidence: `README.md`)
- Cloudflare Worker → Superclerk API: trades OAuth code (evidence: `README.md`)
- Network destinations → Social API types: uses network types
