<?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>Forem: Salman Shahriar</title>
    <description>The latest articles on Forem by Salman Shahriar (@salmanshahriar).</description>
    <link>https://forem.com/salmanshahriar</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%2F1951722%2F6c136fda-088e-4813-ba06-de1af03134ea.jpeg</url>
      <title>Forem: Salman Shahriar</title>
      <link>https://forem.com/salmanshahriar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/salmanshahriar"/>
    <language>en</language>
    <item>
      <title>50 Hours Building a Next.js Boilerplate So You Can Ship in 30 Minutes!</title>
      <dc:creator>Salman Shahriar</dc:creator>
      <pubDate>Sat, 04 Apr 2026 14:55:07 +0000</pubDate>
      <link>https://forem.com/salmanshahriar/50-hours-building-a-nextjs-boilerplate-so-you-can-ship-in-30-minutes-4ho9</link>
      <guid>https://forem.com/salmanshahriar/50-hours-building-a-nextjs-boilerplate-so-you-can-ship-in-30-minutes-4ho9</guid>
      <description>&lt;h2&gt;
  
  
  Next.js Boilerplate: The Ultimate SaaS Starter Kit
&lt;/h2&gt;

&lt;p&gt;Looking for the best &lt;strong&gt;Next.js Boilerplate&lt;/strong&gt; to launch your next project? You've found it. This production-ready starter kit is designed to help you go from idea to deployment in record time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The Problem That Kept Me Up at Night&lt;/li&gt;
&lt;li&gt;Why This Next.js Boilerplate is Different&lt;/li&gt;
&lt;li&gt;Key Features of Nextjs-Elite-Boilerplate&lt;/li&gt;
&lt;li&gt;How to Get Started (The Real Way)&lt;/li&gt;
&lt;li&gt;The Project Structure (Explained for Humans)&lt;/li&gt;
&lt;li&gt;What You Get Out of the Box&lt;/li&gt;
&lt;li&gt;Contributing &amp;amp; Support&lt;/li&gt;
&lt;li&gt;Final Thoughts&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="the-saas-development-burden"&gt;The Problem That Kept Me Up at Night&lt;/h2&gt;

&lt;p&gt;You know that feeling when you start a new Next.js project and spend the first week just setting things up? Authentication, internationalization, role management, SEO configuration... By the time you're done with the boilerplate, you've lost all that initial excitement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you get in one line:&lt;/strong&gt; A production-ready &lt;strong&gt;Next.js SaaS Boilerplate&lt;/strong&gt; with Type-safe i18n (6 languages) + NextAuth, Google OAuth + RBAC with parallel routes + SEO (sitemap, robots, manifest) + Theme + ESLint + Prettier + Vitest + Playwright.&lt;/p&gt;

&lt;p&gt;I've been there. Too many times. After building multiple SaaS projects, I realized I was copy-pasting the same setup code. So I built the ultimate &lt;strong&gt;Next.js starter kit&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id="why-this-nextjs-boilerplate-is-different"&gt;Why This Next.js Boilerplate is Different&lt;/h2&gt;

&lt;p&gt;Meet &lt;strong&gt;Nextjs-Elite-Boilerplate&lt;/strong&gt;: not just another "hello world" starter template, but a &lt;strong&gt;fully-featured foundation&lt;/strong&gt; that handles all the boring stuff so you can focus on building your actual product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best part? I've made this project completely open source for everyone.&lt;/strong&gt; Whether you're a student learning the ropes or a seasoned dev looking for a solid starting point, this is for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Links:
&lt;/h3&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://nextjs-elite-boilerplate.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt; | 📦 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt; | 🚀 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/generate" rel="noopener noreferrer"&gt;Use this template&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://vercel.com/new/clone?repository-url=https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Deploy on Vercel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmgm9ahn9q0db3y58bos.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmgm9ahn9q0db3y58bos.webp" alt="Leading Next.js Boilerplate Screenshot" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="key-features"&gt;Key Features of Nextjs-Elite-Boilerplate&lt;/h2&gt;

&lt;h3&gt;
  
  
  🌍 Real Internationalization (i18n) for Global SaaS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Six languages out of the box&lt;/strong&gt;: English, বাংলা, العربية, Français, Español, and 简体中文.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTL support that actually works&lt;/strong&gt;: Arabic layouts automatically flip to right-to-left.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16 Ready&lt;/strong&gt;: Fully optimized for the latest React features.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔐 Role-Based Access Control (RBAC) That Scales
&lt;/h3&gt;

&lt;p&gt;I used &lt;strong&gt;Next.js 16's parallel routes&lt;/strong&gt; to make this painless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/app/
  (protected)/
    @admin/      # Admin-only views
      dashboard/
    @user/       # User views
      dashboard/
    layout.tsx   # Smart routing logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The layout automatically shows the right dashboard based on the user's role. No messy conditionals scattered everywhere. Want to add a new role? Just create a new parallel route folder. That's it.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 UI/UX with shadcn/ui
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Components are copy-paste ready (no bloated dependencies).&lt;/li&gt;
&lt;li&gt;Full TypeScript support &amp;amp; accessible by default.&lt;/li&gt;
&lt;li&gt;Built-in Dark Mode with &lt;code&gt;next-themes&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔧 ESLint That Actually Helps (Not Annoys)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Catch real bugs&lt;/strong&gt; (unused variables, missing dependencies, potential null references)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce consistency&lt;/strong&gt; (import order, naming conventions, formatting)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eslint-config-next&lt;/code&gt; - Official Next.js rules&lt;/li&gt;
&lt;li&gt;TypeScript-specific linting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prettier&lt;/strong&gt; is wired up too. Run &lt;code&gt;npm run lint&lt;/code&gt; and &lt;code&gt;npm run prettier:fix&lt;/code&gt; for consistent, clean code.&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 SEO Configuration That's Actually Usable
&lt;/h3&gt;

&lt;p&gt;I created a single JSON configuration file that handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Graph tags&lt;/li&gt;
&lt;li&gt;Structured data (JSON-LD)&lt;/li&gt;
&lt;li&gt;Multi-language meta tags&lt;/li&gt;
&lt;li&gt;Canonical URLs&lt;/li&gt;
&lt;li&gt;Dynamic sitemap generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just edit one file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Description"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://yoursite.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"your"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"social"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"twitter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@yourhandle"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧪 Testing &amp;amp; CI
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit and component tests&lt;/strong&gt;: Vitest + React Testing Library. Run &lt;code&gt;npm run test&lt;/code&gt; or &lt;code&gt;npm run test:watch&lt;/code&gt;; &lt;code&gt;npm run test:coverage&lt;/code&gt; for coverage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E2E&lt;/strong&gt;: Playwright in &lt;code&gt;e2e/&lt;/code&gt;. Run &lt;code&gt;npm run e2e&lt;/code&gt; (dev server starts automatically); &lt;code&gt;npm run e2e:ui&lt;/code&gt; for the UI. Use &lt;code&gt;npm run e2e:webkit&lt;/code&gt; for WebKit-only (e.g. to save disk).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI&lt;/strong&gt;: GitHub Actions – &lt;code&gt;.github/workflows/check.yml&lt;/code&gt; runs lint, Prettier, tests, and build on push/PR; &lt;code&gt;.github/workflows/playwright.yml&lt;/code&gt; runs E2E.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔑 Authentication (NextAuth.js + Google OAuth)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google OAuth&lt;/strong&gt; – enable by setting &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;, and &lt;code&gt;NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true&lt;/code&gt; in &lt;code&gt;.env&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom login page&lt;/strong&gt; at &lt;code&gt;/auth/login&lt;/code&gt; with optional "Sign in with Google"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JWT session&lt;/strong&gt; with role and user id; redirect to &lt;code&gt;/dashboard&lt;/code&gt; after sign-in&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copy &lt;code&gt;.env.example&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;, add your secrets, and you're done.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏥 Health Check
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;GET /api/health&lt;/code&gt; returns &lt;code&gt;{ status: "ok" }&lt;/code&gt; for load balancers and Kubernetes probes.&lt;/p&gt;

&lt;h2 id="how-to-get-started"&gt;How to Get Started (The Real Way)&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Clone and Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Grab the code&lt;/span&gt;
git clone https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Nextjs-Elite-Boilerplate

&lt;span class="c"&gt;# Install dependencies (use whatever you prefer)&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;span class="c"&gt;# or bun install / yarn install / pnpm install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure Your Project
&lt;/h3&gt;

&lt;p&gt;This is where most boilerplates leave you hanging. Not this one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit &lt;code&gt;src/shared/lib/config/app-main-meta-data.json&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My Awesome SaaS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Revolutionary Product That Does X"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"We help Y achieve Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://myawesomesaas.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"organization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My Company"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"hello@mycompany.com"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"social"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"twitter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@myhandle"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/myhandle"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's your entire brand configuration. One file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Customize Your Languages (Optional)
&lt;/h3&gt;

&lt;p&gt;Want to add Spanish? Here's how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;locales/es.json&lt;/code&gt; with the same structure as &lt;code&gt;locales/en.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"common"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Mi App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"navigation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"home"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Inicio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"about"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Acerca de"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update &lt;code&gt;src/shared/lib/config/app-main-meta-data.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"languages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"supported"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"locales"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Spanish"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"nativeName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Español"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"locale"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es_ES"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"direction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ltr"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;src/shared/lib/i18n/get-translations.ts&lt;/code&gt;, import &lt;code&gt;es.json&lt;/code&gt; and add &lt;code&gt;es&lt;/code&gt; to the &lt;code&gt;translations&lt;/code&gt; object. If you use strict translation keys, add the new locale to the &lt;code&gt;TranslationKeys&lt;/code&gt; union in &lt;code&gt;src/shared/lib/i18n/types.ts&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Done. Your app now speaks Spanish.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Set Up Your Roles
&lt;/h3&gt;

&lt;p&gt;The boilerplate comes with User and Admin roles. To add more:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new parallel route folder:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; src/app/&lt;span class="o"&gt;(&lt;/span&gt;protected&lt;span class="o"&gt;)&lt;/span&gt;/@moderator/dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Add your pages inside that folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update &lt;code&gt;src/app/(protected)/layout.tsx&lt;/code&gt; to handle the new role:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;moderator&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;moderator&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's genuinely all you need to do.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Run It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:3000&lt;/code&gt; and see your fully-configured app running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Available Scripts
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start development server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Production build&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start production server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run lint&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run ESLint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run lint:fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix ESLint errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests (Vitest)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test:watch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests in watch mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test:coverage&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tests with coverage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Playwright E2E tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e:ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Playwright with UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e:webkit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;E2E in WebKit only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run prettier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check formatting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run prettier:fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix formatting&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 6: Environment (First-Time Setup)
&lt;/h3&gt;

&lt;p&gt;Copy &lt;code&gt;.env.example&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;. Set &lt;code&gt;NEXT_PUBLIC_APP_URL&lt;/code&gt; if you need to override the site URL (e.g. in production). For Google sign-in: set &lt;code&gt;NEXTAUTH_URL&lt;/code&gt;, &lt;code&gt;NEXTAUTH_SECRET&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;, then &lt;code&gt;NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true&lt;/code&gt;. Optionally set &lt;code&gt;AUTH_ADMIN_EMAILS=admin@yourdomain.com&lt;/code&gt; so those emails get the admin role.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 18.17 or later&lt;/li&gt;
&lt;li&gt;npm, yarn, pnpm, or bun&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="project-structure"&gt;The Project Structure (Explained for Humans)&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
  app/
    (protected)/         # Routes behind auth (@admin, @user)
    (public)/            # Public routes (Home, About)
    auth/                # Auth-related pages (Login)
    api/                 # API routes (Auth, Health)
    layout.tsx           # Global layout &amp;amp; providers
    page.tsx             # Landing page
    ...
  shared/
    ui/                  # shadcn/ui components
    layout/              # Header, Sidebar, ThemeToggle
    components/          # Feature components
    hooks/               # Reusable hooks
    lib/                 # i18n, auth config, site metadata
locales/                 # i18n JSON files (en, bn, ar, fr, es, zh)
e2e/                     # Playwright E2E tests
.github/workflows/       # CI/CD pipelines
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2 id="out-of-the-box"&gt;What You Get Out of the Box&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Next.js 16&lt;/strong&gt; with App Router and Server Components&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;TypeScript&lt;/strong&gt; (strict mode)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Tailwind CSS&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;ESLint&lt;/strong&gt; and &lt;strong&gt;Prettier&lt;/strong&gt; (Next.js, TypeScript, a11y, format on save in .vscode)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;NextAuth.js&lt;/strong&gt; with optional Google OAuth and admin-by-email&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;i18n&lt;/strong&gt; with type safety and RTL (en, bn, ar, fr, es, zh)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;RBAC&lt;/strong&gt; with parallel routes (User / Admin)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;SEO&lt;/strong&gt; from one JSON config (metadata, sitemap, robots, manifest)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;next-themes&lt;/strong&gt; for dark mode (system + manual toggle)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;shadcn/ui&lt;/strong&gt; (accessible, customizable)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Vitest&lt;/strong&gt; + React Testing Library for unit/component tests&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Playwright&lt;/strong&gt; for E2E in &lt;code&gt;e2e/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;GitHub Actions&lt;/strong&gt; for lint, format, test, build and E2E&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Health check&lt;/strong&gt; at &lt;code&gt;GET /api/health&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Vercel&lt;/strong&gt;-ready (one-click deploy from the repo)&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Talk: When Should You Use This?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Perfect for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SaaS products with multiple user types&lt;/li&gt;
&lt;li&gt;International applications&lt;/li&gt;
&lt;li&gt;Projects where you want to ship fast&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Maybe not ideal for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Projects with very specific auth requirements (you'll need to customize heavily)&lt;/li&gt;
&lt;li&gt;Apps that don't need i18n or role management&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="contributing-support"&gt;Contributing &amp;amp; Support&lt;/h2&gt;

&lt;p&gt;Found a bug? Want to add a feature? The repo is fully open source:&lt;/p&gt;

&lt;p&gt;🐛 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/issues" rel="noopener noreferrer"&gt;Report issues&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
⭐ &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Star on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🤝 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/pulls" rel="noopener noreferrer"&gt;Submit a PR&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id="final-thoughts"&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;I built this because I got tired of setting up the same infrastructure for every project. Now that it's open source, I hope it helps you ship your next big idea even faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's your biggest pain point when starting a new Next.js project?&lt;/strong&gt;&lt;br&gt;
Drop a comment below; I'm always looking to improve this.&lt;/p&gt;

&lt;p&gt;Happy building! 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Links:
&lt;/h3&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://nextjs-elite-boilerplate.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt; | 📦 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt; | 🚀 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/generate" rel="noopener noreferrer"&gt;Use this template&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://vercel.com/new/clone?repository-url=https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Deploy on Vercel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>boilerplate</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>50 Hours Building a Next.js Boilerplate So You Can Ship in 30 Minutes!</title>
      <dc:creator>Salman Shahriar</dc:creator>
      <pubDate>Tue, 24 Mar 2026 21:19:07 +0000</pubDate>
      <link>https://forem.com/salmanshahriar/50-hours-building-a-nextjs-boilerplate-so-you-can-ship-in-30-minutes-254m</link>
      <guid>https://forem.com/salmanshahriar/50-hours-building-a-nextjs-boilerplate-so-you-can-ship-in-30-minutes-254m</guid>
      <description>&lt;h2&gt;
  
  
  Next.js Boilerplate: The Ultimate SaaS Starter Kit
&lt;/h2&gt;

&lt;p&gt;Looking for the best &lt;strong&gt;Next.js Boilerplate&lt;/strong&gt; to launch your next project? You've found it. This production-ready starter kit is designed to help you go from idea to deployment in record time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The Problem That Kept Me Up at Night&lt;/li&gt;
&lt;li&gt;Why This Next.js Boilerplate is Different&lt;/li&gt;
&lt;li&gt;Key Features of Nextjs-Elite-Boilerplate&lt;/li&gt;
&lt;li&gt;How to Get Started (The Real Way)&lt;/li&gt;
&lt;li&gt;The Project Structure (Explained for Humans)&lt;/li&gt;
&lt;li&gt;What You Get Out of the Box&lt;/li&gt;
&lt;li&gt;Contributing &amp;amp; Support&lt;/li&gt;
&lt;li&gt;Final Thoughts&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="the-saas-development-burden"&gt;The Problem That Kept Me Up at Night&lt;/h2&gt;

&lt;p&gt;You know that feeling when you start a new Next.js project and spend the first week just setting things up? Authentication, internationalization, role management, SEO configuration... By the time you're done with the boilerplate, you've lost all that initial excitement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you get in one line:&lt;/strong&gt; A production-ready &lt;strong&gt;Next.js SaaS Boilerplate&lt;/strong&gt; with Type-safe i18n (6 languages) + NextAuth, Google OAuth + RBAC with parallel routes + SEO (sitemap, robots, manifest) + Theme + ESLint + Prettier + Vitest + Playwright.&lt;/p&gt;

&lt;p&gt;I've been there. Too many times. After building multiple SaaS projects, I realized I was copy-pasting the same setup code. So I built the ultimate &lt;strong&gt;Next.js starter kit&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id="why-this-nextjs-boilerplate-is-different"&gt;Why This Next.js Boilerplate is Different&lt;/h2&gt;

&lt;p&gt;Meet &lt;strong&gt;Nextjs-Elite-Boilerplate&lt;/strong&gt;: not just another "hello world" starter template, but a &lt;strong&gt;fully-featured foundation&lt;/strong&gt; that handles all the boring stuff so you can focus on building your actual product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best part? I've made this project completely open source for everyone.&lt;/strong&gt; Whether you're a student learning the ropes or a seasoned dev looking for a solid starting point, this is for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Links:
&lt;/h3&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://nextjs-elite-boilerplate.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt; | 📦 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt; | 🚀 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/generate" rel="noopener noreferrer"&gt;Use this template&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://vercel.com/new/clone?repository-url=https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Deploy on Vercel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmgm9ahn9q0db3y58bos.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmgm9ahn9q0db3y58bos.webp" alt="Leading Next.js Boilerplate Screenshot" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="key-features"&gt;Key Features of Nextjs-Elite-Boilerplate&lt;/h2&gt;

&lt;h3&gt;
  
  
  🌍 Real Internationalization (i18n) for Global SaaS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Six languages out of the box&lt;/strong&gt;: English, বাংলা, العربية, Français, Español, and 简体中文.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTL support that actually works&lt;/strong&gt;: Arabic layouts automatically flip to right-to-left.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16 Ready&lt;/strong&gt;: Fully optimized for the latest React features.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔐 Role-Based Access Control (RBAC) That Scales
&lt;/h3&gt;

&lt;p&gt;I used &lt;strong&gt;Next.js 16's parallel routes&lt;/strong&gt; to make this painless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/app/
  (protected)/
    @admin/      # Admin-only views
      dashboard/
    @user/       # User views
      dashboard/
    layout.tsx   # Smart routing logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The layout automatically shows the right dashboard based on the user's role. No messy conditionals scattered everywhere. Want to add a new role? Just create a new parallel route folder. That's it.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 UI/UX with shadcn/ui
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Components are copy-paste ready (no bloated dependencies).&lt;/li&gt;
&lt;li&gt;Full TypeScript support &amp;amp; accessible by default.&lt;/li&gt;
&lt;li&gt;Built-in Dark Mode with &lt;code&gt;next-themes&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔧 ESLint That Actually Helps (Not Annoys)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Catch real bugs&lt;/strong&gt; (unused variables, missing dependencies, potential null references)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce consistency&lt;/strong&gt; (import order, naming conventions, formatting)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eslint-config-next&lt;/code&gt; - Official Next.js rules&lt;/li&gt;
&lt;li&gt;TypeScript-specific linting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prettier&lt;/strong&gt; is wired up too. Run &lt;code&gt;npm run lint&lt;/code&gt; and &lt;code&gt;npm run prettier:fix&lt;/code&gt; for consistent, clean code.&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 SEO Configuration That's Actually Usable
&lt;/h3&gt;

&lt;p&gt;I created a single JSON configuration file that handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Graph tags&lt;/li&gt;
&lt;li&gt;Structured data (JSON-LD)&lt;/li&gt;
&lt;li&gt;Multi-language meta tags&lt;/li&gt;
&lt;li&gt;Canonical URLs&lt;/li&gt;
&lt;li&gt;Dynamic sitemap generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just edit one file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Description"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://yoursite.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"your"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"social"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"twitter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@yourhandle"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧪 Testing &amp;amp; CI
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit and component tests&lt;/strong&gt;: Vitest + React Testing Library. Run &lt;code&gt;npm run test&lt;/code&gt; or &lt;code&gt;npm run test:watch&lt;/code&gt;; &lt;code&gt;npm run test:coverage&lt;/code&gt; for coverage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E2E&lt;/strong&gt;: Playwright in &lt;code&gt;e2e/&lt;/code&gt;. Run &lt;code&gt;npm run e2e&lt;/code&gt; (dev server starts automatically); &lt;code&gt;npm run e2e:ui&lt;/code&gt; for the UI. Use &lt;code&gt;npm run e2e:webkit&lt;/code&gt; for WebKit-only (e.g. to save disk).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI&lt;/strong&gt;: GitHub Actions – &lt;code&gt;.github/workflows/check.yml&lt;/code&gt; runs lint, Prettier, tests, and build on push/PR; &lt;code&gt;.github/workflows/playwright.yml&lt;/code&gt; runs E2E.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔑 Authentication (NextAuth.js + Google OAuth)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google OAuth&lt;/strong&gt; – enable by setting &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;, and &lt;code&gt;NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true&lt;/code&gt; in &lt;code&gt;.env&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom login page&lt;/strong&gt; at &lt;code&gt;/auth/login&lt;/code&gt; with optional "Sign in with Google"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JWT session&lt;/strong&gt; with role and user id; redirect to &lt;code&gt;/dashboard&lt;/code&gt; after sign-in&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copy &lt;code&gt;.env.example&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;, add your secrets, and you're done.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏥 Health Check
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;GET /api/health&lt;/code&gt; returns &lt;code&gt;{ status: "ok" }&lt;/code&gt; for load balancers and Kubernetes probes.&lt;/p&gt;

&lt;h2 id="how-to-get-started"&gt;How to Get Started (The Real Way)&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Clone and Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Grab the code&lt;/span&gt;
git clone https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Nextjs-Elite-Boilerplate

&lt;span class="c"&gt;# Install dependencies (use whatever you prefer)&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;span class="c"&gt;# or bun install / yarn install / pnpm install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure Your Project
&lt;/h3&gt;

&lt;p&gt;This is where most boilerplates leave you hanging. Not this one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit &lt;code&gt;src/shared/lib/config/app-main-meta-data.json&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My Awesome SaaS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Revolutionary Product That Does X"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"We help Y achieve Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://myawesomesaas.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"organization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My Company"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"hello@mycompany.com"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"social"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"twitter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@myhandle"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/myhandle"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's your entire brand configuration. One file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Customize Your Languages (Optional)
&lt;/h3&gt;

&lt;p&gt;Want to add Spanish? Here's how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;locales/es.json&lt;/code&gt; with the same structure as &lt;code&gt;locales/en.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"common"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Mi App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"navigation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"home"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Inicio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"about"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Acerca de"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update &lt;code&gt;src/shared/lib/config/app-main-meta-data.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"languages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"supported"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"locales"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Spanish"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"nativeName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Español"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"locale"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es_ES"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"direction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ltr"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;src/shared/lib/i18n/get-translations.ts&lt;/code&gt;, import &lt;code&gt;es.json&lt;/code&gt; and add &lt;code&gt;es&lt;/code&gt; to the &lt;code&gt;translations&lt;/code&gt; object. If you use strict translation keys, add the new locale to the &lt;code&gt;TranslationKeys&lt;/code&gt; union in &lt;code&gt;src/shared/lib/i18n/types.ts&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Done. Your app now speaks Spanish.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Set Up Your Roles
&lt;/h3&gt;

&lt;p&gt;The boilerplate comes with User and Admin roles. To add more:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new parallel route folder:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; src/app/&lt;span class="o"&gt;(&lt;/span&gt;protected&lt;span class="o"&gt;)&lt;/span&gt;/@moderator/dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Add your pages inside that folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update &lt;code&gt;src/app/(protected)/layout.tsx&lt;/code&gt; to handle the new role:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;moderator&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;moderator&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's genuinely all you need to do.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Run It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:3000&lt;/code&gt; and see your fully-configured app running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Available Scripts
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start development server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Production build&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start production server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run lint&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run ESLint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run lint:fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix ESLint errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests (Vitest)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test:watch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests in watch mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test:coverage&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tests with coverage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Playwright E2E tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e:ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Playwright with UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e:webkit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;E2E in WebKit only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run prettier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check formatting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run prettier:fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix formatting&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 6: Environment (First-Time Setup)
&lt;/h3&gt;

&lt;p&gt;Copy &lt;code&gt;.env.example&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;. Set &lt;code&gt;NEXT_PUBLIC_APP_URL&lt;/code&gt; if you need to override the site URL (e.g. in production). For Google sign-in: set &lt;code&gt;NEXTAUTH_URL&lt;/code&gt;, &lt;code&gt;NEXTAUTH_SECRET&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;, then &lt;code&gt;NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true&lt;/code&gt;. Optionally set &lt;code&gt;AUTH_ADMIN_EMAILS=admin@yourdomain.com&lt;/code&gt; so those emails get the admin role.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 18.17 or later&lt;/li&gt;
&lt;li&gt;npm, yarn, pnpm, or bun&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="project-structure"&gt;The Project Structure (Explained for Humans)&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
  app/
    (protected)/         # Routes behind auth (@admin, @user)
    (public)/            # Public routes (Home, About)
    auth/                # Auth-related pages (Login)
    api/                 # API routes (Auth, Health)
    layout.tsx           # Global layout &amp;amp; providers
    page.tsx             # Landing page
    ...
  shared/
    ui/                  # shadcn/ui components
    layout/              # Header, Sidebar, ThemeToggle
    components/          # Feature components
    hooks/               # Reusable hooks
    lib/                 # i18n, auth config, site metadata
locales/                 # i18n JSON files (en, bn, ar, fr, es, zh)
e2e/                     # Playwright E2E tests
.github/workflows/       # CI/CD pipelines
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2 id="out-of-the-box"&gt;What You Get Out of the Box&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Next.js 16&lt;/strong&gt; with App Router and Server Components&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;TypeScript&lt;/strong&gt; (strict mode)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Tailwind CSS&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;ESLint&lt;/strong&gt; and &lt;strong&gt;Prettier&lt;/strong&gt; (Next.js, TypeScript, a11y, format on save in .vscode)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;NextAuth.js&lt;/strong&gt; with optional Google OAuth and admin-by-email&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;i18n&lt;/strong&gt; with type safety and RTL (en, bn, ar, fr, es, zh)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;RBAC&lt;/strong&gt; with parallel routes (User / Admin)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;SEO&lt;/strong&gt; from one JSON config (metadata, sitemap, robots, manifest)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;next-themes&lt;/strong&gt; for dark mode (system + manual toggle)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;shadcn/ui&lt;/strong&gt; (accessible, customizable)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Vitest&lt;/strong&gt; + React Testing Library for unit/component tests&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Playwright&lt;/strong&gt; for E2E in &lt;code&gt;e2e/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;GitHub Actions&lt;/strong&gt; for lint, format, test, build and E2E&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Health check&lt;/strong&gt; at &lt;code&gt;GET /api/health&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Vercel&lt;/strong&gt;-ready (one-click deploy from the repo)&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Talk: When Should You Use This?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Perfect for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SaaS products with multiple user types&lt;/li&gt;
&lt;li&gt;International applications&lt;/li&gt;
&lt;li&gt;Projects where you want to ship fast&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Maybe not ideal for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Projects with very specific auth requirements (you'll need to customize heavily)&lt;/li&gt;
&lt;li&gt;Apps that don't need i18n or role management&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="contributing-support"&gt;Contributing &amp;amp; Support&lt;/h2&gt;

&lt;p&gt;Found a bug? Want to add a feature? The repo is fully open source:&lt;/p&gt;

&lt;p&gt;🐛 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/issues" rel="noopener noreferrer"&gt;Report issues&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
⭐ &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Star on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🤝 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/pulls" rel="noopener noreferrer"&gt;Submit a PR&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id="final-thoughts"&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;I built this because I got tired of setting up the same infrastructure for every project. Now that it's open source, I hope it helps you ship your next big idea even faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's your biggest pain point when starting a new Next.js project?&lt;/strong&gt;&lt;br&gt;
Drop a comment below; I'm always looking to improve this.&lt;/p&gt;

&lt;p&gt;Happy building! 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Links:
&lt;/h3&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://nextjs-elite-boilerplate.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt; | 📦 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt; | 🚀 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/generate" rel="noopener noreferrer"&gt;Use this template&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://vercel.com/new/clone?repository-url=https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Deploy on Vercel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>boilerplate</category>
      <category>saas</category>
      <category>opensource</category>
    </item>
    <item>
      <title>50 Hours Building a Next.js Boilerplate So You Can Ship in 30 Minutes!</title>
      <dc:creator>Salman Shahriar</dc:creator>
      <pubDate>Wed, 19 Nov 2025 19:11:28 +0000</pubDate>
      <link>https://forem.com/salmanshahriar/i-built-a-production-ready-nextjs-boilerplate-so-you-dont-have-to-17d3</link>
      <guid>https://forem.com/salmanshahriar/i-built-a-production-ready-nextjs-boilerplate-so-you-dont-have-to-17d3</guid>
      <description>&lt;h2&gt;
  
  
  Next.js Boilerplate: The Ultimate SaaS Starter Kit
&lt;/h2&gt;

&lt;p&gt;Looking for the best &lt;strong&gt;Next.js Boilerplate&lt;/strong&gt; to launch your next project? You've found it. This production-ready starter kit is designed to help you go from idea to deployment in record time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The Problem That Kept Me Up at Night&lt;/li&gt;
&lt;li&gt;Why This Next.js Boilerplate is Different&lt;/li&gt;
&lt;li&gt;Key Features of Nextjs-Elite-Boilerplate&lt;/li&gt;
&lt;li&gt;How to Get Started (The Real Way)&lt;/li&gt;
&lt;li&gt;The Project Structure (Explained for Humans)&lt;/li&gt;
&lt;li&gt;What You Get Out of the Box&lt;/li&gt;
&lt;li&gt;Contributing &amp;amp; Support&lt;/li&gt;
&lt;li&gt;Final Thoughts&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id="the-saas-development-burden"&gt;The Problem That Kept Me Up at Night&lt;/h2&gt;

&lt;p&gt;You know that feeling when you start a new Next.js project and spend the first week just setting things up? Authentication, internationalization, role management, SEO configuration... By the time you're done with the boilerplate, you've lost all that initial excitement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you get in one line:&lt;/strong&gt; A production-ready &lt;strong&gt;Next.js SaaS Boilerplate&lt;/strong&gt; with Type-safe i18n (6 languages) + NextAuth, Google OAuth + RBAC with parallel routes + SEO (sitemap, robots, manifest) + Theme + ESLint + Prettier + Vitest + Playwright.&lt;/p&gt;

&lt;p&gt;I've been there. Too many times. After building multiple SaaS projects, I realized I was copy-pasting the same setup code. So I built the ultimate &lt;strong&gt;Next.js starter kit&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id="why-this-nextjs-boilerplate-is-different"&gt;Why This Next.js Boilerplate is Different&lt;/h2&gt;

&lt;p&gt;Meet &lt;strong&gt;Nextjs-Elite-Boilerplate&lt;/strong&gt;: not just another "hello world" starter template, but a &lt;strong&gt;fully-featured foundation&lt;/strong&gt; that handles all the boring stuff so you can focus on building your actual product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best part? I've made this project completely open source for everyone.&lt;/strong&gt; Whether you're a student learning the ropes or a seasoned dev looking for a solid starting point, this is for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Links:
&lt;/h3&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://nextjs-elite-boilerplate.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt; | 📦 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt; | 🚀 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/generate" rel="noopener noreferrer"&gt;Use this template&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://vercel.com/new/clone?repository-url=https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Deploy on Vercel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmgm9ahn9q0db3y58bos.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmgm9ahn9q0db3y58bos.webp" alt="Leading Next.js Boilerplate Screenshot" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="key-features"&gt;Key Features of Nextjs-Elite-Boilerplate&lt;/h2&gt;

&lt;h3&gt;
  
  
  🌍 Real Internationalization (i18n) for Global SaaS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Six languages out of the box&lt;/strong&gt;: English, বাংলা, العربية, Français, Español, and 简体中文.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTL support that actually works&lt;/strong&gt;: Arabic layouts automatically flip to right-to-left.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16 Ready&lt;/strong&gt;: Fully optimized for the latest React features.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔐 Role-Based Access Control (RBAC) That Scales
&lt;/h3&gt;

&lt;p&gt;I used &lt;strong&gt;Next.js 16's parallel routes&lt;/strong&gt; to make this painless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/app/
  (protected)/
    @admin/      # Admin-only views
      dashboard/
    @user/       # User views
      dashboard/
    layout.tsx   # Smart routing logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The layout automatically shows the right dashboard based on the user's role. No messy conditionals scattered everywhere. Want to add a new role? Just create a new parallel route folder. That's it.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 UI/UX with shadcn/ui
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Components are copy-paste ready (no bloated dependencies).&lt;/li&gt;
&lt;li&gt;Full TypeScript support &amp;amp; accessible by default.&lt;/li&gt;
&lt;li&gt;Built-in Dark Mode with &lt;code&gt;next-themes&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔧 ESLint That Actually Helps (Not Annoys)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Catch real bugs&lt;/strong&gt; (unused variables, missing dependencies, potential null references)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce consistency&lt;/strong&gt; (import order, naming conventions, formatting)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eslint-config-next&lt;/code&gt; - Official Next.js rules&lt;/li&gt;
&lt;li&gt;TypeScript-specific linting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prettier&lt;/strong&gt; is wired up too. Run &lt;code&gt;npm run lint&lt;/code&gt; and &lt;code&gt;npm run prettier:fix&lt;/code&gt; for consistent, clean code.&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 SEO Configuration That's Actually Usable
&lt;/h3&gt;

&lt;p&gt;I created a single JSON configuration file that handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Graph tags&lt;/li&gt;
&lt;li&gt;Structured data (JSON-LD)&lt;/li&gt;
&lt;li&gt;Multi-language meta tags&lt;/li&gt;
&lt;li&gt;Canonical URLs&lt;/li&gt;
&lt;li&gt;Dynamic sitemap generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just edit one file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Description"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://yoursite.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"your"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"social"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"twitter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@yourhandle"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧪 Testing &amp;amp; CI
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unit and component tests&lt;/strong&gt;: Vitest + React Testing Library. Run &lt;code&gt;npm run test&lt;/code&gt; or &lt;code&gt;npm run test:watch&lt;/code&gt;; &lt;code&gt;npm run test:coverage&lt;/code&gt; for coverage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E2E&lt;/strong&gt;: Playwright in &lt;code&gt;e2e/&lt;/code&gt;. Run &lt;code&gt;npm run e2e&lt;/code&gt; (dev server starts automatically); &lt;code&gt;npm run e2e:ui&lt;/code&gt; for the UI. Use &lt;code&gt;npm run e2e:webkit&lt;/code&gt; for WebKit-only (e.g. to save disk).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI&lt;/strong&gt;: GitHub Actions – &lt;code&gt;.github/workflows/check.yml&lt;/code&gt; runs lint, Prettier, tests, and build on push/PR; &lt;code&gt;.github/workflows/playwright.yml&lt;/code&gt; runs E2E.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔑 Authentication (NextAuth.js + Google OAuth)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google OAuth&lt;/strong&gt; – enable by setting &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;, and &lt;code&gt;NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true&lt;/code&gt; in &lt;code&gt;.env&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom login page&lt;/strong&gt; at &lt;code&gt;/auth/login&lt;/code&gt; with optional "Sign in with Google"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JWT session&lt;/strong&gt; with role and user id; redirect to &lt;code&gt;/dashboard&lt;/code&gt; after sign-in&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copy &lt;code&gt;.env.example&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;, add your secrets, and you're done.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏥 Health Check
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;GET /api/health&lt;/code&gt; returns &lt;code&gt;{ status: "ok" }&lt;/code&gt; for load balancers and Kubernetes probes.&lt;/p&gt;

&lt;h2 id="how-to-get-started"&gt;How to Get Started (The Real Way)&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Clone and Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Grab the code&lt;/span&gt;
git clone https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Nextjs-Elite-Boilerplate

&lt;span class="c"&gt;# Install dependencies (use whatever you prefer)&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;span class="c"&gt;# or bun install / yarn install / pnpm install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure Your Project
&lt;/h3&gt;

&lt;p&gt;This is where most boilerplates leave you hanging. Not this one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit &lt;code&gt;src/shared/lib/config/app-main-meta-data.json&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My Awesome SaaS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Revolutionary Product That Does X"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"We help Y achieve Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://myawesomesaas.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"organization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My Company"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"hello@mycompany.com"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"social"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"twitter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@myhandle"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"github"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/myhandle"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's your entire brand configuration. One file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Customize Your Languages (Optional)
&lt;/h3&gt;

&lt;p&gt;Want to add Spanish? Here's how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;locales/es.json&lt;/code&gt; with the same structure as &lt;code&gt;locales/en.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"common"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Mi App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"navigation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"home"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Inicio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"about"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Acerca de"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update &lt;code&gt;src/shared/lib/config/app-main-meta-data.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"languages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"supported"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"locales"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Spanish"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"nativeName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Español"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"locale"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es_ES"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"direction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ltr"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;src/shared/lib/i18n/get-translations.ts&lt;/code&gt;, import &lt;code&gt;es.json&lt;/code&gt; and add &lt;code&gt;es&lt;/code&gt; to the &lt;code&gt;translations&lt;/code&gt; object. If you use strict translation keys, add the new locale to the &lt;code&gt;TranslationKeys&lt;/code&gt; union in &lt;code&gt;src/shared/lib/i18n/types.ts&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Done. Your app now speaks Spanish.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Set Up Your Roles
&lt;/h3&gt;

&lt;p&gt;The boilerplate comes with User and Admin roles. To add more:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new parallel route folder:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; src/app/&lt;span class="o"&gt;(&lt;/span&gt;protected&lt;span class="o"&gt;)&lt;/span&gt;/@moderator/dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Add your pages inside that folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update &lt;code&gt;src/app/(protected)/layout.tsx&lt;/code&gt; to handle the new role:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;moderator&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;moderator&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's genuinely all you need to do.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Run It
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:3000&lt;/code&gt; and see your fully-configured app running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Available Scripts
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start development server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Production build&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start production server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run lint&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run ESLint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run lint:fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix ESLint errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests (Vitest)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test:watch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests in watch mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run test:coverage&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tests with coverage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Playwright E2E tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e:ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Playwright with UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run e2e:webkit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;E2E in WebKit only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run prettier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check formatting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;npm run prettier:fix&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix formatting&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 6: Environment (First-Time Setup)
&lt;/h3&gt;

&lt;p&gt;Copy &lt;code&gt;.env.example&lt;/code&gt; to &lt;code&gt;.env&lt;/code&gt;. Set &lt;code&gt;NEXT_PUBLIC_APP_URL&lt;/code&gt; if you need to override the site URL (e.g. in production). For Google sign-in: set &lt;code&gt;NEXTAUTH_URL&lt;/code&gt;, &lt;code&gt;NEXTAUTH_SECRET&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt;, &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;, then &lt;code&gt;NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true&lt;/code&gt;. Optionally set &lt;code&gt;AUTH_ADMIN_EMAILS=admin@yourdomain.com&lt;/code&gt; so those emails get the admin role.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 18.17 or later&lt;/li&gt;
&lt;li&gt;npm, yarn, pnpm, or bun&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="project-structure"&gt;The Project Structure (Explained for Humans)&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
  app/
    (protected)/         # Routes behind auth (@admin, @user)
    (public)/            # Public routes (Home, About)
    auth/                # Auth-related pages (Login)
    api/                 # API routes (Auth, Health)
    layout.tsx           # Global layout &amp;amp; providers
    page.tsx             # Landing page
    ...
  shared/
    ui/                  # shadcn/ui components
    layout/              # Header, Sidebar, ThemeToggle
    components/          # Feature components
    hooks/               # Reusable hooks
    lib/                 # i18n, auth config, site metadata
locales/                 # i18n JSON files (en, bn, ar, fr, es, zh)
e2e/                     # Playwright E2E tests
.github/workflows/       # CI/CD pipelines
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2 id="out-of-the-box"&gt;What You Get Out of the Box&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Next.js 16&lt;/strong&gt; with App Router and Server Components&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;TypeScript&lt;/strong&gt; (strict mode)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Tailwind CSS&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;ESLint&lt;/strong&gt; and &lt;strong&gt;Prettier&lt;/strong&gt; (Next.js, TypeScript, a11y, format on save in .vscode)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;NextAuth.js&lt;/strong&gt; with optional Google OAuth and admin-by-email&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;i18n&lt;/strong&gt; with type safety and RTL (en, bn, ar, fr, es, zh)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;RBAC&lt;/strong&gt; with parallel routes (User / Admin)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;SEO&lt;/strong&gt; from one JSON config (metadata, sitemap, robots, manifest)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;next-themes&lt;/strong&gt; for dark mode (system + manual toggle)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;shadcn/ui&lt;/strong&gt; (accessible, customizable)&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Vitest&lt;/strong&gt; + React Testing Library for unit/component tests&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Playwright&lt;/strong&gt; for E2E in &lt;code&gt;e2e/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;GitHub Actions&lt;/strong&gt; for lint, format, test, build and E2E&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Health check&lt;/strong&gt; at &lt;code&gt;GET /api/health&lt;/code&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Vercel&lt;/strong&gt;-ready (one-click deploy from the repo)&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Talk: When Should You Use This?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Perfect for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SaaS products with multiple user types&lt;/li&gt;
&lt;li&gt;International applications&lt;/li&gt;
&lt;li&gt;Projects where you want to ship fast&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Maybe not ideal for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Projects with very specific auth requirements (you'll need to customize heavily)&lt;/li&gt;
&lt;li&gt;Apps that don't need i18n or role management&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="contributing-support"&gt;Contributing &amp;amp; Support&lt;/h2&gt;

&lt;p&gt;Found a bug? Want to add a feature? The repo is fully open source:&lt;/p&gt;

&lt;p&gt;🐛 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/issues" rel="noopener noreferrer"&gt;Report issues&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
⭐ &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Star on GitHub&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🤝 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/pulls" rel="noopener noreferrer"&gt;Submit a PR&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id="final-thoughts"&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;I built this because I got tired of setting up the same infrastructure for every project. Now that it's open source, I hope it helps you ship your next big idea even faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's your biggest pain point when starting a new Next.js project?&lt;/strong&gt;&lt;br&gt;
Drop a comment below; I'm always looking to improve this.&lt;/p&gt;

&lt;p&gt;Happy building! 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Links:
&lt;/h3&gt;

&lt;p&gt;🔗 &lt;strong&gt;&lt;a href="https://nextjs-elite-boilerplate.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt; | 📦 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/strong&gt; | 🚀 &lt;strong&gt;&lt;a href="https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate/generate" rel="noopener noreferrer"&gt;Use this template&lt;/a&gt;&lt;/strong&gt; | &lt;strong&gt;&lt;a href="https://vercel.com/new/clone?repository-url=https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate" rel="noopener noreferrer"&gt;Deploy on Vercel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>boilerplate</category>
      <category>saas</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
