Next.jsReactSaaS启动器

nextjs-supabase-starter — Next.js SaaS模板

作者 MuhammadNiazAli

基于 Next.js App Router 与 Supabase 的全栈 SaaS 启动器,内置 Supabase 认证、Postgres 数据库、Stripe 订阅示例、国际化与 Storybook 组件开发环境,采用 MIT 许可。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-01查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

Supabase Auth 邮箱密码登录与 Google OAuth 登录

02

受保护仪表盘路由与实时用户资料卡片

03

用户资料页支持头像上传,使用 Supabase Storage

04

可选 Stripe 计费示例:定价页、Checkout 与 webhook

05

内置英文与乌尔都语国际化及深浅色主题切换

06

Vitest 单元测试、Storybook 组件开发与 GitHub Actions CI

模板详细介绍

这是一个面向 SaaS 项目的全栈启动模板,使用 Next.js App Router、TypeScript、Tailwind CSS 与 Supabase 构建。仓库自带 Supabase 认证(邮箱密码与 Google OAuth)、受保护仪表盘、带头像上传的用户资料页、密码重置流程、深浅色主题切换,以及基于 Supabase Storage 的存储配置。数据库结构与行级安全策略集中在 supabase/schema.sql 中,执行该脚本即可创建所需表、avatars 存储桶与 RLS 策略。

模板还包含可选的 Stripe 计费示例,涵盖定价页、Checkout 与 webhook,未配置 Stripe 时应用仍可正常运行。项目内置英文与乌尔都语国际化、响应式导航与页脚、Vitest 与 Testing Library 单元测试、Storybook 组件开发环境,以及用于 PR 检查的 GitHub Actions CI。

使用前需要自行准备 Supabase 项目并填写环境变量;Google 登录需在 Supabase Auth 中启用对应提供方。Stripe 相关功能需要额外配置密钥、价格 ID、服务角色密钥与 webhook 签名密钥。仓库路线图中 GitHub OAuth、API 限流与无障碍审计仍为未完成项。代码采用 MIT 许可,可免费用于个人或商业项目,但演示图片、字体、图标等第三方素材需单独核对许可,域名、托管、数据库、支付等外部服务可能另行收费。

Next.jsSaaS启动器

适合你的项目吗?

适用场景

  • 快速搭建带认证与数据库的 SaaS 项目骨架
  • 学习 Next.js App Router 与 Supabase 的集成方式
  • 作为开源贡献练习的代码库,包含 good first issue 标签
  • 在 Storybook 中隔离开发和预览 UI 组件
  • 为多语言产品验证国际化与主题切换方案

适合人群

  • 需要现成认证与数据库配置的 SaaS 开发者
  • 希望参与开源项目的新手贡献者
  • 寻找可读性高、结构清晰的全栈启动模板的工程师
  • 需要 Stripe 订阅集成参考实现的项目

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    克隆仓库后执行 npm install,并复制 .env.example 为 .env.local

  2. 2

    在 supabase.com 创建项目,将项目 URL 与 anon key 填入 .env.local

  3. 3

    在 Supabase SQL 编辑器运行 supabase/schema.sql 以创建表、avatars 存储桶与行级安全策略

  4. 4

    如需 Google 登录,在 Supabase Auth 设置中启用 Google 提供方

  5. 5

    Stripe 为可选项,需配置 STRIPE_SECRET_KEY、NEXT_PUBLIC_STRIPE_PRICE_ID、SUPABASE_SERVICE_ROLE_KEY 与 STRIPE_WEBHOOK_SECRET

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 使用前需自行在 supabase.com 创建 Supabase 项目,并将项目 URL 与 anon key 填入 .env.local,属于外部服务依赖。
  • Stripe 计费功能为可选项,但启用时需自行注册 Stripe 账户并创建周期性价格,属于外部付费服务依赖。
  • Stripe webhook 需配置 Supabase 服务角色密钥,该密钥权限较高,需谨慎保管。
  • 本地调试 Stripe webhook 需安装并使用 Stripe CLI 转发事件。
  • Google OAuth 登录需在 Supabase Auth 设置中手动启用 Google 提供方。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

Create a free project at [supabase.com](https://supabase.com)

README 原文

Create a [Stripe](https://stripe.com) account and a recurring Price for your plan

README 原文

Add `SUPABASE_SERVICE_ROLE_KEY` (Project Settings → API in Supabase) — needed by the webhook to write subscription status

README 原文

Forward webhooks locally with the [Stripe CLI](https://stripe.com/docs/stripe-cli)

README 原文

If you plan to use Google login enable the Google provider from the Supabase Auth settings

README 原文
https://github.com/MuhammadNiazAli/nextjs-supabase-starter/blob/main/LICENSEhttps://github.com/MuhammadNiazAli/nextjs-supabase-starter/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 88 / 100
技术栈
Next.js · React
网站类型
SaaS · 启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-09-08
截图检查日期
2026-10-01

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 2d502f03586c01d9cefad2059eafa735e4d1415befc55b11793db38fdce8d494

2026-10-01T01:01:15.468Z

来源文件 / 仓库
# 🚀 Next.js Supabase Starter

A production ready open source starter kit for building modern SaaS apps with Next.js TypeScript Tailwind CSS and Supabase. Built to be simple enough for your first pull request and solid enough to actually ship a real product on top of.

![Next.js](https://img.shields.io/badge/Next.js-14-black)
![TypeScript](https://img.shields.io/badge/TypeScript-5-blue)
![Supabase](https://img.shields.io/badge/Supabase-Backend-3ecf8e)
![License](https://img.shields.io/badge/license-MIT-green)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)

## Screenshots

| Light Mode | Dark Mode |
|---|---|
| ![Homepage Light](./screenshots/homepage-light.png) | ![Homepage Dark](./screenshots/homepage-dark.png) |

| Login | Sign up |
|---|---|
| ![Login](./screenshots/login.png) | ![Sign up](./screenshots/signup.png) |

## Why this starter

Most starter kits fall into one of two camps. Either they are toy examples that fall apart the moment you try to build something real or they are bloated paid templates locked behind a paywall. This project sits in the middle. It ships with real authentication a real Postgres database and a working dashboard while staying small enough to read through in one sitting.

It is also built with open source contribution in mind. The codebase is intentionally kept clean and well organized so that a beginner writing their first pull request and a senior engineer looking for a weekend project can both work in it comfortably.

## Tech stack

- [Next.js 14](https://nextjs.org/) using the App Router
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Supabase](https://supabase.com/) for authentication and the Postgres database
- [Stripe](https://stripe.com/) for billing and subscriptions
- [Vitest](https://vitest.dev/) and [Testing Library](https://testing-library.com/) for unit tests
- [Storybook](https://storybook.js.org/) for isolated component development

## Features

- Email and password authentication through Supabase Auth
- Google OAuth login
- Protected dashboard route with a live user profile card
- User profile page with avatar upload (Supabase Storage)
- Stripe billing example (pricing page, Checkout, webhook)
- Password reset flow
- Dark mode toggle with saved preference
- Built in internationalization with English and Urdu support
- Responsive navbar and footer
- Unit test suite covering core components
- Storybook setup for building and previewing UI in isolation
- GitHub Actions CI that lints every pull request
- Clean and predictable folder structure that is easy to extend

## Getting started

Clone the repository and install the dependencies.

```bash
git clone https://github.com/MuhammadNiazAli/nextjs-supabase-starter.git
cd nextjs-supabase-starter
npm install
```

Copy the example environment file and fill in your own Supabase credentials.

```bash
cp .env.example .env.local
```

Start the development server.

```bash
npm run dev
```

The app will be running at [http://localhost:3000](http://localhost:3000).

## Supabase setup

1. Create a free project at [supabase.com](https://supabase.com)
2. Copy your project URL and anon key into `.env.local`
3. Open the Supabase SQL editor and run the contents of `supabase/schema.sql` to create the required tables, the `avatars` storage bucket, and all row level security policies
4. If you plan to use Google login enable the Google provider from the Supabase Auth settings

## Stripe setup (optional)

The pricing page, checkout, and webhook are opt-in — the app runs fine without Stripe configured.

1. Create a [Stripe](https://stripe.com) account and a recurring Price for your plan
2. Add `STRIPE_SECRET_KEY` and `NEXT_PUBLIC_STRIPE_PRICE_ID` to `.env.local`
3. Add `SUPABASE_SERVICE_ROLE_KEY` (Project Settings → API in Supabase) — needed by the webhook to write subscription status
4. Forward webhooks locally with the [Stripe CLI](https://stripe.com/docs/stripe-cli): `stripe listen --forward-to localhost:3000/api/webhooks/stripe`, then copy the printed signing secret into `STRIPE_WEBHOOK_SECRET`
5. In production, add a webhook endpoint in the Stripe Dashboard pointing at `https://your-domain.com/api/webhooks/stripe`, listening for `checkout.session.completed`, `customer.subscription.updated`, and `customer.subscription.deleted`

## Available scripts

| Command | What it does |
|---|---|
| `npm run dev` | Starts the app in development mode |
| `npm run build` | Builds the app for production |
| `npm run start` | Runs the production build |
| `npm run lint` | Lints the codebase |
| `npm run format` | Formats the codebase with Prettier |
| `npm test` | Runs the unit test suite |
| `npm run storybook` | Starts Storybook for component development |

## Project structure

```
src/
  app/            App Router pages including auth dashboard profile pricing and API routes
  components/     Reusable UI components and their tests and stories
  lib/            Supabase client, Supabase admin client, Stripe client, and internationalization logic
  messages/       Translation files for each supported language
  stories/        Storybook design system assets
supabase/
  schema.sql      Database schema, storage policies, and row level security policies
```

## Contributing

This project is built for the community and every contribution is welcome no matter how small. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a pull request.

If you are new to open source start with an issue labeled [good first issue](../../issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). If you are looking for something more involved check the issues labeled [help wanted](../../issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).

There are many ways to contribute beyond writing code.

- Star the repo so more people can discover it
- Fork it and use it as a base for your own project
- Report bugs through the Issues tab
- Suggest new features
- Review open pull requests
- Improve the documentation

## Roadmap

- [x] Google OAuth login
- [x] Unit tests with Vitest
- [x] i18n support with English and Urdu
- [x] Storybook setup for components
- [x] Stripe billing example
- [x] User profile page with avatar upload
- [ ] GitHub OAuth login
- [ ] Rate limiting on API routes
- [ ] Accessibility audit

Browse the [open issues](../../issues) for the full and up to date list of what is being worked on.

## License

This project is licensed under the MIT License. See [LICENSE](./LICENSE) for details. You are free to use it for personal or commercial projects.

## Maintainer

Built and maintained by [Muhammad Niaz Ali](https://github.com/MuhammadNiazAli) full stack developer working across Next.js React Native Supabase and Python automation with n8n.

If this project saved you time please consider giving it a star. It genuinely helps more contributors find the repo.
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。