How the load-bearing pieces actually work
Deep-dive explainers on the load-bearing pieces of the SaaSForge templates: how multi-tenant architecture works in Postgres, how the RAG pipeline ingests and retrieves, how the credit economy survives Stripe's webhook lifecycle. Each page links to the product that ships it.
All feature deep-dives
SaaSForge Core
Multi-tenant architecture for Next.js B2B SaaS
Multi-tenant architecture in a Next.js SaaS means workspaces are the isolation boundary in Postgres (enforced via RLS), users belong to workspaces with explicit roles, and every read or write is scoped at the database, not the application. SaaSForge Core ships this pattern with four-role RBAC, 2FA, SAML SSO hooks, API keys, and audit logs.
Read the deep-diveSaaSForge AI
RAG pipeline in a Next.js SaaS with Supabase pgvector
A retrieval-augmented generation pipeline ingests documents (uploads), splits them into chunks, embeds the chunks with a model, stores the embeddings in pgvector inside Supabase Postgres, and on each chat turn retrieves the top-k chunks by cosine similarity to ground the LLM's answer. SaaSForge AI ships this end-to-end with Claude and OpenAI as interchangeable providers, plus credit metering tied to real token usage.
Read the deep-diveSaaSForge AI
Stripe credits system for usage-based AI SaaS billing
A credit system meters product usage (typically tokens for AI products) against a balance reset by a Stripe subscription. Each user action, chat turn, embedding, image generation, debits credits proportional to its real cost; the subscription's monthly cycle resets the balance via Stripe webhooks. SaaSForge AI ships this pattern end-to-end with idempotent webhook handling, monthly reset cron-friendly endpoints, and clean separation between metering and UI.
Read the deep-diveSaaSForge Core
Postgres RLS multi-tenant boilerplate for Next.js + Supabase
A Postgres RLS boilerplate puts tenant isolation in the database, not the application. Every domain table carries a workspace_id and an RLS policy that joins the authenticated user's JWT against the workspace_members table. SaaSForge Core ships this pattern with paired table-plus-policy migrations, so adding a tenant-scoped table never leaves an isolation gap in code review.
Read the deep-diveSaaSForge Starter
Supabase Auth boilerplate for Next.js (magic link + Google OAuth)
A Supabase Auth boilerplate for Next.js ships magic-link email sign-in, Google OAuth, and a protected dashboard out of the clone. SaaSForge Starter has the minimal version; SaaSForge AI, Core, and Agency layer credits, workspaces, and CMS on top. All four use the same Supabase client pattern, so upgrading between tiers does not mean rewriting auth.
Read the deep-diveSaaSForge Agency
next-intl multilingual boilerplate (EN / FR / ES) for Next.js
A next-intl boilerplate gives you locale-prefixed routing, server-rendered translations, and per-locale SEO metadata in one Next.js App Router setup. SaaSForge Agency ships this with English, French, and Spanish locales, message catalogues for UI strings, and Directus CMS translations for content. Adding a fourth locale is a config edit plus a translation pass, not a routing rewrite.
Read the deep-diveSaaSForge Core
The Next.js SaaS boilerplate catalogue (Starter, AI, Core, Agency)
BoilerlyKit ships four Next.js 16 boilerplates: Starter for content and landing sites, AI for assistants with RAG and credits, Core for B2B multi-tenant with RBAC and Stripe subscriptions, and Agency for multilingual agency marketing sites with Directus CMS. Pick by what your product needs on day one rather than by which is the most ambitious template.
Read the deep-diveSaaSForge Core
Stripe SaaS boilerplate for Next.js (subscriptions + credits)
BoilerlyKit covers Stripe two ways: SaaSForge Core ships subscriptions with three tiers, customer portal, and full webhook lifecycle handling for a B2B SaaS. SaaSForge AI extends that with a token-metered credit economy on top of subscriptions for usage-based AI billing. Both share idempotent webhook handlers, customer portal integration, and clean separation between billing state and product code.
Read the deep-diveSaaSForge Starter
Tailwind v4 starter for Next.js 16 with oklch theme tokens
Tailwind v4 ships a new CSS-first config and a faster engine. BoilerlyKit's Starter, AI, and Core templates use v4 with oklch color tokens, semantic color scales, and shadcn/ui components updated for the new engine. SaaSForge Agency is on Tailwind v3 because Directus's admin theming integrates more cleanly with v3, that gap is documented, not glossed over.
Read the deep-diveSaaSForge Starter
MDX blog template for Next.js (with docs, RSS, and JSON-LD)
All four BoilerlyKit templates ship an MDX blog and MDX docs surface. Posts and docs are .mdx files with frontmatter; the renderer handles breadcrumbs, BlogPosting and TechArticle JSON-LD, canonical URLs, an RSS 2.0 feed, and full sitemap entries. No CMS, no vendor coupling, content is git-versioned alongside code, with ISR for incremental updates.
Read the deep-diveSaaSForge AI
AI SaaS starter for Next.js, chat, RAG, credits, Stripe
An AI SaaS starter is more than a chat demo. SaaSForge AI combines streaming chat against Claude and OpenAI, a document-upload RAG pipeline on Postgres pgvector, a credit metering system tied to real token usage, Stripe subscriptions with webhook handling, and Supabase Auth. The four pieces compose into a complete AI product foundation, not a tutorial-grade prototype.
Read the deep-diveSaaSForge Core
B2B SaaS template for Next.js, workspaces, RBAC, audit, SSO
A B2B SaaS template needs the boring enterprise features that close deals, workspaces, roles, audit, SSO, not just a polished landing page. SaaSForge Core ships workspaces as a Postgres RLS boundary, four-role RBAC (Owner/Admin/Member/Viewer), audit logs on mutations, TOTP 2FA, SAML SSO hooks, API keys with masking, and support impersonation, so procurement reviews do not stall on missing primitives.
Read the deep-diveSaaSForge Core
Supabase 2FA / TOTP for Next.js SaaS
Supabase 2FA in a Next.js SaaS means TOTP via an authenticator app: the user enrols a factor (Supabase generates a secret and QR code), verifies it with a six-digit code, then satisfies an MFA challenge on each future sign-in. Supabase Auth ships the primitives; SaaSForge Core wires the React enrolment, challenge, and recovery-code UI on top.
Read the deep-diveSaaSForge Core
SAML SSO in Next.js (Supabase + enterprise IdPs)
SAML SSO in a Next.js SaaS means your app is the Service Provider (SP) and the customer's identity provider (Okta, Azure AD, Google Workspace) is the IdP. The IdP authenticates the user and posts a signed SAML assertion to your Assertion Consumer Service (ACS) endpoint, which maps the assertion attributes to a workspace member. SaaSForge Core ships SAML-ready hooks today; the dedicated SaaSForge SAML SSO Kit module handles the full IdP plumbing.
Read the deep-diveSaaSForge Core
Resend transactional email for Next.js SaaS
Resend is the transactional email layer across the BoilerlyKit templates: workspace invitations and member lifecycle on SaaSForge Core, Stripe billing receipts on AI and Core, contact-form notifications on Agency, and Supabase magic-link parity on Starter. React Email handles the templates, DKIM and SPF handle deliverability, and webhooks handle bounces, so transactional mail is not a sprint after launch.
Read the deep-diveSaaSForge Agency
Directus headless CMS + Next.js for agencies
Directus is a self-hosted headless CMS that exposes your Postgres schema as a typed API plus an admin UI for non-developers. SaaSForge Agency pairs Directus 11 with Next.js 16 for agency marketing sites, services, case studies, and blog posts editable by clients, fetched with revalidation from Server Components. Directus is exclusive to the Agency template; Starter, AI, and Core are config-driven without a CMS.
Read the deep-diveSaaSForge AI
ChatGPT clone boilerplate for Next.js (threads, messages, streaming)
A ChatGPT clone boilerplate is a Next.js app whose unit of interaction is a conversation thread with persisted messages and streaming model responses. SaaSForge AI ships this pattern: thread list in the sidebar, message turns persisted in Supabase, streaming via the Vercel AI SDK against Claude or OpenAI, edit and regenerate flows, and provider switching as a config flag rather than a rewrite.
Read the deep-diveSaaSForge AI
AI chatbot Next.js template (support, FAQ, embedded widget)
An AI chatbot Next.js template is the customer-facing flavour of an AI app: a chat surface trained on your knowledge base that answers visitor or end-user questions with citations. SaaSForge AI supplies the substrate (chat, RAG, auth, credits), so building a support or FAQ chatbot becomes ingesting the right corpus, scoping retrieval, tuning the system prompt, and surfacing the widget where customers can find it.
Read the deep-diveSaaSForge Agency
Directus multilingual template for Next.js agency sites (EN / FR / ES)
A Directus multilingual template pairs a self-hosted CMS with locale-prefixed Next.js routing so editors translate content in admin while developers maintain UI strings in code. SaaSForge Agency ships this combination across English, French, and Spanish: Directus's native translations layer handles services and case studies, next-intl handles nav and form copy, and per-locale metadata keeps each language indexing cleanly.
Read the deep-diveSaaSForge Starter
Next.js theme system with oklch tokens, dark mode, and white-label primitives
A Next.js theme system in BoilerlyKit means every color, radius, and shadow is a CSS custom property in `globals.css`, defined in oklch for perceptual uniformity. Components read semantic tokens (`--primary`, `--muted`, `--destructive`), not raw values. Light and dark palettes each live in a single block; rebranding the site is a token edit, not a component refactor.
Read the deep-diveSaaSForge Starter
SaaS landing page template for Next.js (hero, features, pricing, CTA)
A SaaS landing page template is a Next.js page wired for conversion: hero with stats and CTA, features grid, integrations strip, testimonials, pricing table, FAQ, and a closing CTA. SaaSForge Starter ships this as the homepage, with every section driven by typed config under `src/config/ui/`. Rebrand the entire page in one afternoon, no full SaaS stack required.
Read the deep-diveFour templates. One purchase decision.
Starter for a polished shell. AI for streaming chat and RAG. Core for multi-tenant B2B. Agency for multilingual marketing sites.