Skip to content

AaronKurian/ContentStudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContentStudio

AI-powered multi-agent content platform.
Turn any source - URL, document, or raw text - into fact-checked, platform-native marketing campaigns in minutes.

Get Started · Architecture · Configuration · Deployment · Contributing


React Vite Tailwind CSS Node.js Express MongoDB Socket.IO OpenAI Gemini AI


ContentStudio Banner

What is ContentStudio?

ContentStudio is a source-grounded AI campaign platform built around a three-agent pipeline - Research, Copywriter, and Editor - that collaborate in real time to produce verified, platform-native content across eight channels.

Unlike generic AI writing tools, every asset ContentStudio generates is anchored to source material you provide. The Research agent extracts structured facts. The Copywriter adapts them per platform. The Editor enforces factual accuracy and rejects invented claims before anything reaches your approval queue.

The result is a deterministic, auditable content workflow - not a black box.


Features

  • Multi-source ingestion - paste text, submit a public URL, or upload PDF, DOCX, TXT, CSV, and Markdown files
  • Structured fact extraction - Research agent produces an editable fact sheet before generation begins
  • Human-in-the-loop control - review and edit facts and brand settings before the Copywriter runs
  • Eight-platform campaign generation - Blog, LinkedIn, X/Twitter, Threads, Instagram, Facebook, Reddit, and Email
  • Deterministic editorial review - Editor agent rejects unsupported pricing claims, invented facts, and weak platform fit
  • Live agent room - real-time workflow streaming via Socket.IO so you see every agent action as it happens
  • Platform-native previews - see exactly how each asset renders before approval
  • Per-asset controls - edit, approve, regenerate, copy, or export individual assets
  • ZIP export - download the full campaign as a structured archive
  • Secure multi-session auth - JWT access tokens with refresh-token rotation and bcrypt password hashing
  • Provider-agnostic AI - swap between OpenAI, OpenRouter, Fireworks, Gemini, or a mock provider via environment variable

Agent Pipeline

Source intake (text · URL · document)
        │
        ▼
  Research Agent
  └─ Extracts: product facts, audience, claims, ambiguities, brand settings
        │
        ▼
  Human review & edit
  └─ Fact sheet and brand settings editable before generation
        │
        ▼
  Copywriter Agent
  └─ Generates platform-specific assets for all selected channels
        │
        ▼
  Editor Agent
  └─ Rejects: unsupported pricing, invented claims, weak platform fit
        │
        ▼
  Review & Approval
  └─ Platform previews · per-asset edit/regenerate/approve · ZIP export

Tech Stack

Layer Technology
Frontend React 18, Vite, React Router, Tailwind CSS v4, Framer Motion, Lucide React
Backend Node.js, Express, Mongoose, Socket.IO, Helmet, Zod
Database MongoDB
AI providers Mock · OpenAI-compatible · OpenRouter · Fireworks · Gemini
Document parsing Local TXT / Markdown / CSV / PDF / DOCX, optional Unstructured API
Web extraction Cheerio (default), optional Firecrawl
Auth JWT access tokens · refresh-token rotation · bcrypt

Getting Started

Prerequisites

  • Node.js 20+
  • MongoDB (local or Atlas connection string)
  • An API key for your AI provider of choice (optional - mock provider works out of the box)

Installation

git clone https://github.com/AaronKurian/ContentStudio.git
cd ContentStudio

npm --prefix backend install
npm --prefix frontend install

Environment Setup

cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env

Backend (backend/.env):

PORT=4000
MONGODB_URI=mongodb://localhost:27017/contentstudio

# AI provider - mock | openai | openrouter | fireworks | gemini
AI_PROVIDER=mock
AI_MODEL=mock-free

# Auth
JWT_SECRET=change-me-in-production
REFRESH_TOKEN_SECRET=change-me-in-production

# CORS
CLIENT_ORIGINS=http://localhost:5173

Frontend (frontend/.env):

VITE_API_URL=http://localhost:4000/api
VITE_SOCKET_URL=http://localhost:4000

Run

# Terminal 1 - backend
npm --prefix backend run dev

# Terminal 2 - frontend
npm --prefix frontend run dev
Service URL
Frontend http://localhost:5173
Backend API http://localhost:4000/api
Health check http://localhost:4000/health

Configuration

AI Providers

Set AI_PROVIDER to one of mock, openai, openrouter, fireworks, or gemini.

Use AI_MODEL to force a model globally, or set provider-specific overrides:

OPENAI_MODEL=
OPENROUTER_MODEL=
FIREWORKS_MODEL=
GEMINI_MODEL=

ContentStudio fails clearly on provider errors - it never silently falls back to another provider.

Document Parsing

Local parsing supports TXT, Markdown, CSV, PDF, and DOCX out of the box.

For richer formats, enable Unstructured:

UNSTRUCTURED_ENABLED=true
UNSTRUCTURED_API_KEY=
UNSTRUCTURED_API_URL=https://api.unstructuredapp.io/general/v0/general
UNSTRUCTURED_STRATEGY=hi_res
UNSTRUCTURED_FALLBACK_STRATEGY=fast
UNSTRUCTURED_TIMEOUT_MS=600000

Uploaded files are discarded after parsing. Only extracted text and metadata are persisted.

Web Extraction

Direct fetch with Cheerio is enabled by default. For JavaScript-rendered pages, enable Firecrawl:

FIRECRAWL_ENABLED=true
FIRECRAWL_API_KEY=
FIRECRAWL_MAX_PAGES=3

Architecture

frontend/
  ├── authenticated API client
  ├── campaign workspace (review, edit, approve)
  └── live Socket.IO event stream

backend/
  ├── routes → controllers
  ├── campaignWorkflowService       # orchestration
  ├── sourceService                 # ingestion + parsing
  ├── documentParsing provider      # local + Unstructured
  ├── webExtraction provider        # Cheerio + Firecrawl
  ├── Research / Copywriter / Editor agents
  ├── AI provider abstraction       # swap providers via env
  └── MongoDB models

Key boundaries:

Concern Location
AI provider selection backend/src/services/ai
Document parsing backend/src/services/documentParsing
Web extraction backend/src/services/webExtraction
Campaign orchestration backend/src/services/campaignWorkflowService.js
Campaign review UI frontend/src/features/campaign
Design tokens frontend/src/index.css (Tailwind v4 @theme)

Project Structure

ContentStudio/
├── backend/
│   └── src/
│       ├── agents/          # Research, Copywriter, Editor agent logic
│       ├── controllers/     # HTTP request handlers
│       ├── models/          # MongoDB schemas
│       ├── routes/          # Express route definitions
│       ├── services/        # Business logic and provider abstractions
│       └── socket/          # Socket.IO campaign event emitters
│
└── frontend/
    ├── public/              # Static assets, favicons, open-graph
    └── src/
        ├── components/      # Shared UI and layout
        ├── features/        # Campaign workspace and platform previews
        ├── pages/           # Route-level screens
        └── store/           # Auth context and session management

Deployment

Build

npm --prefix frontend run build
npm --prefix backend start

Contributing

Contributions, bug reports, and feature requests are welcome.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/your-feature
  3. Commit your changes: git commit -m 'feat: add your feature'
  4. Push to the branch: git push origin feat/your-feature
  5. Open a Pull Request

Please keep PRs focused. Large changes are easier to review when split into smaller, logical commits.


License

ContentStudio is released under the MIT License.


Built with ❤️ by Aaron Kurian Abraham

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors