惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
D
Docker
S
SegmentFault 最新的问题
博客园 - 聂微东
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
L
LangChain Blog
Vercel News
Vercel News
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
T
Threat Research - Cisco Blogs
T
Threatpost
Scott Helme
Scott Helme
T
Tailwind CSS Blog
Latest news
Latest news
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
The Register - Security
The Register - Security
罗磊的独立博客
P
Proofpoint News Feed
腾讯CDC
S
Schneier on Security
雷峰网
雷峰网
A
About on SuperTechFans
T
Tenable Blog
F
Full Disclosure
Cyberwarzone
Cyberwarzone
博客园_首页
有赞技术团队
有赞技术团队
K
Kaspersky official blog

DEV Community

We Trusted Auto-Ack. The Queue Agreed. Our Costs Didn't. DevOps for Developers: Reducing Cognitive Load and Boosting Transparency Python pytest: Write Tests That Actually Help You I built a free streaming site from scratch — no ads, no framework, no BS Beyond Static Prompts: How to Build Self-Improving AI Agents with Closed-Loop Skill Playbooks How I Taught My Incident Alerts to Say "This Broke 3 Minutes After Your Last Deploy" Why I Stopped Treating Job Applications as My Only Career Strategy Stop Watching Tutorials, Start Coding: How I Built CodeQuizz, an AI-Powered Active Learning Engine How We Generate 300+ AI Business Ideas a Month With GPT-5 (and Filter the Junk Out) The Intent Layer Your AI Coding Agent Does Not Need a Bigger Prompt How I solved a problem in my house using with an AI-powered application! Structure: A Local-First Interview IDE Powered by Gemma 4 Build in public, month 2: 615 of 616 visitors never clicked anything Someone wrote a fake EULA into Bitcoin. Two hours later they revoked it. Insights of Git ( part : 1 ) Someone wrote a fake EULA into Bitcoin. Two hours later they revoked it. Payload CMS Has 508 Circular Dependencies. Next.js Has 17. Here's Why They Form in Every Large JS Codebase. Prompt Packs Are Dead. Long Live Skills Why I Started Building a Portfolio Tracker Senior developer" after 3 years is title laundering Stripe Webhook Idempotency in FastAPI: Handling Duplicate Events Without Double-Charging SaaS Customers What Happens Before Your C Program Reaches the CPU? FinOps for Startups: How to Keep Your AWS Bill Under $100/Month Configuring CORS in Azure API Management How RBI Quietly Created a New Billion Dollar Industry in International Payments Time Need To Rearrange Binary String I Updated My GitHub Auto-Commit Desktop App I Have Reviewed Over 400 Resumes for Tech roles. Here Is What Actually Gets You the Phone Screen [Boost] Awesomeness! We built a lightweight, 100% local File Integrity Monitor (FIM) with zero telemetry Building chart() for Tala: From Raw Indicator Data to Something You Can Actually Inspect A client-side secret scanner that physically can't exfiltrate your code (and why you shouldn't trust mine either) Your AI Agent Should Text You First Built free app for game design and worldbuilding You Have a Free AI Model Sitting in Chrome Right Now I created a fork of GunDB and rewrote it in TypeScript using Vibe Code 6 Advanced JavaScript Questions That Separate Seniors from Mid-Levels Claude Does Not Need More Prompts. It Needs Reasoning Discipline. An Introduction to AI Hub, Part 2: Custom MCP Servers I built a RAG pipeline from scratch — no LangChain, just FastAPI + FAISS How I built a dependency risk scanner with Coral in 7 days Local-first: a Model on Your Own Machine, Zero Cloud 2487. Remove Nodes From Linked List C_STD : A Leak-Free, Cross-Platform Standard Library for Modern C How to build your professional network as a developer — authentic strategies The Pope and the Dynamo Building ShouldWeAutomate: A Decision Intelligence Platform for Workflow Automation The Reputation Layer: Why Developers Quietly Run Corporate PR The Last Mile of Software Is a Sentence AppView 1.0.0 Released: Instrument and Secure Your LLM Deployments The Hermes Rescue: How an Open Agent Rebuilt My GitHub Projects from Scratch S2 — Heap Corruption Crashes: How to Diagnose and Fix Them I built a Chrome extension because I couldn't stop opening Twitter between Pomodoro sessions AI cheating in technical interviews is invisible to interviewers — here's how we detect it Lean4 Might Be the Missing Piece in AI: Why Theorem Provers Are Suddenly Everywhere The Zero-Drift API Series: Stop Trusting a Green Build You Can't Explain How I Deployed My First Project on AWS (And Didn't Break Everything) How I Built a Real-Time Quiz Platform with Next.js, WebSockets, and Learning Science When Your VPS Blocks Outbound SMTP: What Actually Helps Los agentes de código necesitan memoria durable, no solo contexto Cognitive Architectures of AGI: 7 Patterns That Transform LLMs from Oracles into Thinkers I Built a Chat App That Deletes Itself (Because I Was Bored at 2am) Uncovering the Power of Linux's History Command How to Add a Contact Form to Your Ghost Blog Accept Payments in Minutes with Afriex Checkout Sessions Hermes Agent Gets Smarter Every Day. So Does the Bill. How I get Next.js sites to load almost instantly — a practical checklist Treasure Hunt Engine: Why One Bad Prometheus Rule Sank the Whole Veltrix Event Test a DNS Leak in 2 Minutes: Complete Methodology + Per-OS Fixes (2026) Lessons from building a Chrome extension Rivet: A library i made in 2 days I Built a Speech-to-Text Tool Because Sometimes Typing Just Gets in the Way How I'm Building a Multi-Agent Crew for AI Coding Supervision (Cipher Update) Your AI Agent Needs a Manager, Not a Superhero I Built CausalLens — A Free, Open-Source Causal Impact Calculator for Time Series (5 Methods, Zero Setup) How to write good commit messages and pull requests — a team guide Cipher: The Jarvis with a Hermes Core How to build a second brain with Obsidian and Claude Code (step by step) Claude completed my MPI assignment. Then it couldn't run it. So I built the missing piece. This 100% How Our Document Ingestion Pipeline Turns Files into LLM-Ready Markdown Agentic AI Model Risk Management: Aligning with Regulatory Expectations CTV Fraud Has an IPv6 Business Problem The great AI enshittification The Veltrix Treasure Hunt Engine: Why Our First Rewrite Cost Us 3.2 Million Requests Per Second I Made My AI Models Argue, Then Let Hermes Be the Judge Road To KiwiEngine #4: The Racecar Driver Analogy Run Aider on Ollama, Bedrock, or Any LLM Provider — One Gateway, Every Model BAIXAR VÍDEO DO YOUTUBE Releasing HeliosProxy, The programmable Postgres data-plane Hello, DEV Community! 👋 Three Bitcoin Primitives That Don't Exist Anywhere Else (PoW Beacon, DLC Oracle, Fair-Launch Rune) Append-only doesn't mean what you'd hope Notes from the Mistral AI Now Summit Are Claude skills safe in 2026? What the Snyk ToxicSkills audit actually found How to not Lose $500M via API Bills: Run Private AI for 100 Engineers Under $1 Million The Unlikely Journey from Bricks to Bytes Three TODOs, three weeks, one weekend: finishing pq v0.14
Next.js SaaS Boilerplate with BetterAuth, RBAC, i18n & Production-Ready Setup
Salman Shahriar · 2026-05-31 · via DEV Community

Every time I started a new Next.js project, I lost the first week to setup.

Authentication. Internationalization. Role-based access. SEO meta tags. Environment validation. Error monitoring. Linting. Testing. CI pipelines.

By the time I had a working foundation, the excitement was gone, buried under config files and boilerplate glue code.

After doing this across multiple SaaS projects, I stopped and asked myself: What if I built the foundation once, properly, and never had to do it again?

So I did. Then I rebuilt it from scratch with a feature-sliced architecture and a clearer frontend-first scope.

The result is Nextjs-Elite-Boilerplate (v0.3.0): a production-ready, frontend-first Next.js 16 starter that's MIT-licensed and open source.

🔗 Live Demo · 📦 GitHub Repo · 🚀 Use This Template · Deploy on Vercel

Next.js Elite — production-ready SaaS boilerplate cover

Next.js Elite Boilerplate — Open Graph preview


Table of Contents

  1. Why Another Boilerplate?
  2. What Makes This One Different
  3. Honest Caveats (So You Know What You're Getting)
  4. The Full Feature Breakdown
  5. Lighthouse? All 100s.
  6. Getting Started in 5 Minutes
  7. Production Checklist
  8. The Project Structure (For Humans)
  9. Everything You Get Out of the Box
  10. Who Should Use This (and Who Shouldn't)
  11. Contributing
  12. Final Thoughts

Why Another Boilerplate?

I know what you're thinking. The world doesn't need another Next.js starter.

Honestly? Most of the time, you'd be right. Most starters fall into two camps:

  1. Too bare. A create-next-app with a theme toggle and a "TODO: add auth here" comment.
  2. Too opinionated. Ships with a Prisma schema, a specific database, and an ORM you didn't ask for, tightly coupling you to decisions you haven't made yet.

I wanted something in between: a frontend-first foundation that handles auth, roles, i18n, SEO, forms, data fetching, error monitoring, and developer tooling, but doesn't force a database on you. You bring your own API (REST, GraphQL, BFF, whatever), and this boilerplate handles everything else.

That's what Next.js Elite is. And it's free, MIT-licensed, and open source.


What Makes This One Different

Here's what you get with a single git clone:

  • Next.js 16 + React 19 with App Router and Server Components
  • BetterAuth with email/password and optional Google OAuth
  • Permission-based RBAC using parallel routes (@admin, @user)
  • Type-safe i18n via next-intl: 6 languages, RTL, cookie-based locale, compile-time checked keys
  • T3 Env for Zod-validated environment variables (server + client split)
  • TanStack Query + ofetch (apiFetch) for API data fetching with Zod response parsing
  • React Hook Form + Zod for forms with shared validation schemas
  • Sentry for error monitoring, pino for server logging
  • Optional Upstash helpers for rate limiting (when env vars are set)
  • Vitest + Playwright for unit and E2E testing
  • Lefthook + Commitlint + Knip for automated code quality
  • One JSON file drives SEO, sitemap, robots.txt, and manifest config
  • Demo mode for instant previews on the login page
  • Docker + Vercel deployment ready (output: 'standalone')

And the Lighthouse scores? Well...


Honest Caveats (So You Know What You're Getting)

The homepage hero cards describe what ships today. These six caveats match those cards and what the repo actually does — no overselling.

  1. Modern stack, lean setup — API-driven by design: no ORM or database layer. The example users client expects your /api/users or an external API; no mock DB is included.

  2. BetterAuth — Auth works out of the box for local and demo use. For multi-instance production, configure a Better Auth storage adapter so sessions persist across instances (BetterAuth defaults are not shared across nodes).

  3. Parallel routing@user / @admin slots share /dashboard, but permissions are starter-grade RBAC (two roles, email allowlist for admin). Extend roles in your backend when you need multi-tenant or org-level access.

  4. Type-safe i18n — Locale lives in a cookie (NEXT_LOCALE; no /en or /fr URL prefixes): simpler UX, not path-prefixed locales for multilingual SEO.

  5. SEO + PWA, server-first — Metadata, sitemap, robots, and JSON-LD come from site.config.json. Replace placeholder org/domain values before you ship.

  6. Developer experience — CI runs typecheck → lint → knip → test → build. Test coverage is starter-level (RBAC/i18n unit tests + light E2E). Optional getRateLimiter() exists in src/libs/rate-limit.ts but is not wired to auth or API routes by default.


Lighthouse? All 100s.

This isn't just "good enough for a starter." The boilerplate scores 100 across all four Lighthouse categories: Performance, Accessibility, Best Practices, and SEO, right out of the box.

Lighthouse report showing perfect 100 scores in Performance, Accessibility, Best Practices, and SEO

No tricks. No deferred audits. That's the production build, tested against the live demo at nextjs-elite-boilerplate.vercel.app.

Most boilerplates treat performance as an afterthought. Here, it's baked in from day one: server components by default, client components only where needed, semantic HTML, proper heading hierarchy, and optimized asset loading.


The Full Feature Breakdown

Let's walk through every major system. I'll cover what it does, why I chose it, and how it works in this codebase.

Authentication: BetterAuth

Auth is built on BetterAuth, exposed at /api/auth/* via src/app/api/auth/[...all]/route.ts.

Here's what you get:

  • Email/password sign-up and login — works immediately
  • Google OAuth — set GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET and NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true
  • Server-side session readsgetCurrentUser() in Server Components; client uses authClient.useSession() via the auth provider
  • Admin role mapping — comma-separated emails in AUTH_ADMIN_EMAILS / NEXT_PUBLIC_AUTH_ADMIN_EMAILS

Sessions use BetterAuth's default storage. For production on multiple instances, plug in a database or Redis adapter — see the BetterAuth docs.

Demo mode lives in src/features/auth/demo/. With NEXT_PUBLIC_DEMO_MODE=true, the login page shows click-to-fill credentials and auto-registers seed accounts on first sign-in:

Role Email Password
User user@test.com 12345678
Admin admin@test.com 12345678

Going to production? Set the flag to false, or delete the demo/ folder. Nothing else imports it except the login flow.

RBAC: Permissions, Not Just Roles

Most boilerplates give you if (role === 'admin') checks scattered across your code. That doesn't scale.

Next.js Elite uses permission-based RBAC. Each role maps to permissions; pages check permissions, not raw role strings:

import { requirePermission } from '@/features/auth/rbac/require';

const AdminDashboardPage = async () => {
  const user = await requirePermission('dashboard.view:admin');
  return <h1>Welcome back, {user.email}</h1>;
};

Enter fullscreen mode Exit fullscreen mode

Invalid sessions redirect to /login. Insufficient permissions redirect to /unauthorized.

The routing layer uses Next.js parallel routes:

src/app/(protected)/
  @admin/dashboard/    → Admin sees this
  @user/dashboard/     → Regular users see this
  layout.tsx           → Picks the right slot based on permissions

Enter fullscreen mode Exit fullscreen mode

Today there are two roles (user, admin) and two dashboard permissions. Admin is granted via email allowlist, not a database role table — extend rbac/roles.ts and your backend when you outgrow that.

Internationalization: next-intl with Type Safety

The boilerplate uses next-intl with:

  • Cookie-based locale (NEXT_LOCALE) — no /en/ or /fr/ URL prefixes
  • 6 languages out of the box: English, বাংলা, العربية (full RTL), Français, Español, 简体中文
  • Compile-time type checkingt("navigation.home") autocompletes; typos fail the build

Translation files live in messages/. Add a language in site.config.json, create messages/<locale>.json, and the runtime picks it up.

SEO: One Config File

SEO is driven by src/features/site/site.config.json, validated with Zod in src/features/site/config.ts.

That one file drives:

  • Open Graph and Twitter Card meta tags
  • JSON-LD structured data (Organization, WebSite, SoftwareApplication)
  • Dynamic sitemap and robots.txt
  • PWA web app manifest
  • Canonical URLs and theme colors
{
  "appName": "My SaaS",
  "domain": "https://mysaas.com",
  "title": "My SaaS — Do X Better",
  "description": "We help Y achieve Z.",
  "organization": {
    "name": "My Company",
    "url": "https://mysaas.com"
  },
  "images": { "og": "/og-image.webp" }
}

Enter fullscreen mode Exit fullscreen mode

Data Fetching: ofetch + TanStack Query

The API layer uses ofetch via apiFetch in src/libs/api-client.ts (defaults to same-origin /api) and TanStack Query on the client.

The users feature is a copy-paste pattern — you implement /api/users or point NEXT_PUBLIC_APP_URL at your backend:

import { useUsers } from '@/features/users/hooks/use-users';

const { data, isLoading } = useUsers();

Enter fullscreen mode Exit fullscreen mode

// src/features/users/api.ts
export async function getUsers(): Promise<User[]> {
  return apiFetch('/users', { schema: userListSchema });
}

Enter fullscreen mode Exit fullscreen mode

Forms: React Hook Form + Zod

Every auth form uses React Hook Form with Zod resolvers. Schemas live in src/features/auth/schemas/:

import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { loginSchema, type LoginInput } from '@/features/auth/schemas/login';

const form = useForm<LoginInput>({
  resolver: zodResolver(loginSchema),
  defaultValues: { email: '', password: '' },
});

Enter fullscreen mode Exit fullscreen mode

Environment Variables: T3 Env

@t3-oss/env-nextjs + Zod validates server and client env vars at build time. SKIP_ENV_VALIDATION=true is supported for CI and Docker builds. A missing BETTER_AUTH_SECRET in production logs a warning at runtime (placeholder only for local dev).

UI: shadcn/ui + Tailwind CSS v4

shadcn/ui (Radix + CVA + Tailwind v4). Components live in src/components/ui/ — copy and own them.

Dark mode uses a lightweight custom theme provider in src/features/theme/ (system / light / dark) with a toggle in the header — no next-themes dependency.

Observability: Sentry + pino + Rate Limiting

  • Sentrysrc/instrumentation.ts (server) and src/instrumentation-client.ts (client). Set SENTRY_DSN / NEXT_PUBLIC_SENTRY_DSN.
  • pino — structured server logging in src/libs/logger.ts.
  • @upstash/ratelimit — optional getRateLimiter() / isRateLimited() in src/libs/rate-limit.ts when UPSTASH_REDIS_* is set. Wire it into your route handlers where you need protection.

Testing: Vitest + Playwright

  • Unit tests: Vitest + React Testing Library. Specs in tests/ (auth, i18n) and colocated *.test.tsx under src/components/ui/ and src/libs/.
  • E2E: Playwright in e2e/ — home, health check, login page smoke tests. Run npm run e2e (config: e2e/playwright.config.ts).
  • CI: .github/workflows/check.yml (typecheck → lint → knip → test → build) and playwright.yml for E2E.

Developer Experience: The Full Pipeline

  • Lefthook — pre-commit lint/format, commit-msg Commitlint
  • Knip — unused files, exports, and dependencies
  • Renovate — automated dependency updates (.github/renovate.json)
  • ESLint 9 flat config + Prettier (Tailwind class sorting)
  • Vercel Analytics — included in the root layout

proxy.ts is a pass-through middleware placeholder — auth and locale are handled in Server Components and next-intl request config, not at the edge.


Getting Started in 5 Minutes

Prerequisites: Node.js 20.9+, npm / pnpm / yarn / bun.

1. Clone and install

git clone https://github.com/salmanshahriar/Nextjs-Elite-Boilerplate.git
cd Nextjs-Elite-Boilerplate
npm install

Enter fullscreen mode Exit fullscreen mode

2. Set up environment

cp .env.example .env

Enter fullscreen mode Exit fullscreen mode

Key variables (see .env.example for the full list):

  • BETTER_AUTH_SECRET — 32+ chars in production (openssl rand -base64 32)
  • BETTER_AUTH_URL — optional; auto-derived on Vercel
  • NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true + Google credentials for OAuth
  • NEXT_PUBLIC_DEMO_MODE=true for instant test accounts
  • SKIP_ENV_VALIDATION=true for CI/Docker when secrets aren't available yet

3. Brand it

Edit src/features/site/site.config.json — app name, domain, SEO, social links, locales.

4. Add languages (optional)

Add the locale to site.config.json, create messages/<locale>.json.

5. Run

npm run dev

Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000.

All available scripts

Command What it does
npm run dev Dev server
npm run build Production build
npm run start Production server
npm run analyze Bundle analysis (ANALYZE=true)
npm run typecheck tsc --noEmit
npm run lint ESLint + Prettier check
npm run lint:fix Auto-fix lint + format
npm run knip Dead code / dependency detection
npm run check typecheck + lint + knip + test (CI gate)
npm run test Vitest run (config/vitest.config.ts)
npm run test:watch Vitest watch
npm run e2e Playwright E2E
npm run e2e:ui Playwright UI mode
npm run e2e:webkit WebKit-only E2E

Deploy

Vercel (one click):

Deploy with Vercel

Docker:

docker build -t nextjs-elite .
docker run --rm --env-file .env -p 3000:3000 nextjs-elite
# or: docker compose up --build

Enter fullscreen mode Exit fullscreen mode


Production Checklist

Before you ship:

  1. Set a strong BETTER_AUTH_SECRET (32+ characters).
  2. Configure a Better Auth storage adapter for multi-instance deploys.
  3. Set NEXT_PUBLIC_DEMO_MODE=false or remove src/features/auth/demo/.
  4. Implement /api/users (or your real API) for features that call apiFetch.
  5. Update site.config.json — real domain, org, and OG image (not placeholders).
  6. Optionally enable Sentry and Upstash rate limiting on sensitive routes.

The Project Structure (For Humans)

Feature-sliced architecture: each feature owns its components, hooks, schemas, and server logic. Cross-cutting infra lives in libs/.

.
├── .github/workflows/        check.yml + playwright.yml
├── config/                   vitest.config.ts, vitest.setup.ts
├── e2e/                      Playwright specs + playwright.config.ts
├── messages/                 Translation files (en, bn, ar, fr, es, zh)
├── tests/                    Vitest specs (auth, i18n)
├── proxy.ts                  Middleware (pass-through)
├── lefthook.yml              Git hooks
├── knip.json                 Dead-code config
├── src/
│   ├── app/                  App Router
│   │   ├── (auth)/           Login, register, password reset
│   │   ├── (public)/         Marketing pages
│   │   ├── (protected)/      Auth-gated area
│   │   │   ├── @admin/       Admin dashboard slot
│   │   │   ├── @user/        User dashboard slot
│   │   │   └── layout.tsx    Permission-based slot picker
│   │   ├── api/              BetterAuth + health
│   │   ├── layout.tsx        Root layout + SEO
│   │   └── providers.tsx     Theme + Auth + Query
│   ├── components/
│   │   ├── shared/           Hero, logo, home sections
│   │   └── ui/               shadcn/ui primitives
│   ├── features/
│   │   ├── auth/             BetterAuth, RBAC, demo mode
│   │   ├── i18n/             next-intl config
│   │   ├── navigation/       Header + Sidebar
│   │   ├── site/             site.config.json + Zod parser
│   │   ├── theme/            Custom theme provider
│   │   └── users/            Example API + hooks
│   └── libs/                 env, api-client, logger, rate-limit, utils
└── package.json              scripts; Prettier + Commitlint config

Enter fullscreen mode Exit fullscreen mode

Key conventions:

  • features/<name>/ — vertical slices
  • libs/ — cross-cutting infra, no business logic
  • components/ui/ — shadcn primitives; extend, don't fight the CLI
  • schemas/ — shared Zod schemas (e.g. API responses)

Everything You Get Out of the Box

✅ Next.js 16 + React 19 (App Router, Server Components)
✅ TypeScript 5.9 (strict)
✅ Tailwind CSS v4
✅ BetterAuth (email/password + optional Google OAuth)
✅ Permission-based RBAC with parallel routes
✅ next-intl (6 languages, RTL, type-safe, cookie-based)
✅ T3 Env (Zod-validated server + client env vars)
✅ TanStack Query + ofetch (apiFetch + Zod parsing)
✅ React Hook Form + Zod (auth forms + shared schemas)
✅ SEO suite (OG, Twitter Cards, JSON-LD, sitemap, robots, manifest)
✅ Custom theme provider (light / dark / system)
✅ shadcn/ui (Radix + CVA + Tailwind)
✅ Sentry (server + client instrumentation)
✅ pino (structured server logging)
✅ Optional Upstash rate limiting helpers
✅ Vitest + React Testing Library
✅ Playwright E2E
✅ Lefthook + Commitlint
✅ Knip (dead-code hygiene)
✅ ESLint + Prettier
✅ GitHub Actions CI + Playwright workflow
✅ Docker + Docker Compose (standalone output)
✅ Demo mode (isolated src/features/auth/demo/)
✅ Health check (GET /api/health)
✅ Renovate + Vercel Analytics
✅ Vercel one-click deploy


Who Should Use This (and Who Shouldn't)

This is a good fit if you're building:

  • A SaaS product with multiple user roles
  • An internationalized app (especially with RTL requirements)
  • A frontend that consumes an existing API or BFF
  • A project where you want auth, RBAC, i18n, and DX tooling on day one without inheriting a database

Probably not the right choice for:

  • A single-page landing site (more than you need)
  • An app that needs a tightly-coupled database layer in the same repo (this is intentionally API-only)
  • Enterprise RBAC with orgs, teams, and dynamic roles in the DB (start here, extend in your backend)

Contributing

The project is fully open source and contributions are welcome:

  1. Fork and branch from main (feat/..., fix/...)
  2. Run npm run check — it must pass
  3. Use Conventional Commits (Lefthook enforces this)
  4. Open a PR with a clear description

🐛 Report a bug · ⭐ Star on GitHub · 🤝 Submit a PR


Final Thoughts

I built the first version because I was tired of repeating myself. Then I rebuilt it with feature-sliced folders, BetterAuth, type-safe env and i18n, parallel-route dashboards, and a DX pipeline (Lefthook, Knip, Vitest, Playwright) that matches what I actually run before every push.

The goal was never the biggest starter kit. It was the one I want on day one of a SaaS frontend — and still trust on day one hundred, with a backend I chose myself.

If it saves you a week of glue code, it was worth open-sourcing.

What's your biggest pain point when starting a new Next.js project? Drop a comment — I'm always looking for improvements that stay frontend-first.

Happy building. 🚀


🔗 Live Demo · 📦 GitHub · 🚀 Use Template · Deploy on Vercel