SuperAPIAI Directory

nextjs-saas-starter-kit

github.com · Other AI tools

OpenStarterKit is an open-source, MIT-licensed Next.js SaaS starter kit, with the repository name nextjs-saas-starter-kit. It pre-wires authentication, Stripe payments, a Prisma/PostgreSQL database, an admin dashboard, transactional email, internationalization, a blog and docs, demo mode, tests, and CI, with the goal of letting developers build and ship a SaaS product on top of it. The project is based on Next.js 16 App Router, React 19, TypeScript, and Tailwind CSS v4, uses plain Next.js and PostgreSQL, and can be self-hosted with control over your data. The free tier already includes full Stripe Checkout, Customer Portal, and webhooks, and does not put payments behind a paid plan. The materials do not provide AI features, specific pricing, or complete clone/install commands.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

Use case positioning OpenStarterKit (repository nextjs-saas-starter-kit) is a free, open-source Next.js SaaS starter kit aimed at developers who need to quickly build subscription-based SaaS. It provides production-grade foundational capabilities such as authentication, payments, an admin dashboard, and email that are already wired up, and its official description is “ship your product this weekend.” The project uses the MIT license, can be used commercially, and has no license key or unlock fee. It emphasizes using plain Next.js: there is no compiler, configuration DSL, or proprietary CLI; App Router, Server Actions, and Prisma work according to their respective documentation; underneath is plain PostgreSQL, and it can be deployed on any host that supports Node.js while you retain control of your data.

Main capabilities Authentication and accounts: uses Better Auth, supports Google and GitHub OAuth, magic links, email and password login, and self-hosted two-factor authentication. Sessions are stored in your own database, with no dependence on an auth vendor and no per-user pricing that grows with users.

Payments and billing: the free kit includes full Stripe Checkout, Customer Portal, and signature-verified webhooks, rather than placing them behind a paid plan.

Admin dashboard and email: provides an admin panel with real MRR metrics; uses Resend to send welcome, subscription, magic link, and password reset emails, with templates stored in the code repository rather than in a third-party dashboard.

Internationalization: uses next-intl and plain JSON message files, with routing, fallback, and language switching already wired up; every user-facing string is stored in message files, with no need for a translation service or account, and this capability is included in the free kit.

Demo mode: a single environment variable turns the deployment into a safe public demo, disables writes, and provides a one-click trial account so visitors can view the product and admin panel.

Technology stack and interface: Next.js 16 App Router with Turbopack, React 19 Server Components rendered on the server by default; TypeScript strict mode covers the app, tests, and environment schema, while your own pages and components can use plain JavaScript. Styling uses Tailwind CSS v4, with dark mode wired in through CSS variables; the UI is based on Radix UI primitives and a design system written for this kit (Button, Card, Badge, Input, Table, etc.), icons use Lucide, notifications use Sonner.

Data, validation, and content: Prisma 7 with PostgreSQL; Zod is used for forms, Server Actions, and environment schema, with definitions shared between client and server; the blog and docs are Markdown files with frontmatter, rendered via MDX and GitHub Flavored Markdown, so publishing an article only requires adding a file to the repository. Vercel Analytics is mounted in the root layout and takes effect when deployed on Vercel; the component can also be removed to avoid collecting data.

Usage The prerequisites given in the materials are Node 24 or newer, git, and a PostgreSQL database (Neon offers a free hosted tier). The quick start lists cloning and installation steps, but the materials do not provide the specific clone/install commands; the run commands provided include npm run dev、npm run check:deploy and npm run test:coverage. On first run, you need to create a PostgreSQL database and fill in .env.local, at least set AUTH_SECRET and one other value; the documentation says to paste the generated value into AUTH_SECRET between the quotes,DIRECT_URL leave it as is; the kit does not read it. A Neon connection string is usually a pooled connection and ends with ?sslmode=require ending; it should be changed to the stricter ?sslmode=verify-full, otherwise Node will print an SSL warning on every startup. Other variables such as login providers, Stripe, and email can be configured later; each feature is enabled after its variables are set and remains off if they are not set. After creating the tables, restart npm run dev and open http://localhost:3000;开发环境的登录页有 Dev Login (Admin) button; no OAuth app is required to access the admin dashboard.

Branding and demo The kit ships brand-neutral: placeholder names and a black-and-gray theme. Metadata, navigation bar, footer, emails, legal pages, and Open Graph images all read from a single source. You can change the branding through the configuration file src/config/site.ts(name, tagline, description, links),src/components/logo.tsx(logo) and src/app/globals.css color tokens to rebrand; you can also set NEXT_PUBLIC_BRAND_* environment variables (name, tagline, logo accent color, colors) to rebrand without changing code; gradients, lighting effects, and Open Graph images will follow the accent color. After that, rewrite the landing page copy and the /privacy and /terms placeholder content. The optional “Built with” badge is the only intentionally retained kit attribution. For a public demo, you can deploy a second instance and connect it to an isolated database; set DEMO_MODE after which the OAuth buttons are disabled, and the login page provides the shared Explore as User and Explore as Admin accounts; the demo database can be populated with trusted fake users, subscriptions, and projects, with no real emails sent and no real payments created (using Stripe test keys).

Deployment and administrators You can click the Vercel deploy button or deploy to any Node.js host. The free Vercel Hobby plan is for non-commercial use only; if you sell through the app, budget for Vercel Pro or switch to another Node.js host. You need to set all environment variables in the Vercel dashboard; for production, create a new Stripe webhook in the Stripe dashboard pointing to https://yourdomain.com/api/webhooks/stripe endpoint. The build does not run migrations; production database migrations must be run yourself, and run the following before and after: npm run check:deploy. After first login, set the user's role to ADMIN in the User table, and the Admin Panel shortcut will appear in the dashboard.

Testing and quality Vitest covers src/lib pure logic in ..., including the rate limiter and its shared store, password policy, backup code alphabet, account linking rules, billing rules behind free trial/discount/Stripe Tax checks, session rules behind role changes and revocation, Markdown parsers for blog/docs/changelog, environment schema, structured data and page metadata builders, and the boundary of session reading for each page. It also tests the health endpoint and Stripe webhook, using the official Stripe SDK to generate real signatures, verifying that forged or replayed requests do not reach database writes. Playwright covers registration and login, starting checkout, the full two-step verification chain (enable, sign out, sign back in with a verification code and backup code), and accessibility checks; axe-core checks public pages, error states, and post-login pages against WCAG 2.1 AA, and serious and critical issues fail the tests. Playwright and browser tests are not included in npm test or CI, because a database and browser binaries are required; Chromium only is used. The test server leaves the Resend key empty; registration logs in directly without sending a magic link; checkout tests stop at the handoff; created accounts are deleted after running. Coverage is via npm run test:coverage output, no badge service is used; the material mentions organization-level coverage thresholds, history, and compliance reports as goals of the paid Pro tier, but does not provide pricing or specific content.

Operations checks The environment is validated at startup via src/instrumentation.ts validation, and half-completed configurations (for example, having a Stripe key but no webhook secret) stop the server with an explanatory message. Smoke checks externally access /api/health(including whether the database has all migrations carried by the build), the homepage, blog index, feed, real articles, SEO surfaces, and two route guards (unknown paths are 404,/dashboard redirects to login). Use --expect-version to compare the version reported by the site with the version being released, in order to detect cases where the deployment succeeded but is still serving an old build. All requests are GET and can be safely run against production; flows that write (contact form, waitlist) send real emails and remain on the manual checklist. Demo deployments are identified from /api/health and are reverse-verified as not indexable.

Dependency updates and CI GitHub Actions runs lint, tests, build, and npm audit --omit=dev --audit-level=high. Dependabot runs every Monday; patches and minor versions are grouped by area (Next, React, Prisma, UI, Other), and major versions arrive individually;next、react and react-dom major versions are intentionally excluded and are release work on the roadmap. GitHub Actions versions are checked monthly.

Use cases and limitations Suitable for developers or small teams that want to quickly launch a subscription SaaS under the MIT license, need self-hosted authentication and a database, and want the free tier to include payments, admin backend, email, internationalization, and demo mode. The material does not describe AI-related features, so it should not be used as an AI model or AI development platform. The material does not provide complete clone/install commands, specific pricing, the feature scope of the paid Pro tier, or how to purchase it; Vercel Hobby is for non-commercial use only; production builds do not run database migrations; Stripe production webhooks and all environment variables must be configured by the user; Playwright tests require a database and Chromium and are not included in the default CI.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools