# suryanoyal/contentflow architecture

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

- Interactive diagram: https://gitdiagram.com/suryanoyal/contentflow
- Repository: https://github.com/suryanoyal/contentflow

## Overview

This is a multi-tenant content planning and social-platform scheduling application. Users register or sign in, manage content and platform rules, then plan or generate posting schedules and review calendar and usage insights. The graph separates the dashboard workflows, API routes, scheduling logic, and shared data/authentication layer. Several UI-to-API connections are inferred from the product flow rather than shown in sampled page source, so those links are dashed and unverified.

Main entry points: [`src/lib/prisma.ts`](https://github.com/suryanoyal/contentflow/blob/master/src/lib/prisma.ts) (Prisma client), [`src/app/api/content`](https://github.com/suryanoyal/contentflow/tree/master/src/app/api/content) (Content endpoints), [`src/app/api/schedules`](https://github.com/suryanoyal/contentflow/tree/master/src/app/api/schedules) (Schedule endpoints), [`src/app/(dashboard)/content`](https://github.com/suryanoyal/contentflow/tree/master/src/app/(dashboard)/content) (Content library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_auth_pages["Sign-in and registration"]
  node_dashboard_home["Overview dashboard<br/>[page.tsx]"]
  node_content_ui["Content library"]
  node_calendar_ui["Scheduling calendar<br/>[page.tsx]"]
  node_platform_ui["Platform settings<br/>[page.tsx]"]
  node_settings_ui["Workspace settings<br/>[page.tsx]"]
  node_ui_kit["UI primitives"]
end

subgraph group_api["Application API"]
  node_auth_api["Authentication API<br/>[route.ts]"]
  node_registration_api["Account registration<br/>[route.ts]"]
  node_content_api["Content endpoints"]
  node_dashboard_api["Dashboard metrics<br/>[route.ts]"]
  node_platform_api["Platform endpoints"]
  node_schedule_api["Schedule endpoints"]
  node_settings_api["Settings endpoints<br/>[route.ts]"]
  node_notifications_api["Notifications endpoint<br/>[route.ts]"]
end

subgraph group_planning["Planning domain"]
  node_scheduler["Schedule generation<br/>[scheduler.ts]"]
  node_content_ids["Content ID generation<br/>[content-id.ts]"]
end

subgraph group_foundation["Shared foundation"]
  node_validation["Request validation<br/>[validations.ts]"]
  node_auth["Session authentication<br/>[auth.ts]"]
  node_database_client["Prisma client<br/>[prisma.ts]"]
  node_database[("Application database")]
end

node_user(("Workspace user"))

node_user -.->|"signs in"| node_auth_pages
node_user -.->|"uses workspace"| node_dashboard_home
node_user -.->|"manages content"| node_content_ui
node_user -.->|"plans posts"| node_calendar_ui
node_user -.->|"configures platforms"| node_platform_ui
node_user -.->|"updates settings"| node_settings_ui
node_content_ui -->|"renders with"| node_ui_kit
node_calendar_ui -->|"renders with"| node_ui_kit
node_platform_ui -->|"renders with"| node_ui_kit
node_content_ui -.->|"requests content"| node_content_api
node_calendar_ui -.->|"requests schedules"| node_schedule_api
node_dashboard_home -.->|"requests metrics"| node_dashboard_api
node_platform_ui -.->|"requests platforms"| node_platform_api
node_settings_ui -.->|"requests settings"| node_settings_api
node_auth_pages -.->|"authenticates"| node_auth_api
node_registration_api -->|"validates registration"| node_validation
node_registration_api -->|"creates workspace"| node_database_client
node_content_api -->|"validates content"| node_validation
node_content_api -->|"generates identifier"| node_content_ids
node_content_api -->|"reads and writes"| node_database_client
node_dashboard_api -->|"queries metrics"| node_database_client
node_platform_api -->|"reads and writes"| node_database_client
node_schedule_api -->|"generates and validates"| node_scheduler
node_schedule_api -->|"reads and writes"| node_database_client
node_schedule_api -->|"checks session"| node_auth
node_settings_api -->|"validates settings"| node_validation
node_settings_api -->|"reads and updates"| node_database_client
node_notifications_api -->|"loads notifications"| node_database_client
node_auth -->|"loads user"| node_database_client
node_scheduler -->|"reads and updates plans"| node_database_client
node_database_client -.->|"accesses"| node_database

click node_auth_pages "https://github.com/suryanoyal/contentflow/tree/master/src/app/(auth)"
click node_dashboard_home "https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/page.tsx"
click node_content_ui "https://github.com/suryanoyal/contentflow/tree/master/src/app/(dashboard)/content"
click node_calendar_ui "https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/calendar/page.tsx"
click node_platform_ui "https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/platforms/page.tsx"
click node_settings_ui "https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/settings/page.tsx"
click node_ui_kit "https://github.com/suryanoyal/contentflow/tree/master/src/components/ui"
click node_auth_api "https://github.com/suryanoyal/contentflow/blob/master/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_registration_api "https://github.com/suryanoyal/contentflow/blob/master/src/app/api/register/route.ts"
click node_content_api "https://github.com/suryanoyal/contentflow/tree/master/src/app/api/content"
click node_dashboard_api "https://github.com/suryanoyal/contentflow/blob/master/src/app/api/dashboard/route.ts"
click node_platform_api "https://github.com/suryanoyal/contentflow/tree/master/src/app/api/platforms"
click node_schedule_api "https://github.com/suryanoyal/contentflow/tree/master/src/app/api/schedules"
click node_settings_api "https://github.com/suryanoyal/contentflow/blob/master/src/app/api/settings/route.ts"
click node_notifications_api "https://github.com/suryanoyal/contentflow/blob/master/src/app/api/notifications/route.ts"
click node_scheduler "https://github.com/suryanoyal/contentflow/blob/master/src/lib/scheduler.ts"
click node_content_ids "https://github.com/suryanoyal/contentflow/blob/master/src/lib/content-id.ts"
click node_validation "https://github.com/suryanoyal/contentflow/blob/master/src/lib/validations.ts"
click node_auth "https://github.com/suryanoyal/contentflow/blob/master/src/lib/auth.ts"
click node_database_client "https://github.com/suryanoyal/contentflow/blob/master/src/lib/prisma.ts"

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_auth_pages,node_dashboard_home,node_content_ui,node_calendar_ui,node_platform_ui,node_settings_ui,node_ui_kit,node_user toneBlue
class node_auth_api,node_registration_api,node_content_api,node_dashboard_api,node_platform_api,node_schedule_api,node_settings_api,node_notifications_api toneAmber
class node_scheduler,node_content_ids toneMint
class node_validation,node_auth,node_database_client,node_database toneRose
```

## Components

### User experience

- [Sign-in and registration](https://github.com/suryanoyal/contentflow/tree/master/src/app/(auth)): `src/app/(auth)`
- [Overview dashboard](https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/page.tsx): `src/app/(dashboard)/page.tsx`
- [Content library](https://github.com/suryanoyal/contentflow/tree/master/src/app/(dashboard)/content): `src/app/(dashboard)/content`
- [Scheduling calendar](https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/calendar/page.tsx): `src/app/(dashboard)/calendar/page.tsx`
- [Platform settings](https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/platforms/page.tsx): `src/app/(dashboard)/platforms/page.tsx`
- [Workspace settings](https://github.com/suryanoyal/contentflow/blob/master/src/app/(dashboard)/settings/page.tsx): `src/app/(dashboard)/settings/page.tsx`
- [UI primitives](https://github.com/suryanoyal/contentflow/tree/master/src/components/ui): `src/components/ui`

### Application API

- [Authentication API](https://github.com/suryanoyal/contentflow/blob/master/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- [Account registration](https://github.com/suryanoyal/contentflow/blob/master/src/app/api/register/route.ts): `src/app/api/register/route.ts`
- [Content endpoints](https://github.com/suryanoyal/contentflow/tree/master/src/app/api/content): `src/app/api/content`
- [Dashboard metrics](https://github.com/suryanoyal/contentflow/blob/master/src/app/api/dashboard/route.ts): `src/app/api/dashboard/route.ts`
- [Platform endpoints](https://github.com/suryanoyal/contentflow/tree/master/src/app/api/platforms): `src/app/api/platforms`
- [Schedule endpoints](https://github.com/suryanoyal/contentflow/tree/master/src/app/api/schedules): `src/app/api/schedules`
- [Settings endpoints](https://github.com/suryanoyal/contentflow/blob/master/src/app/api/settings/route.ts): `src/app/api/settings/route.ts`
- [Notifications endpoint](https://github.com/suryanoyal/contentflow/blob/master/src/app/api/notifications/route.ts): `src/app/api/notifications/route.ts`

### Planning domain

- [Schedule generation](https://github.com/suryanoyal/contentflow/blob/master/src/lib/scheduler.ts): `src/lib/scheduler.ts`
- [Content ID generation](https://github.com/suryanoyal/contentflow/blob/master/src/lib/content-id.ts): `src/lib/content-id.ts`

### Shared foundation

- [Request validation](https://github.com/suryanoyal/contentflow/blob/master/src/lib/validations.ts): `src/lib/validations.ts`
- [Session authentication](https://github.com/suryanoyal/contentflow/blob/master/src/lib/auth.ts): `src/lib/auth.ts`
- [Prisma client](https://github.com/suryanoyal/contentflow/blob/master/src/lib/prisma.ts): `src/lib/prisma.ts`
- **Application database**

### Other components

- **Workspace user**

## Connections

- Workspace user → Sign-in and registration: signs in
- Workspace user → Overview dashboard: uses workspace
- Workspace user → Content library: manages content
- Workspace user → Scheduling calendar: plans posts
- Workspace user → Platform settings: configures platforms
- Workspace user → Workspace settings: updates settings
- Content library → UI primitives: renders with (evidence: `src/app/(dashboard)/content/page.tsx`)
- Scheduling calendar → UI primitives: renders with (evidence: `src/app/(dashboard)/calendar/page.tsx`)
- Platform settings → UI primitives: renders with (evidence: `src/app/(dashboard)/platforms/page.tsx`)
- Content library → Content endpoints: requests content
- Scheduling calendar → Schedule endpoints: requests schedules
- Overview dashboard → Dashboard metrics: requests metrics
- Platform settings → Platform endpoints: requests platforms
- Workspace settings → Settings endpoints: requests settings
- Sign-in and registration → Authentication API: authenticates
- Account registration → Request validation: validates registration (evidence: `src/app/api/register/route.ts`)
- Account registration → Prisma client: creates workspace (evidence: `src/app/api/register/route.ts`)
- Content endpoints → Request validation: validates content (evidence: `src/app/api/content/route.ts`)
- Content endpoints → Content ID generation: generates identifier (evidence: `src/app/api/content/route.ts`)
- Content endpoints → Prisma client: reads and writes (evidence: `src/app/api/content/route.ts`)
- Dashboard metrics → Prisma client: queries metrics (evidence: `src/app/api/dashboard/route.ts`)
- Platform endpoints → Prisma client: reads and writes (evidence: `src/app/api/platforms/route.ts`)
- Schedule endpoints → Schedule generation: generates and validates (evidence: `src/app/api/schedules/generate/route.ts`)
- Schedule endpoints → Prisma client: reads and writes (evidence: `src/app/api/schedules/route.ts`)
- Schedule endpoints → Session authentication: checks session (evidence: `src/app/api/schedules/route.ts`)
- Settings endpoints → Request validation: validates settings (evidence: `src/app/api/settings/route.ts`)
- Settings endpoints → Prisma client: reads and updates (evidence: `src/app/api/settings/route.ts`)
- Notifications endpoint → Prisma client: loads notifications (evidence: `src/app/api/notifications/route.ts`)
- Session authentication → Prisma client: loads user (evidence: `src/lib/auth.ts`)
- Schedule generation → Prisma client: reads and updates plans (evidence: `src/lib/scheduler.ts`)
- Prisma client → Application database: accesses
