Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ AI-Powered PRD Builder

AI PRD is a comprehensive Product Requirements Document (PRD) management platform that combines AI-assisted content generation with stakeholder collaboration, feature prioritization, and seamless integration with popular project management tools.

TypeScript React Node.js MongoDB


πŸ“‹ Table of Contents


🎯 Overview

AI PRD is designed for product managers and teams who need to create, manage, and collaborate on Product Requirements Documents efficiently. The platform leverages Google's Gemini AI to assist in:

  • πŸ€– AI-Assisted Writing: Generate user stories, acceptance criteria, and requirements
  • πŸ“Š RICE Prioritization: Systematic feature prioritization using Reach, Impact, Confidence, and Effort metrics
  • πŸ‘₯ Stakeholder Management: Collect feedback, track reviews, and manage alignment
  • πŸ”„ Version Control: Snapshot system with full state versioning and burndown tracking
  • πŸ”— Integrations: Sync with Linear, Jira, and Notion
  • πŸ“€ Export Options: PDF, HTML, and JSON exports with shareable links
  • 🌐 Internationalization: Multi-language support (English, Spanish)

✨ Key Features

Frontend Features

Feature Description
PRD Builder Step-by-step editor with AI assistance and template selection
Command Palette Cmd/Ctrl+K global shortcuts for quick navigation and actions
Feature Prioritization RICE scoring matrix for data-driven decision making
Stakeholder Input Structured feedback collection and review tracking
AI Assistant Panel Real-time suggestions for user stories, requirements, and gap detection
Snapshot History Version control with timestamps and restore capabilities
Survey Intake Collect structured feedback from stakeholders and users
Theme Support Light/dark mode with persistence
Offline Support PWA with local-first data storage
Telemetry Optional Sentry integration for error tracking and analytics
Smart Caching AI response caching (1 min TTL) for instant suggestions
Secret Detection Warns before committing sensitive data
Accessibility ARIA labels, keyboard navigation, screen reader support

Backend Features

Feature Description
PRD Management Full CRUD operations for PRDs with validation
Snapshot System Compressed version history with gzip support
Linear Integration Create and sync issues to Linear
Jira Integration Create and sync issues to Jira
Notion Export Convert PRDs to Notion pages with markdown support
Custom Templates Create and manage reusable PRD templates
Job Queue Async processing for long-running sync operations
Data Security Server-side redaction of sensitive information
Rate Limiting Protection against API abuse
Health Checks System health monitoring endpoint

πŸ›  Tech Stack

Frontend

Core:

  • βš›οΈ React 18.3.1 with TypeScript
  • ⚑ Vite 7.1.4 - Modern build tool with HMR
  • 🎨 Tailwind CSS 3.4.17 - Utility-first styling
  • πŸ—Ί React Router 6.27.0 - Client-side routing
  • 🐻 Zustand 5.0.8 - Lightweight state management

AI & Services:

  • πŸ€– Google Generative AI - Gemini API integration
  • πŸ” Clerk - Authentication and user management
  • πŸ“Š Sentry - Error tracking and telemetry
  • πŸ“„ jsPDF - PDF export functionality

Development:

  • πŸ§ͺ Vitest - Unit testing
  • 🧹 ESLint + Prettier - Code quality and formatting
  • βœ… Zod - Schema validation

Backend

Core:

  • 🟒 Node.js with TypeScript
  • πŸš‚ Express.js 4.19.2 - REST API framework
  • πŸƒ MongoDB + Mongoose 8.6.0 - Database and ODM

Integrations:

  • πŸ“‹ Notion API - Export to Notion pages
  • 🎯 Linear API - GraphQL-based issue tracking
  • πŸ“Œ Jira API - REST-based issue tracking

Development:

  • ⚑ tsx - TypeScript execution with hot reload
  • βœ… Zod - Runtime schema validation
  • 🌐 CORS - Cross-origin resource sharing

πŸš€ Getting Started

Prerequisites

  • Node.js >= 18.x
  • npm >= 9.x
  • MongoDB >= 6.x (local or cloud instance)
  • Google Gemini API Key (for AI features)
  • Optional: Linear, Jira, and Notion API keys (for integrations)

Installation

  1. Clone the repository:

    git clone https://github.com/devagarwal07/AIPRD.git
    cd AIPRD
  2. Install Frontend Dependencies:

    cd Frontend
    npm install
  3. Install Backend Dependencies:

    cd ../server
    npm install

Configuration

Frontend Configuration

Create a .env file in the Frontend directory:

# Required: Google Gemini API
VITE_GEMINI_API_KEY=your_gemini_api_key_here
VITE_GEMINI_MODEL=gemini-1.5-flash

# Optional: Backend API URL
VITE_API_BASE=http://localhost:4000

# Optional: Authentication (Clerk)
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_key_here

# Optional: Error Tracking (Sentry)
VITE_SENTRY_DSN=your_sentry_dsn_here

Getting API Keys:

Backend Configuration

Create a .env file in the server directory:

# Required: Database
MONGODB_URI=mongodb://localhost:27017/pmcopilot
PORT=4000

# Optional: Linear Integration
LINEAR_API_KEY=your_linear_api_key

# Optional: Jira Integration
JIRA_BASE_URL=https://your-domain.atlassian.net
JIRA_EMAIL=your_email@example.com
JIRA_API_TOKEN=your_jira_token

# Optional: Notion Integration
NOTION_API_KEY=your_notion_integration_token
NOTION_PARENT_PAGE=your_parent_page_id
NOTION_PARENT_DB=your_parent_database_id

Getting Integration Keys:

  • Linear API: Settings β†’ API β†’ Personal API Keys
  • Jira API: Account Settings β†’ Security β†’ API Tokens
  • Notion API: Create an integration

πŸ’» Usage

Development Mode

Option 1: Run Frontend and Backend Separately

Terminal 1 (Backend):

cd server
npm run dev
# Server starts on http://localhost:4000

Terminal 2 (Frontend):

cd Frontend
npm run dev
# App starts on http://localhost:5173

Option 2: Run Both Together

cd Frontend
npm run dev:all
# Starts both frontend and backend concurrently

Production Build

Frontend:

cd Frontend
npm run build
npm run preview  # Preview the production build

Backend:

cd server
npm run build
npm start

Testing

Frontend Tests:

cd Frontend
npm run test        # Watch mode
npm run test:run    # Single run

Code Quality

Frontend:

npm run lint      # Check code quality
npm run format    # Auto-format code
npm run analyze   # Bundle size analysis

πŸ— Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Frontend (React)                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ PRD Builder  β”‚  β”‚  Dashboard   β”‚  β”‚ Snapshots β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚AI Assistant  β”‚  β”‚Prioritizationβ”‚  β”‚  Export   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β”œβ”€β”€β”€ Google Gemini API (AI)
                         β”‚
                         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Backend (Express + MongoDB)            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  PRD Routes  β”‚  β”‚ Sync Routes  β”‚  β”‚Integrationsβ”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚           MongoDB (Data Layer)                β”‚  β”‚
β”‚  β”‚  β€’ PRDs  β€’ Snapshots  β€’ Templates  β€’ Config  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                β”‚                β”‚
    Linear API       Jira API       Notion API

Frontend Architecture

State Management:

  • Zustand store (prdStore.ts) as single source of truth
  • LocalStorage persistence for offline support
  • Snapshot system for version control

Component Structure:

App
β”œβ”€β”€ Router
β”‚   β”œβ”€β”€ Dashboard (PRD list, search, filters)
β”‚   β”œβ”€β”€ PRDBuilder
β”‚   β”‚   β”œβ”€β”€ StepEditor (Overview, Goals, Features, etc.)
β”‚   β”‚   β”œβ”€β”€ AssistantPanel (AI suggestions)
β”‚   β”‚   β”œβ”€β”€ SnapshotPanel (Version history)
β”‚   β”‚   └── ExportPanel (PDF, HTML, JSON)
β”‚   β”œβ”€β”€ PrioritizationMatrix (RICE scoring)
β”‚   β”œβ”€β”€ StakeholderInput (Feedback collection)
β”‚   └── ReadOnlyPRD (Shareable view)
β”œβ”€β”€ CommandPalette (Cmd/Ctrl+K shortcuts)
└── ErrorBoundary (Error handling)

Backend Architecture

Route Structure:

/api
β”œβ”€β”€ /prds              # PRD CRUD operations
β”œβ”€β”€ /snapshots         # Version history
β”œβ”€β”€ /sync              # Linear & Jira sync
β”‚   β”œβ”€β”€ /linear        # Create Linear issues
β”‚   β”œβ”€β”€ /jira          # Create Jira issues
β”‚   └── /jobs          # Job queue status
β”œβ”€β”€ /integrations      # Config management
β”œβ”€β”€ /templates         # Custom templates
β”œβ”€β”€ /notion           # Notion export
└── /health           # Health check

Data Models:

  • PRD: Core document with metadata, sections, features
  • Snapshot: Compressed version history with timestamps
  • IntegrationConfig: User-specific integration settings
  • Template: Custom PRD templates

πŸ“š API Documentation

PRD Endpoints

GET /api/prds

List all PRDs (50 most recent)

Response:

[
  {
    "_id": "...",
    "title": "New Feature PRD",
    "metadata": { "owner": "..." },
    "createdAt": "2026-01-31T...",
    "updatedAt": "2026-01-31T..."
  }
]

POST /api/prds

Create a new PRD

Request Body:

{
  "title": "New Feature PRD",
  "metadata": {
    "owner": "John Doe",
    "status": "draft"
  },
  "sections": {
    "overview": "Product overview...",
    "goals": ["Goal 1", "Goal 2"]
  }
}

PUT /api/prds/:id

Update an existing PRD

DELETE /api/prds/:id

Delete a PRD

Snapshot Endpoints

GET /api/snapshots/:prdId

List snapshots for a specific PRD

POST /api/snapshots

Create a snapshot

Request Body:

{
  "prdId": "...",
  "snapshot": { "title": "...", "sections": {...} },
  "version": "1.0.0",
  "comment": "Initial version"
}

Sync Endpoints

POST /api/sync/linear

Create issues in Linear

Request Body:

{
  "teamId": "...",
  "projectId": "...",
  "features": [
    {
      "title": "Feature 1",
      "description": "...",
      "priority": 1
    }
  ],
  "async": false
}

POST /api/sync/jira

Create issues in Jira

Request Body:

{
  "projectKey": "PROJ",
  "features": [
    {
      "title": "Feature 1",
      "description": "...",
      "issueType": "Story"
    }
  ]
}

GET /api/sync/jobs/:id

Get sync job status

Response:

{
  "id": "...",
  "status": "completed",
  "result": {
    "created": 5,
    "failed": 0,
    "issues": [...]
  }
}

Notion Endpoints

POST /api/notion/page

Create a Notion page from markdown

Request Body:

{
  "title": "PRD Title",
  "markdown": "# Overview\nContent...",
  "parentPageId": "..." // optional
}

πŸ”§ Development

Project Structure

AIPRD/
β”œβ”€β”€ Frontend/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ store/          # Zustand state management
β”‚   β”‚   β”œβ”€β”€ utils/          # Utility functions
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ i18n/           # Internationalization
β”‚   β”‚   └── types/          # TypeScript definitions
β”‚   β”œβ”€β”€ public/             # Static assets
β”‚   β”œβ”€β”€ vite.config.ts      # Vite configuration
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/                  # Express backend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ models/         # MongoDB models
β”‚   β”‚   β”œβ”€β”€ routes/         # API route handlers
β”‚   β”‚   └── index.ts        # Express app entry
β”‚   β”œβ”€β”€ .env.example        # Environment template
β”‚   └── package.json
β”‚
└── README.md               # This file

Development Workflow

  1. Feature Branch: Create a branch from main

    git checkout -b feature/your-feature-name
  2. Make Changes: Implement your feature with tests

  3. Code Quality: Run linters and formatters

    npm run lint
    npm run format
  4. Testing: Ensure all tests pass

    npm run test
  5. Commit: Use conventional commits

    git commit -m "feat: add new feature"
  6. Push: Push your changes

    git push origin feature/your-feature-name

Debugging

Frontend:

  • Use React DevTools browser extension
  • Zustand DevTools for state inspection
  • Vite's built-in error overlay

Backend:

  • Use console.log or debugger with tsx
  • MongoDB Compass for database inspection
  • Check logs in terminal for API errors

Performance Optimization

Frontend:

  • Code splitting with React lazy loading
  • Virtualized lists with react-window
  • AI response caching (1 min TTL)
  • Service worker for offline support

Backend:

  • Gzip compression for large JSON payloads
  • Rate limiting on sync endpoints
  • MongoDB indexing on frequently queried fields
  • Async job queue for long-running operations

🚒 Deployment

Frontend Deployment

Recommended Platforms:

  • Vercel (recommended for Vite apps)
  • Netlify
  • AWS Amplify
  • GitHub Pages

Vercel Example:

# Install Vercel CLI
npm i -g vercel

# Deploy
cd Frontend
vercel --prod

Build Command: npm run build
Output Directory: dist

Backend Deployment

Recommended Platforms:

  • Railway
  • Heroku
  • AWS Elastic Beanstalk
  • DigitalOcean App Platform
  • Render

Environment Variables: Ensure all required environment variables from .env.example are configured in your deployment platform.

Railway Example:

# Install Railway CLI
npm i -g @railway/cli

# Login and deploy
railway login
cd server
railway up

Database

MongoDB Options:

  • MongoDB Atlas (recommended for production)
  • Self-hosted MongoDB
  • DigitalOcean Managed MongoDB

MongoDB Atlas Setup:

  1. Create a free cluster at mongodb.com/cloud/atlas
  2. Whitelist your deployment platform's IP addresses
  3. Update MONGODB_URI with connection string

Security Checklist

  • Set strong MONGODB_URI with authentication
  • Use environment variables for all secrets
  • Enable CORS only for trusted domains
  • Implement rate limiting in production
  • Use HTTPS for all connections
  • Rotate API keys regularly
  • Enable MongoDB encryption at rest
  • Set up monitoring and alerting

🀝 Contributing

We welcome contributions! Please follow these guidelines:

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

Commit Convention

We use Conventional Commits:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Google Gemini AI for powerful AI capabilities
  • Clerk for seamless authentication
  • MongoDB for flexible data storage
  • React and Vite for excellent developer experience
  • The open-source community for amazing tools and libraries

πŸ“ž Support

For questions and support:

  • Open an issue on GitHub Issues
  • Check existing documentation and README
  • Review closed issues for similar problems

πŸ—Ί Roadmap

  • Real-time collaboration with WebSockets
  • GitHub integration for issue sync
  • Advanced analytics and reporting
  • Mobile app (React Native)
  • AI-powered requirement conflict detection
  • Integration with Figma for design specs
  • Custom AI model training on organization data
  • Advanced RBAC (Role-Based Access Control)

Built with ❀️ by the AI PRD Team

⭐ Star this repo | πŸ› Report Bug | ✨ Request Feature

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages