AI Marketing Platform — Content Creation for Pharma
October 1, 2025
The Problem
Pharma marketing teams need visual content constantly — product imagery, campaign materials, training decks, social media assets — but they operate under strict regulatory constraints. Generic AI image tools don't understand pharma guardrails, and the approval process for every piece of content is slow and manual.A leading pharmaceutical company needed a platform where their marketing team could generate, review, and approve content in one place, with brand consistency and compliance built in.
What I Built
A Next.js 16 application that serves as a complete AI content creation suite: image generation with 100+ models, video production, audio (music and TTS), slide deck creation, and a full approval workflow — all with pharma-specific guardrails and brand presets baked in.
Image Studio
The core of the platform. A multi-slot generation system where users can compare outputs from up to 3 models simultaneously on the same prompt. Post-generation editing includes inpainting, upscaling, and face-swap. Brand style presets ensure visual consistency across campaigns.The model browser exposes 100+ image generation models via fal.ai, organized by speed, quality, and generation type — with cost estimates shown before every generation.
Slide Deck Studio
An AI chat interface where users describe what they need, and the agent generates complete slide decks — either as visual PNG slides or as editable PPTX files. Uses Vercel AI SDK with tool calling: setup_presentation, add_slide, export_pptx. PDF upload for context injection so the AI can build on existing materials.
Approval Workflow
Every generated asset can be submitted for review. Approvers see a queue, can approve or reject with comments, and the status flows back to the creator. This was essential for pharma — nothing goes to market without sign-off.
Campaign Management
Assets are organized into campaigns with galleries, collections, and sharing. Public share links let stakeholders review content without needing platform access.
PPTX: PptxGenJS v4 — server-side slide generation with 4 masters and 9 text layouts
Testing: Vitest v4, Testing Library, fast-check — 35 test files
Architecture Decisions
Async job queue over synchronous generation: Image generation can take 10-60 seconds. A synchronous API would timeout. Instead, jobs are submitted to fal.ai's queue, stored in Postgres, and polled every 2 seconds. On completion, the result is uploaded to Vercel Blob for permanent storage.Plan-based feature gating: Not every user needs every feature. Starter gets the basics (image studio, gallery), Professional adds campaigns and advanced studios, Enterprise unlocks everything. Features are stored in the database and configurable via admin UI — no code changes needed.Pharma guardrails as configuration: Rather than hardcoding compliance rules, guardrails are stored in the database and configurable per organization. This means the platform can adapt to different regulatory environments without redeployment.60+ API routes: The platform is API-heavy by design — every operation is a discrete endpoint. This made it easy to add rate limiting, feature checks, and audit logging consistently across the board.