基于 Next.js App Directory 与 React 构建,使用 TypeScript 提供端到端类型安全
saasfly — Next.js SaaS模板
作者 nextify-limited
Saasfly 是一个基于 Next.js 的开源 SaaS 启动模板,采用 MIT 许可,内置认证、支付、数据库、邮件、国际化与 SEO 等模块,通过 Bun 创建并可在 Vercel 部署。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
集成 Clerk 认证、Stripe 支付、Resend 邮件与 PostgreSQL 数据库
使用 Kysely 作为类型安全 SQL 查询构建器,Prisma 用于 schema 管理
通过 tRPC 与 TanStack React Query 实现数据获取,Zustand 管理全局状态
内置 i18n 国际化、SEO 元数据、T3 Env 环境变量管理与 Turborepo 单仓结构
UI 采用 Tailwind CSS、shadcn/ui、Framer Motion 与 Lucide 图标
模板详细介绍
Saasfly 是 nextify-limited 在 GitHub 上维护的 Next.js SaaS 启动模板,仓库采用 MIT 许可,代码可免费使用、修改、商用和分发。它面向需要快速搭建 SaaS 应用骨架的开发者,提供主应用、共享 UI、数据库、认证与邮件等分包结构,并集成认证、支付、邮件、国际化、SEO、类型安全 API 与状态管理等模块。
使用方式上,官方推荐通过 `bun create saasfly` 创建项目,也可手动克隆仓库后执行 `bun install`。启动前需要准备 PostgreSQL 数据库,复制 `.env.example` 为 `.env.local` 并填写环境变量,再运行 `bun db:push` 同步数据库结构,最后用 `bun run dev:web` 启动开发服务器。仓库同时提供 Vercel 一键部署入口,并列出所需的环境变量。
需要注意的限制:认证默认使用 Clerk,NextAuth 实现位于单独分支;管理后台目前为静态页面,处于 alpha 阶段,未提供在线演示;项目路线图中提到考虑集成 Payload CMS。演示图片、字体、图标等第三方素材需按各自许可单独核对,域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
适合你的项目吗?
适用场景
- 快速搭建 SaaS 产品的初始代码骨架,减少认证、支付与数据库等基础模块的重复开发
- 作为学习 Next.js 全栈架构的参考项目,了解 tRPC、Kysely、Prisma 与 Clerk 的配合方式
- 在 Vercel 上部署并连接 PostgreSQL、Stripe 与 Resend 等外部服务,验证 SaaS 核心流程
- 基于 MIT 许可修改和分发代码,用于个人或商业项目的前期原型
适合人群
- 熟悉 Next.js、React 与 TypeScript,希望快速启动 SaaS 项目的开发者
- 需要认证、支付、邮件、国际化与数据库集成参考实现的全栈工程师
- 接受使用 Clerk、Stripe、Resend 等外部服务并愿意自行配置密钥的团队
- 希望基于 MIT 许可代码进行二次开发或商用的个人与组织
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需预先安装 Bun、Node.js 与 Git,并准备 PostgreSQL 数据库(可使用 Vercel Postgres 或本地实例)
- 2
推荐使用 `bun create saasfly` 创建项目,或手动克隆仓库后执行 `bun install`
- 3
复制 `.env.example` 为 `.env.local` 并填写数据库、认证、支付与邮件等环境变量,然后运行 `bun db:push`
- 4
使用 `bun run dev:web` 启动开发服务器,默认访问 http://localhost:3000
- 5
认证默认使用 Clerk,NextAuth 实现位于 feature-nextauth 分支;管理后台为 alpha 静态页面,需在环境变量中配置管理员邮箱
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 默认认证服务商为 Clerk,需注册 Clerk 账号并配置密钥;NextAuth 实现位于单独分支,不在默认代码中。
- 必须自行准备 PostgreSQL 数据库(Vercel Postgres 或本地实例),并配置 POSTGRES_URL 环境变量。
- 管理后台目前仅提供静态页面,处于 alpha 阶段,功能不完整,且官方不提供在线演示。
- Payload CMS 仅为路线图中的待考虑项,尚未集成,不应视为现有功能。
- 免费技术支持与部署服务仅面向非营利组织,其他用户需自行部署或联系商业合作。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
We are using Clerk as the default authentication provider after 1st June 2025.
README 原文
You can use Vercel Postgres or a local PostgreSQL server(add POSTGRES_URL env in .env.local)
README 原文
Only provide static page now and we plan to integrate with headless arch
README 原文
Consider integrating Payload CMS.
README 原文
https://github.com/nextify-limited/saasfly/blob/main/LICENSEhttps://github.com/nextify-limited/saasfly/blob/main/README.mdWe provide **free technical support and deployment services to non-profit organizations**
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 94 / 100
- 技术栈
- Next.js · React
- 网站类型
- SaaS · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2025-08-04
- 截图检查日期
- 2026-10-01
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 9354b894796080b52dca1668169d6f87d237f13131abaf8746b6756c703807d5
2026-10-01T14:34:20.222Z
来源文件 / 仓库
<div align="center" width="100%">
<img src="./saasfly-logo.svg" width="128" alt="" />
</div>
# Saasfly </br>
<a href="https://trendshift.io/repositories/8929" target="_blank"><img src="https://trendshift.io/api/badge/repositories/8929" alt="saasfly%2Fsaasfly | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[![GitHub Actions Workflow Status][check-workflow-badge]][check-workflow-badge-link] [![GitHub License][github-license-badge]][github-license-badge-link] [![Discord][discord-badge]][discord-badge-link] [![Saasfly][made-by-nextify-badge]][made-by-nextify-badge-link]
[](README_zh.md)
[](README_de.md)
[](README_vi.md) </br>

[](https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2Fsaasfly%2Fsaasfly)
An easy-to-use and enterprise-grade Next.js boilerplate.
You don't need to buy templates anymore; Saasfly provides a complete, open-source solution for building SaaS applications quickly and easily.
> **[Nextify](https://nextify.ltd)** provides a complete Enterprise SaaS solution. Contact us at [[email protected]](mailto:[email protected]) if you're interested in discussing your project, or if you'd simply like to have a conversation with us, please feel free to reach out.
> ❤️ We provide **free technical support and deployment services to non-profit organizations**.
>
> 🙌 All profits obtained from our open source projects will be **entirely dedicated to supporting open source initiatives and charitable causes**.
## ⚡ Live Demo
Try it out for yourself!
Demo Server (Location: Washington - USA): <https://show.saasfly.io>
See more documentation at <https://document.saasfly.io>
## 🌟 Star History
[](https://repohistory.com)
## Sponsors
<table>
<tr>
<td style="width: 64px;">
<a href="https://libra.dev/">
<div style="width: 64px;">
<img alt="Clerk" src="https://raw.githubusercontent.com/nextify-limited/libra/main/logo.svg">
</div>
</a>
</td>
<td style="width: 64px;">
<a href="https://go.clerk.com/uKDp7Au">
<div style="width: 64px;">
<img alt="Clerk" src="/clerk.png">
</div>
</a>
</td>
<td style="width: 64px;">
<a href="https://www.twillot.com/">
<div style="width: 64px;">
<img alt="Take Control of All Your Twitter Assets" src="/twillot.png">
</div>
</a>
</td>
<td style="width: 64px;">
<a href="https://www.setupyourpay.com/" title="如何注册美国公司进行收款">
<div style="width: 64px;">
<img alt="全球收款手册" src="/setupyourpay.png">
</div>
</a>
</td>
</tr>
</table>
<a href="mailto:[email protected]">
Add your logo here
</a>
## 🚀 Getting Started
### 🖱 One Click Template
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsaasfly%2Fsaasfly&env=NEXT_PUBLIC_APP_URL,NEXTAUTH_URL,NEXTAUTH_SECRET,STRIPE_API_KEY,STRIPE_WEBHOOK_SECRET,POSTGRES_URL,GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,RESEND_API_KEY,RESEND_FROM&install-command=bun%20install&build-command=bun%20run%20build&root-directory=apps%2Fnextjs)
### 📋 Prerequisites
Before you start, make sure you have the following installed:
1. [Bun](https://bun.sh/) & [Node.js](https://nodejs.org/) & [Git](https://git-scm.com/)
1. Linux
```bash
curl -sL https://gist.github.com/tianzx/874662fb204d32390bc2f2e9e4d2df0a/raw -o ~/downloaded_script.sh && chmod +x ~/downloaded_script.sh && source ~/downloaded_script.sh
```
2. MacOS
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
brew install oven-sh/bun/bun
brew install nvm
```
2. [PostgreSQL](https://www.postgresql.org/)
1. You can use Vercel Postgres or a local PostgreSQL server(add POSTGRES_URL env in .env.local)
```bash
POSTGRES_URL = ''
```
### Installation
To get started with this boilerplate, we offer two options:
1. Use the `bun create` command(🌟Strongly recommend🌟):
```bash
bun create saasfly
```
2. Manually clone the repository:
```bash
git clone https://github.com/saasfly/saasfly.git
cd saasfly
bun install
```
### Setup
Follow these steps to set up your project:
1. Set up the environment variables:
```bash
cp .env.example .env.local
// (you must have a database prepared before running this command)
bun db:push
```
2. Run the development server:
```bash
bun run dev:web
```
3. Open [http://localhost:3000](http://localhost:3000) in your browser to see the result.
4. (Optional alpha)`bun run tailwind-config-viewer` Open [http://localhost:3333](http://localhost:3333) in your browser to see your Tailwind CSS configuration
### Other Notes
We are using Clerk as the default authentication provider after 1st June 2025.
You can find the NextAuth implementation here ( https://github.com/saasfly/saasfly/tree/feature-nextauth ) .
## 🥺 Project Roadmap
1. Admin Dashboard Page (in alpha !!!)
1. Only provide static page now and we plan to integrate with headless arch
2. You can provide your admin account and change **ADMIN_EMAIL="[email protected],[email protected]"** in .env.local and access host:port/admin/dashboard
3. Based on security concerns, we will not provide online demos for the time being.
2. Consider integrating Payload CMS.
## ⭐ Features
### 🐭 Frameworks
- **[Next.js](https://nextjs.org/)** - The React Framework for the Web (with **App Directory**)
- **[NextAuth.js](https://next-auth.js.org/)** - Authentication for Next.js
- **[Kysely](https://kysely.dev/)** - The type-safe SQL query builder for TypeScript
- **[Prisma](https://www.prisma.io/)** - Next-generation ORM for Node.js and TypeScript, used as a schema management tool
- **[React-email](https://react.email/)** - A React renderer for creating beautiful emails using React components
### 🐮 Platforms
- **[Clerk](https://go.clerk.com/uKDp7Au)** - The most comprehensive User Management Platform
- **[Vercel](https://vercel.com/)** – Deploy your Next.js app with ease
- **[Stripe](https://stripe.com/)** – Payment processing for internet businesses
- **[Resend](https://resend.com/)** – Email marketing platform for developers
### 🐯 Enterprise Features
- **[i18n](https://nextjs.org/docs/app/building-your-application/routing/internationalization)** - Support for internationalization
- **[SEO](https://nextjs.org/docs/app/building-your-application/optimizing/metadata)** - Search engine optimization
- **[MonoRepo](https://turbo.build/)** - Monorepo for better code management
- **[T3 Env](https://env.t3.gg/)** - Manage your environment variables with ease
### 🐰 Data Fetching
- **[trpc](https://trpc.io/)** – End-to-end typesafe APIs made easy
- **[tanstack/react-query](https://react-query.tanstack.com/)** – Hooks for fetching, caching and updating asynchronous data in React
### 🐲 Global State Management
- **[Zustand](https://zustand.surge.sh/)** – Small, fast and scalable state management for React
### 🐒 UI
- **[Tailwind CSS](https://tailwindcss.com/)** – Utility-first CSS framework for rapid UI development
- **[Shadcn/ui](https://ui.shadcn.com/)** – Re-usable components built using Radix UI and Tailwind CSS
- **[Framer Motion](https://framer.com/motion)** – Motion library for React to animate components with ease
- **[Lucide](https://lucide.dev/)** – Beautifully simple, pixel-perfect icons
- **[next/font](https://nextjs.org/docs/basic-features/font-optimization)** – Optimize custom fonts and remove external network requests for improved performance
### 🐴 Code Quality
- **[TypeScript](https://www.typescriptlang.org/)** – Static type checker for end-to-end type safety
- **[Prettier](https://prettier.io/)** – Opinionated code formatter for consistent code style
- **[ESLint](https://eslint.org/)** – Pluggable linter for Next.js and TypeScript
- **[Husky](https://typicode.github.io/husky)** – Git hooks made easy
### 🐑 Performance
- **[Vercel Analytics](https://vercel.com/analytics)** – Real-time performance metrics for your Next.js app
- **[bun.sh](https://bun.sh/)** – npm alternative for faster and more reliable package management
### 🐘 Database
- **[PostgreSQL](https://www.postgresql.org/)** – The world's most advanced open source database
## 📦 Apps and Packages
- `web`: The main Next.js application
- `ui`: Shared UI components
- `db`: Database schema and utilities
- `auth`: Authentication utilities
- `email`: Email templates and utilities
## 📜 License
This project is licensed under the MIT License. For more information, see the [LICENSE](./LICENSE) file.
## 🙏 Credits
This project was inspired by shadcn's [Taxonomy](https://github.com/shadcn-ui/taxonomy) and t3-oss's [create-t3-turbo](https://github.com/t3-oss/create-t3-turbo).
## 👨💻 Contributors
<a href="https://github.com/saasfly/saasfly/graphs/contributors">
<img src="https://contrib.rocks/image?repo=saasfly/saasfly" />
</a>
Made with [contrib.rocks](https://contrib.rocks).
<!-- Badges and links -->
[check-workflow-badge]: https://img.shields.io/github/actions/workflow/status/saasfly/saasfly/ci.yml?label=ci
[github-license-badge]: https://img.shields.io/badge/License-MIT-green.svg
[discord-badge]: https://img.shields.io/discord/1204690198382911488?color=7b8dcd&link=https%3A%2F%2Fsaasfly.io%2Fdiscord
[made-by-nextify-badge]: https://img.shields.io/badge/made_by-nextify-blue?color=FF782B&link=https://nextify.ltd/
[check-workflow-badge-link]: https://github.com/saasfly/saasfly/actions/workflows/check.yml
[github-license-badge-link]: https://github.com/saasfly/saasfly/blob/main/LICENSE
[discord-badge-link]: https://discord.gg/8SwSX43wnD
[made-by-nextify-badge-link]: https://nextify.ltd
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

ai-website-cloner-template
Clone any website with one command using AI coding agents
Next.js · 启动器

Next.js SaaS Starter
Next.js SaaS Starter 是 Next.js 官方维护的 SaaS 起点模板,定位介于学习资源和可直接部署的脚手架之间。
Next.js · SaaS

Next.js Commerce
Next.js Commerce 是 Vercel 团队维护的电商启动模板,基于 Next.js App Router 构建,采用服务端渲染、React Server Components、Server Actions …
Next.js · 电商

Next-js-Boilerplate
Next-js-Boilerplate 是一个面向 Next.js 16、Tailwind CSS 4 和 TypeScript 的启动器,核心定位是开发者体验优先。
Next.js · 启动器

tailwind-nextjs-starter-blog
tailwind-nextjs-starter-blog 是一个面向个人技术博客的 Next.js 与 Tailwind CSS 启动模板,其 v2 版本基于 App Router 与 React Server Comp…
Next.js · 博客

next-forge
Production-grade Turborepo template for Next.js apps.
Next.js · 启动器
