Skip to content

drftstatic/PRD_Generator

Repository files navigation

PRD Generator — Multi-Model Edition

Status: Polished portfolio project. Originally built late 2025, refreshed for May 2026 (current models, dependency hygiene). Functional locally; not deployed and not actively maintained — model IDs and SDK APIs will drift over time.

A Next.js app for generating Product Requirements Documents through a chat interface, with side-by-side comparison across Claude, GPT, Gemini, and Grok. Pick your favourite model's output, edit individual sections, export as Markdown or PDF.

Features

  • Conversational PRD generation — short clarifying-question chat, then one-shot PRD output
  • Multi-model comparison — fan out the same prompt to up to 4 models in parallel and pick the winner
  • Section-level editing — refine a single section without re-running the whole PRD
  • Multi-modal input — text plus image uploads (sketches, wireframes, screenshots)
  • Markdown + PDF export
  • Credit system + Stripe checkout — free daily session, paid packs (Beer Edition pricing)

Tech stack

  • Frontend: Next.js 15, React 19, Tailwind CSS 4
  • Backend: Next.js API routes
  • Database: SQLite via Prisma (zero-setup local demo — change provider in prisma/schema.prisma to postgresql for production)
  • Auth: NextAuth v5 (beta) with GitHub OAuth
  • AI providers: Anthropic, OpenAI, Google Gemini, xAI Grok
  • Payments: Stripe

Quick start

git clone https://github.com/drftstatic/PRD_Generator.git
cd PRD_Generator
npm install
cp .env.example .env       # then edit — see "Required env vars" below
npx prisma migrate dev --name init
npm run dev

Open http://localhost:3000.

Required env vars

The minimum to get a working chat + one-model generation:

  • NEXTAUTH_SECRETopenssl rand -base64 32
  • GITHUB_CLIENT_ID + GITHUB_CLIENT_SECRETregister an OAuth app with callback http://localhost:3000/api/auth/callback/github
  • One of: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_AI_API_KEY, XAI_API_KEY

Stripe keys are optional unless you want to test paid credit purchases. See .env.example for the full list.

Project structure

prisma/
  schema.prisma          # SQLite schema (User, PRDSession, PRD, Credit, etc.)
src/
  app/
    api/                 # auth, generate-prd, conversation, credits, checkout, webhooks, upload
    page.tsx             # chat UI
    prds/[sessionId]/    # PRD comparison + section editor
  components/            # PRDViewer, SectionEditor, ImageUpload
  hooks/                 # useCredits, usePRDGeneration
  lib/
    ai-providers.ts      # multi-provider orchestration
    prd-template.ts      # PRD structure + system prompt
    pdf-generator.ts     # Puppeteer-based PDF export
    auth.ts, prisma.ts
  config/
    models.json          # Model registry — edit here to add/remove models

Updating the model registry

All available models are listed in src/config/models.json. To add or swap a model, edit the JSON — no code changes required:

{
  "providers": {
    "anthropic": {
      "models": ["claude-opus-4-7", "claude-sonnet-4-6"],
      "display_names": ["Claude Opus 4.7", "Claude Sonnet 4.6"],
      "api_key_env": "ANTHROPIC_API_KEY"
    }
  }
}

The current registry was last verified May 2026. Provider model IDs drift quickly — check each provider's docs before deploying anything that depends on this code.

Pricing tiers (Beer Edition)

Tier Sessions Price Per session
On the House 1/day Free $0
Tall Boy 1 $2 $2.00
Sixer 6 $6 $1.00
Twelve Pack 12 $10 $0.83
Case 24 $18 $0.75

One session = up to 4 PRD generations across different models.

API routes

Route Purpose
POST /api/auth/[...nextauth] NextAuth
POST /api/conversation Clarifying-question chat
POST /api/generate-prd Multi-model PRD generation
GET/POST /api/credits Balance + claim daily free
POST /api/checkout Stripe checkout session
POST /api/webhooks/stripe Stripe event handler
POST /api/upload Image uploads
GET /api/sessions/[sessionId] Session state
POST /api/prds/[prdId]/regenerate-section Section-level edit

PRD template

Generated PRDs follow this structure:

  1. Product Name & Overview
  2. Problem Statement
  3. Target Users
  4. Goals & Success Metrics
  5. User Stories / Use Cases
  6. Functional Requirements
  7. Technical Considerations
  8. Out of Scope
  9. Open Questions / Risks

Notes for anyone forking this

  • This was built as an exploration of multi-model orchestration patterns and isn't actively maintained.
  • Model IDs in src/config/models.json and src/app/api/conversation/route.ts will go stale — verify against each provider's docs.
  • The Stripe integration is wired but has only been smoke-tested locally with the Stripe CLI.
  • puppeteer is a heavy dep (~170MB) and won't deploy to Vercel as-is — for serverless deploys, swap to @sparticuz/chromium or a hosted PDF service.
  • For production, change Prisma's provider from sqlite to postgresql and run a fresh migration.

License

MIT — see LICENSE.


Built with Claude Code.

About

Multi-model PRD generator (Claude / GPT / Gemini / Grok) with conversational chat, side-by-side comparison, and section-level editing. Next.js 15 + Prisma + NextAuth + Stripe.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages