<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: frozenwzx-wq</title>
    <description>The latest articles on DEV Community by frozenwzx-wq (@frozenwzxwq).</description>
    <link>https://dev.to/frozenwzxwq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3993202%2F26b35626-87aa-4a5f-8883-17d242638124.png</url>
      <title>DEV Community: frozenwzx-wq</title>
      <link>https://dev.to/frozenwzxwq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/frozenwzxwq"/>
    <language>en</language>
    <item>
      <title>I Got Tired of Building Comments Systems. So I Extracted Mine Into a Drop-in Package.</title>
      <dc:creator>frozenwzx-wq</dc:creator>
      <pubDate>Fri, 19 Jun 2026 20:37:43 +0000</pubDate>
      <link>https://dev.to/frozenwzxwq/i-got-tired-of-building-comments-systems-so-i-extracted-mine-into-a-drop-in-package-142d</link>
      <guid>https://dev.to/frozenwzxwq/i-got-tired-of-building-comments-systems-so-i-extracted-mine-into-a-drop-in-package-142d</guid>
      <description>&lt;h1&gt;
  
  
  I Got Tired of Building Comments Systems. So I Extracted Mine Into a Drop-in Package.
&lt;/h1&gt;

&lt;p&gt;Every Next.js project needs comments. And every time, I found myself doing the same things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designing a &lt;code&gt;comments&lt;/code&gt; table with proper indexes and RLS policies&lt;/li&gt;
&lt;li&gt;Writing CRUD API routes with rate limiting&lt;/li&gt;
&lt;li&gt;Building the React UI — threaded display, optimistic likes, form validation&lt;/li&gt;
&lt;li&gt;Adding content filtering so spam doesn't hit production&lt;/li&gt;
&lt;li&gt;Setting up IP tracking and ban hooks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is hard. It's just &lt;strong&gt;three days of work I'd rather spend on features that matter.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Did
&lt;/h2&gt;

&lt;p&gt;I run a Next.js + Supabase project called SheetRant. After building the comment system there, I extracted everything into a standalone package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nextjs-supabase-comments/
├── supabase/migrations/     ← 1 SQL file, tables + RLS
├── src/
│   ├── components/          ← LikeButton, CommentForm, CommentList
│   ├── api/                 ← Comments handler, Likes handler
│   └── lib/                 ← Rate limiter, content filter, config
└── example/                 ← Working demo page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Built-in: threaded replies, optimistic like UI, IP rate limiting, content filtering, ban detection hooks, IP geo-location, full TypeScript, Tailwind CSS.&lt;/p&gt;




&lt;h2&gt;
  
  
  Usage: 3 Steps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; — Run the migration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;supabase db push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; — Create API routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createCommentsHandler&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;nextjs-supabase-comments&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createCommentsHandler&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;maxLength&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;blockedKeywords&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;spam&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;GET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt; — Drop components into your page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;LikeButton&lt;/span&gt; &lt;span class="na"&gt;postId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;CommentList&lt;/span&gt; &lt;span class="na"&gt;postId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;refreshKey&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;refresh&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;CommentForm&lt;/span&gt; &lt;span class="na"&gt;postId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Comments and likes work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Free vs Complete
&lt;/h2&gt;

&lt;p&gt;The full source code is open-source on GitHub, MIT license. Use it in any project for free.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/frozenwzx-wq/nextjs-supabase-comments" rel="noopener noreferrer"&gt;GitHub: frozenwzx-wq/nextjs-supabase-comments&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also put together a &lt;strong&gt;Complete Package&lt;/strong&gt; with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ready-to-run demo project (clone, &lt;code&gt;npm install&lt;/code&gt;, works immediately)&lt;/li&gt;
&lt;li&gt;Step-by-step video walkthrough&lt;/li&gt;
&lt;li&gt;Vercel deployment guide&lt;/li&gt;
&lt;li&gt;3 bonus page templates&lt;/li&gt;
&lt;li&gt;Lifetime updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;a href="https://frozenwave3.gumroad.com/l/aqdwe" rel="noopener noreferrer"&gt;Get it on Gumroad — $29&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Charge for Free Code?
&lt;/h2&gt;

&lt;p&gt;I'm not charging for the code. I'm charging for the time I've already spent so you don't have to.&lt;/p&gt;

&lt;p&gt;If you're comfortable reading source code and setting things up yourself — the GitHub repo has everything you need. If you want the guided experience with a ready-to-run project — that's what the $29 is for.&lt;/p&gt;

&lt;p&gt;Either way, stop building comments from scratch.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tech stack: Next.js 14+ / Supabase / TypeScript / Tailwind CSS / React&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>supabase</category>
      <category>react</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
