Polymorphic Comment System

A production-ready, drop-in comment system built with Next.js 15, React Server Components, and Prisma. Supports polymorphic relationships, threaded replies, and real-time interactions.

Polymorphic Design
Threaded Replies
Drop-in Integration
Polymorphic Design
Attach comments to any entity type - articles, episodes, products, or custom models with just two props.
Threaded Replies
Single-level threaded replies with efficient loading using React Server Components.
Server Components
Built with Next.js 15 App Router and React Server Components for optimal performance and SEO.
Drop-in Ready
Simple integration with just two props - entity type and entity ID. No complex setup required.

Live Demo

Article Comments

See how comments work on blog articles with full CRUD operations and threaded replies.

Try Article Demo

Episode Comments

Same comment system working on podcast episodes - demonstrating true polymorphic behavior.

Try Episode Demo

Simple Integration

// Just two lines to add comments to any page
<Comments entity="ARTICLE" entityId={article.id} />

// Works with any entity type - same component!
<Comments entity="EPISODE" entityId={episode.id} />
<Comments entity="PRODUCT" entityId={product.id} />
<Comments entity="POST" entityId={post.id} />

// The system automatically handles:
// ✅ Loading comments for the specific entity
// ✅ User authentication and permissions
// ✅ Creating, editing, and deleting comments
// ✅ Single-level threaded replies
// ✅ Real-time updates with Server Components

Technical Stack

Frontend
  • Next.js 15 with App Router
  • React Server Components
  • TypeScript
  • Tailwind CSS
  • Lucide Icons
Backend
  • Prisma ORM
  • PostgreSQL Database
  • Server Actions
  • Session Management
  • Polymorphic Relations
Features
  • User Authentication
  • CRUD Operations
  • Single-level Replies
  • Real-time Updates
  • Responsive Design

Perfect For

Blog Platforms

Article comments and discussions

Podcast Apps

Episode discussions and feedback

E-commerce Sites

Product reviews and Q&A

Documentation

Page feedback and questions

Social Platforms

Post interactions and discussions

Any Content

Custom entity types and models