多租户应用外壳,带持久化工作区上下文
Astria — Next.js 后台模板
作者 darkooom
Astria 是一个基于 Next.js 的多租户 SaaS 后台启动模板,内置演示数据与可替换的数据库、认证、计费适配器。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
内置仪表盘、成员、角色、用量、API 密钥、Webhooks、审计日志、账单与设置页面
默认 demo 适配器使用内存示例数据,无需账号、数据库或 API 密钥即可运行
数据库、认证、计费三类适配器可通过环境变量独立切换
提供命令菜单、对话框、表格以及加载、空、错误、部分状态
包含浅色与深色主题,以及 GitHub Actions 中的类型检查、Lint 与构建检查
模板详细介绍
Astria 是一个面向多租户 SaaS 场景的 Next.js 后台启动模板,使用 TypeScript、Tailwind CSS 与 shadcn/ui 构建。它提供响应式的多租户应用外壳,并保持工作区上下文;页面覆盖仪表盘、活动、成员、角色、用量、API 密钥、Webhooks、审计日志、账单和设置。默认适配器为 demo,使用内存中的示例数据,因此无需账号、数据库或 API 密钥即可运行完整界面。
模板的核心设计是把产品代码与具体供应商解耦:src/lib/adapters 中定义与供应商无关的契约,数据库可选 demo 或 Prisma(PostgreSQL),认证可选 demo、Auth.js 或 Clerk,计费可选 demo 或 Stripe,三者通过环境变量独立切换。README 给出的生产路径包括:配置 PostgreSQL 并应用 Prisma schema、选择 Auth.js 或 Clerk、选择 Stripe 并为每个工作区创建客户并校验 Webhook 签名、在服务端操作中强制校验工作区成员身份与角色权限,以及补充限流、事务邮件、可观测性、备份和密钥轮换。
界面层面包含命令菜单、对话框、表格,以及加载、空、错误和部分状态;提供浅色与深色主题。仓库包含 GitHub Actions 中的类型检查、ESLint、生产构建和拉取请求检查。演示站点为 astria-six.vercel.app,仓库采用 MIT 许可。需要注意的是,演示数据、示例订阅和内置演示用户均为占位内容,上线前需替换;第三方素材(图片、字体、图标)的许可需单独核对,域名、托管、数据库、支付等外部服务可能产生费用。
适合你的项目吗?
适用场景
- 搭建多租户 SaaS 后台的初始骨架
- 在统一界面中演示工作区成员、角色与用量等运营信息
- 以供应商无关的适配器结构接入 PostgreSQL、Auth.js/Clerk 或 Stripe
- 作为团队内部后台原型的起点,先跑通界面再替换真实数据源
适合人群
- 需要多租户后台界面的 SaaS 项目
- 希望先以演示数据验证产品界面、再接入真实服务的团队
- 接受按适配器方式替换数据库、认证与计费供应商的开发者
- 使用 Next.js 与 TypeScript 技术栈的前端或全栈团队
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
克隆仓库后执行 npm install,复制 .env.example 为 .env.local,再运行 npm run dev
- 2
默认适配器为 demo,无需配置外部服务即可访问完整界面
- 3
切换 Prisma 需设置 ASTRIA_DATABASE_ADAPTER=prisma 与 DATABASE_URL,并执行 npx prisma generate 和 npx prisma db push
- 4
切换 Auth.js 或 Clerk、Stripe 时需按 README 填写对应的环境变量与密钥
- 5
上线前需替换演示内容与品牌,并在服务端校验工作区成员身份与角色权限
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 生产模式下使用 Auth.js 或 Clerk 认证时,需自行注册第三方认证服务并配置 OAuth 客户端 ID 与密钥等凭据。
- 启用 Stripe 计费适配器需拥有 Stripe 账户、创建客户并配置 Webhook 签名密钥,可能产生支付服务费用。
- 切换到 Prisma 数据库适配器需自备 PostgreSQL 实例并配置 DATABASE_URL,托管数据库可能产生费用。
- 内置演示用户、示例订阅、演示数据与品牌素材均为占位内容,正式上线前必须替换。
- 模板未内置限流、事务邮件、可观测性、备份与密钥轮换,生产部署需自行补充这些能力。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Select Auth.js or Clerk and add the required provider configuration.
README 原文
Select Stripe, create a customer for each workspace, and verify webhook signatures.
README 原文
Configure PostgreSQL and apply the Prisma schema.
README 原文
Replace demo content, metadata, screenshots, and branding before launch.
README 原文
https://github.com/darkooom/Astria/blob/main/LICENSEhttps://github.com/darkooom/Astria/blob/main/README.mdAdd rate limiting, transactional email, observability, backups, and secret rotation.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 85 / 100
- 技术栈
- Next.js · React
- 网站类型
- 后台 · SaaS · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-10-02
- 截图检查日期
- 2026-10-02
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 8229ac736bbfd9a5c93b13bfcc29cfab806977b6fcf74929f744729da297210a
2026-10-02T18:23:00.705Z
来源文件 / 仓库<div align="center">
# Astria
**A polished, provider-neutral multi-tenant SaaS starter for teams that want to ship, not scaffold.**
[](https://github.com/darkooom/Astria/actions/workflows/ci.yml)
[](https://nextjs.org/)
[](https://www.typescriptlang.org/)
[](./LICENSE)
[**Live demo**](https://astria-six.vercel.app) · [**Use this template**](https://github.com/darkooom/Astria/generate) · [**Deploy to Vercel**](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fdarkooom%2FAstria&project-name=astria&repository-name=astria)
</div>

Astria gives you a production-shaped dashboard, tenant-aware data contracts, and swappable provider adapters without forcing a specific auth, database, or billing vendor. It runs with demo data immediately and grows into a real stack when you are ready.
## What you get
- A responsive multi-tenant app shell with persistent workspace context
- Dashboard, activity, members, roles, usage, API keys, webhooks, audit log, billing, and settings
- Demo data that works immediately — no account, database, or API keys required
- Swappable adapters for PostgreSQL/Prisma, Auth.js, Clerk, and Stripe
- Command menu, dialogs, tables, loading, empty, error, and partial states
- Light and dark themes backed by a documented design system
- TypeScript, ESLint, production builds, and pull-request checks in GitHub Actions
## Product tour
### A dashboard with hierarchy built in
The default workspace combines high-signal metrics, usage trends, operational health, and recent activity without turning into a wall of cards.

### Operational detail stays readable
Usage and health signals share one visual system, so teams can scan performance without leaving the workspace.

## Quick start
```bash
git clone https://github.com/darkooom/Astria.git
cd Astria
npm install
cp .env.example .env.local
npm run dev
```
Open [http://localhost:3000](http://localhost:3000). The default adapter set is `demo`, so the complete interface is available immediately.
## Demo and production modes
| Boundary | Demo default | Production path |
| --- | --- | --- |
| Data | In-memory fixtures | PostgreSQL through Prisma |
| Authentication | Built-in demo user | Auth.js or Clerk |
| Billing | Sample Pro subscription | Stripe Billing Portal |
| Tenancy | Sample Acme workspace | Membership-based, server-side authorization |
| Secrets | None required | Environment variables managed by your host |
## Adapter model
Product code talks to small provider-neutral contracts in `src/lib/adapters`. Select each implementation independently:
```env
ASTRIA_DATABASE_ADAPTER=demo # demo | prisma
ASTRIA_AUTH_ADAPTER=demo # demo | authjs | clerk
ASTRIA_BILLING_ADAPTER=demo # demo | stripe
```
That separation lets you replace a provider without rewriting the UI or tenancy model.
### PostgreSQL and Prisma
```env
ASTRIA_DATABASE_ADAPTER=prisma
DATABASE_URL="postgresql://user:password@host:5432/astria"
```
```bash
npx prisma generate
npx prisma db push
```
### Auth.js
```env
ASTRIA_AUTH_ADAPTER=authjs
AUTH_SECRET="your-random-secret"
AUTH_GITHUB_ID="your-github-oauth-client-id"
AUTH_GITHUB_SECRET="your-github-oauth-client-secret"
```
### Clerk
```env
ASTRIA_AUTH_ADAPTER=clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_..."
CLERK_SECRET_KEY="sk_..."
```
### Stripe
```env
ASTRIA_BILLING_ADAPTER=stripe
STRIPE_SECRET_KEY="sk_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_APP_URL="https://your-domain.com"
```
## Production checklist
- Configure PostgreSQL and apply the Prisma schema.
- Select Auth.js or Clerk and add the required provider configuration.
- Select Stripe, create a customer for each workspace, and verify webhook signatures.
- Enforce workspace membership and role authorization on every server-side operation.
- Add rate limiting, transactional email, observability, backups, and secret rotation.
- Replace demo content, metadata, screenshots, and branding before launch.
## Architecture
```text
src/
├── app/ Next.js App Router pages
├── components/ Product and shadcn-style UI components
└── lib/
├── adapters/ Provider-neutral boundaries and examples
└── demo-data.ts Instant local demo content
```
## Scripts
| Command | Purpose |
| --- | --- |
| `npm run dev` | Start the local development server |
| `npm run build` | Create a production build |
| `npm run start` | Run the production server |
| `npm run typecheck` | Validate TypeScript without emitting files |
| `npm run lint` | Run ESLint across the project |
## Contributing and security
Contributions are welcome. Read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a pull request. Please report vulnerabilities privately through [GitHub Private Vulnerability Reporting](https://github.com/darkooom/Astria/security/advisories/new), not in a public issue.
## License
Astria is available under the [MIT License](./LICENSE) for personal and commercial projects.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

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 · 启动器
