<?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: Lambda Studio</title>
    <description>The latest articles on DEV Community by Lambda Studio (@lambdastudio).</description>
    <link>https://dev.to/lambdastudio</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3893381%2F58e78df4-d3ca-4e5d-aad3-9515ac8c5242.png</url>
      <title>DEV Community: Lambda Studio</title>
      <link>https://dev.to/lambdastudio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lambdastudio"/>
    <language>en</language>
    <item>
      <title>How I Built a Production-Ready SaaS Boilerplate with Next.js 16</title>
      <dc:creator>Lambda Studio</dc:creator>
      <pubDate>Thu, 23 Apr 2026 03:49:41 +0000</pubDate>
      <link>https://dev.to/lambdastudio/how-i-built-a-production-ready-saas-boilerplate-with-nextjs-16-42ek</link>
      <guid>https://dev.to/lambdastudio/how-i-built-a-production-ready-saas-boilerplate-with-nextjs-16-42ek</guid>
      <description>&lt;p&gt;Every time I started a new SaaS project, I spent the first two weeks building the same things: authentication, billing, a dashboard, user settings, CRUD operations. Over and over again.&lt;/p&gt;

&lt;p&gt;So I decided to build it once, properly, and turn it into a reusable starter kit. Here's how I built &lt;strong&gt;Lambda Kit&lt;/strong&gt; — a production-ready SaaS boilerplate with Next.js 16.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;If you've ever tried to launch a SaaS, you know the drill. Before you can write a single line of your actual product, you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auth with sign up, sign in, password recovery, and avatar upload&lt;/li&gt;
&lt;li&gt;A billing system with multiple plans and a customer portal&lt;/li&gt;
&lt;li&gt;A dashboard with a responsive sidebar&lt;/li&gt;
&lt;li&gt;User settings with profile management&lt;/li&gt;
&lt;li&gt;A CRUD example so you can replicate the pattern for your own entities&lt;/li&gt;
&lt;li&gt;Webhooks to keep everything in sync&lt;/li&gt;
&lt;li&gt;Dark mode (because of course)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's easily 40-60 hours of work before you even start on what makes your SaaS unique.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;p&gt;I chose each tool for a specific reason:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16&lt;/strong&gt; — App Router with Server Components and Server Actions. No client-side JavaScript where it's not needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clerk&lt;/strong&gt; — Auth that just works. User management, social logins, and webhook sync out of the box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supabase&lt;/strong&gt; — Postgres database with a generous free tier. Perfect for getting started.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prisma&lt;/strong&gt; — Type-safe database access. The developer experience is unmatched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe&lt;/strong&gt; — The standard for subscription billing. Three plans (Free, Pro, Enterprise) with the Customer Portal handling upgrades, downgrades, and cancellations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;shadcn/ui&lt;/strong&gt; — Beautiful, accessible components that you own. No vendor lock-in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; — Utility-first styling that keeps everything consistent.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Authentication
&lt;/h3&gt;

&lt;p&gt;Clerk handles the heavy lifting, but I added a custom profile page with Server Actions instead of using Clerk's pre-built components. Why? Because the buyer of this boilerplate needs to see the pattern — how to build forms with Server Components, how to handle image uploads, how to update user data server-side.&lt;/p&gt;

&lt;p&gt;One lesson I learned the hard way: never capture complex SDK objects inside a Server Action closure. Always extract primitive values first.&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="c1"&gt;// ❌ This breaks — user is a Clerk class, not serializable&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;updateProfile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FormData&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="s2"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateUser&lt;/span&gt;&lt;span class="p"&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="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// ✅ This works — userId is a plain string&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="o"&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;updateProfile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FormData&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="s2"&gt;use server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small detail, but it cost me a few hours of debugging.&lt;/p&gt;

&lt;h3&gt;
  
  
  Billing
&lt;/h3&gt;

&lt;p&gt;Three plans: Free ($0), Pro ($19/mo), and Enterprise ($49/mo). The billing page shows the current plan, renewal date, payment method, and invoice history — all pulled from Stripe's API at render time.&lt;/p&gt;

&lt;p&gt;The key insight: you don't need to build upgrade/downgrade UI. Stripe's Customer Portal handles all of that. One API call to create a portal session and redirect — done.&lt;/p&gt;

&lt;p&gt;For the plan selection, I built a responsive modal that uses a Dialog on desktop and a Drawer on mobile. It detects the screen size with a custom &lt;code&gt;useMediaQuery&lt;/code&gt; hook and renders the right component.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dashboard
&lt;/h3&gt;

&lt;p&gt;The dashboard follows a clean pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Overview&lt;/strong&gt; — Stats cards with real data from Prisma (total projects, active projects, current plan)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Projects&lt;/strong&gt; — A full CRUD example with DataTable powered by TanStack Table&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings&lt;/strong&gt; — Nested layout with sidebar navigation (Profile, Billing)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The CRUD example is intentionally generic. It's called "Projects" but the buyer renames it to whatever their SaaS needs. The important thing is that every pattern is demonstrated: listing with server-side data fetching, creation with Server Actions, detail pages with dynamic routes, editing, and deletion with confirmation dialog.&lt;/p&gt;

&lt;h3&gt;
  
  
  Webhooks
&lt;/h3&gt;

&lt;p&gt;Two webhook handlers keep everything in sync:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clerk webhook&lt;/strong&gt; — When a user signs up, it creates a record in Supabase. When they update their profile, it syncs. When they delete their account, it cleans up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe webhook&lt;/strong&gt; — Handles &lt;code&gt;checkout.session.completed&lt;/code&gt;, &lt;code&gt;customer.subscription.updated&lt;/code&gt;, &lt;code&gt;customer.subscription.deleted&lt;/code&gt;, and &lt;code&gt;invoice.payment_failed&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without these, the app is broken. A user could pay for Pro but the database would still show Free. Webhooks are the glue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Settings with Nested Routes
&lt;/h3&gt;

&lt;p&gt;Instead of tabs, I used a layout with nested routes. Each settings section has its own URL (&lt;code&gt;/dashboard/settings/profile&lt;/code&gt;, &lt;code&gt;/dashboard/settings/billing&lt;/code&gt;), which means the browser back button works correctly and you can link directly to a specific section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Server Components are the default.&lt;/strong&gt; I only reach for &lt;code&gt;"use client"&lt;/code&gt; when I absolutely need interactivity — file uploads, dropdowns, modals. Everything else stays on the server. The result is faster pages and simpler code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prisma's &lt;code&gt;findUnique&lt;/code&gt; is strict.&lt;/strong&gt; You can't pass multiple non-unique fields in the &lt;code&gt;where&lt;/code&gt; clause. Use &lt;code&gt;findFirst&lt;/code&gt; instead when filtering by &lt;code&gt;id&lt;/code&gt; + &lt;code&gt;userId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Date hydration is tricky.&lt;/strong&gt; Prisma returns &lt;code&gt;Date&lt;/code&gt; objects, but passing them to Client Components causes hydration mismatches. Convert to ISO strings before passing data to the DataTable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;suppressHydrationWarning&lt;/code&gt; is your friend.&lt;/strong&gt; Dark mode with &lt;code&gt;next-themes&lt;/code&gt; always causes a hydration mismatch on the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag. Adding &lt;code&gt;suppressHydrationWarning&lt;/code&gt; is the official fix, not a hack.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;The boilerplate is live and I'm selling early access for $39. My roadmap includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email templates with Resend&lt;/li&gt;
&lt;li&gt;A public pricing page&lt;/li&gt;
&lt;li&gt;MDX blog&lt;/li&gt;
&lt;li&gt;More polish (loading skeletons, toast notifications, error boundaries)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The price will go up as features are added.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;If you're tired of rebuilding the same SaaS foundation every time, Lambda Kit might save you a few weeks:&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://lambdakit-demo.vercel.app/" rel="noopener noreferrer"&gt;https://lambdakit-demo.vercel.app/&lt;/a&gt;&lt;br&gt;
🛒 &lt;strong&gt;Get it on Gumroad:&lt;/strong&gt; &lt;a href="https://lambdastudioio.gumroad.com/l/iusks" rel="noopener noreferrer"&gt;https://lambdastudioio.gumroad.com/l/iusks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback. What features do you consider essential in a SaaS boilerplate? What would you add?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built by &lt;a href="https://lambdastudio.io" rel="noopener noreferrer"&gt;Lambda Studio&lt;/a&gt; from Patagonia, Argentina.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>saas</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
