Next.jsReactSaaS启动器

ai-ad-studio — Next.js SaaS模板

作者 waqasraza123

AI Ad Studio 是一个基于 Next.js 的 SaaS 启动器,提供从产品简报、概念生成、渲染批次到审核交付的完整 AI 广告创作参考应用,并包含 Supabase、Stripe、R2、OpenAI 及可插拔媒体提供商的基础设施。

看看你的网站会是什么样

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

1 个预览视图
作者提供的预览
作者提供的预览首屏预览

来自项目 README 的原始预览。

目前有 1 张原始预览,可打开完整图片查看设计细节。

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

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

值得关注的模板亮点

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

01

提供完整的广告制作参考工作流:简报、概念、预览、受控渲染批次、审核、胜出项选择与交付

02

Monorepo 结构包含 Next.js Web 应用、Node 工作进程、共享包、Supabase 迁移和可选本地推理服务

03

内置认证、所有者范围工作区、Stripe 订阅计费、权益与用量控制、R2 存储和英阿双语本地化

04

提供商适配器架构,可接入 Runway、本地 HTTP 推理或 mock 预览,无需重写产品工作流

05

包含 lint、单元与组件测试、浏览器自动化、构建检查、运行时健康检查和部署冒烟脚本

06

公开分享面按用途区分:活动页、交付页和令牌作用域分享链接

模板详细介绍

AI Ad Studio 是面向构建 AI 创意产品的团队提供的生产导向 SaaS 启动器。它既是一个可运行的广告制作参考应用,也包含启动、运营和扩展现代 AI SaaS 所需的可复用基础设施。参考实现遵循一条明确路径:简报 → 概念 → 预览 → 受控渲染批次 → 审核 → 规范胜出项 → 推广 → 交付。

该启动器采用 monorepo 结构,包含 Next.js Web 应用、Node 工作进程、共享包、Supabase 迁移以及可选的本地推理服务。它覆盖认证、所有者范围工作区、订阅计费、权益、用量控制、存储、本地化、公开分享和运营诊断等基础能力。提供商适配器架构允许使用托管 AI 服务、本地推理或测试替身,而无需重写产品工作流。

需要留意的是,它不是托管服务或一键部署方案。你需要自行配置和运营 Supabase、对象存储、计费与 AI 提供商。它也不是厂商中立的空白模板:AI Ad Studio 是一个完整的参考垂直应用,若要适配其他领域,需要有意替换其工作流语言和业务规则。它不包含提供商额度、GPU 容量、云资源、密钥或生产数据,也不会自行使部署达到生产就绪状态。

Next.jsSaaS启动器

适合你的项目吗?

适用场景

  • 团队需要快速搭建一个 AI 驱动的广告创意 SaaS 产品原型或基础版本
  • 开发者希望参考如何用 Supabase 持久化工作流状态、异步任务、审批和可审计状态
  • 需要将广告制作流程替换为其他持久 AI 工作流,并复用现有基础设施
  • 希望评估 Next.js、Supabase、Stripe、R2、OpenAI 与可插拔媒体提供商的集成方式
  • 需要英阿双语和 LTR/RTL 布局支持的 SaaS 启动项目

适合人群

  • 熟悉 Next.js、TypeScript 和 Supabase 的全栈开发团队
  • 准备自行配置并运营 Supabase、对象存储、计费与 AI 提供商的项目
  • 需要生产导向参考实现而非空白脚手架的中小型产品团队
  • 计划在广告创意领域构建可扩展 SaaS 产品的开发者

上手与定制指南

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

  1. 1

    需要 Node.js 22 或更高版本、pnpm 10,以及已配置的 Supabase 项目

  2. 2

    需要 Cloudflare R2 凭证用于上传和媒体交付,OpenAI 凭证用于文本和语音生成

  3. 3

    使用本地推理边车时需要 Python 3.11 或更高版本;使用 Runway 时需要付费账户和 RUNWAYML_API_SECRET

  4. 4

    最终媒体合成需要 FFmpeg;工作进程直接从 process.env 读取变量,不加载 .env.local

  5. 5

    本地视频生成对 GPU 要求较高,仅 CPU 或多数 macOS 环境建议使用 mock 预览或托管提供商

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 仅当所选媒体提供商为 runway 时,需要付费 Runway 账户及 RUNWAYML_API_SECRET;使用本地或 mock 提供商则不需要。
  • 使用托管提供商渲染可能需要付费 API 访问;本地渲染则需要大量 GPU 资源,CPU 或多数 macOS 环境不适合。
  • 项目不是托管服务或一键部署,用户须自行配置并运营 Supabase、对象存储、计费与 AI 提供商。
  • 不包含提供商额度、GPU 容量、云资源、密钥或生产数据,相关成本与资源需用户自备。
  • 项目本身不会使部署达到生产就绪,安全审查、备份、可观测性、法律合规、提供商限制及环境验证由用户负责。
  • 浏览器自动化测试需要可访问的 Supabase 环境及已播种的测试夹具。
  • 工作进程直接从 process.env 读取变量,不自动加载 .env.local,需在启动 shell 中导出环境变量。
  • 不可并行运行 pnpm build 与 pnpm typecheck,否则可能产生 Next.js 类型生成误报。
  • 当 /api/health 报告 Supabase、service-role、R2 或公共 URL 就绪状态降级时,不应将令牌支持的媒体交付视为生产就绪。
  • SMOKE_ALLOW_DEGRADED_HEALTH=true 仅用于诊断,不可用于生产环境。
  • 本地视频生成对 GPU 要求高,仅 CPU 及多数 macOS 环境应使用 mock 预览或托管提供商进行开发。
  • 基础设施配置与迁移部署在本仓库之外进行,需用户自行完成。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

a paid Runway account and `RUNWAYML_API_SECRET` only when a selected media provider is `runway`

README 原文

Provider-backed rendering can require paid API access or substantial local GPU capacity.

README 原文

It is not a hosted service or a one-click deployment. You provision and operate Supabase, object storage, billing, and AI providers.

README 原文

It does not include provider credits, GPU capacity, cloud resources, secrets, or production data.

README 原文

It does not make a deployment production-ready by itself. You remain responsible for security review, backups, observability, legal requirements, provider limits, and environment-specific validation.

README 原文

Browser automation requires a reachable Supabase environment and seeded fixtures.

README 原文

The worker reads directly from `process.env`; it does not load `.env.local` itself.

README 原文

Do not run `pnpm build` and `pnpm typecheck` in parallel.

README 原文

Do not treat token-backed media delivery as production-ready while `/api/health` reports degraded Supabase, service-role, R2, or public-URL readiness.

README 原文

`SMOKE_ALLOW_DEGRADED_HEALTH=true` is diagnostic only.

README 原文

Local video generation is GPU-intensive. CPU-only and many macOS environments should use mock previews or a hosted provider for practical development.

README 原文

Infrastructure provisioning and migration deployment happen outside this repository.

README 原文
https://github.com/waqasraza123/ai-ad-studio/blob/main/LICENSEhttps://github.com/waqasraza123/ai-ad-studio/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-08-27
截图检查日期
2026-10-01

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: d2899df3fef5115e449addc03c3a414a244f359914d755c04fe6274ecd137838

2026-10-01T01:08:06.949Z

来源文件 / 仓库
# AI Ad Studio — Production SaaS Starter Kit

<p>
  <strong>Reference app languages:</strong>
  <code>English</code>
  <code>العربية</code>
</p>

AI Ad Studio is a production-oriented SaaS starter kit for teams building AI-powered creative products. It combines a complete ad-production reference application with the reusable infrastructure needed to launch, operate, and extend a modern AI SaaS.

Fork it to build your own product, replace the ad-specific workflow with another durable AI workflow, or use the included application as the foundation for an ad creative platform.

The reference implementation follows one explicit path:

**brief → concepts → previews → controlled render batches → review → canonical winner → promotion → delivery**

[View the reference deployment](https://ai-ad-studio-web.vercel.app)

## What this starter is

- A working, opinionated SaaS application rather than an empty framework scaffold.
- A reference for durable AI workflows with persisted checkpoints, async jobs, approvals, retries, and auditable state.
- A monorepo with a Next.js web application, Node worker, shared packages, Supabase migrations, and an optional local inference service.
- A foundation for authentication, owner-scoped workspaces, subscription billing, entitlements, usage controls, storage, localization, public sharing, and operational diagnostics.
- A provider-adapter architecture that can use hosted AI services, local inference, or test doubles without rewriting the product workflow.
- A production-minded baseline with linting, unit and component tests, browser automation, build checks, runtime health checks, and deployment smoke scripts.

## What this starter is not

- It is not a hosted service or a one-click deployment. You provision and operate Supabase, object storage, billing, and AI providers.
- It is not a vendor-neutral blank slate. AI Ad Studio is a complete reference vertical, so adapting another domain means replacing its workflow language and business rules deliberately.
- It is not a no-code product builder or general-purpose video editor.
- It does not include provider credits, GPU capacity, cloud resources, secrets, or production data.
- It does not make a deployment production-ready by itself. You remain responsible for security review, backups, observability, legal requirements, provider limits, and environment-specific validation.
- It is not an unconstrained generation playground. The included product favors controlled variants, review gates, canonical outputs, and traceable decisions.

## Included reference product

AI Ad Studio demonstrates the starter through a short-form product advertising workflow:

- structured product briefs, brand kits, and reusable templates
- AI-assisted concepts, copy, storyboards, and previews
- controlled multi-variant render batches
- side-by-side review, comments, approval state, and winner selection
- canonical export finalization and winner-only promotion
- public campaign pages and token-scoped share links
- client delivery workspaces anchored to finalized exports
- activation packages and creative-performance ingestion
- deterministic creative-performance insights tied to creative lineage
- owner subscriptions, plan entitlements, usage rollups, and free-plan watermarking
- background job polling, provider execution, job traces, and delivery reminder sweeps

## Screenshots

![AI Ad Studio landing page](.github/screenshots/image.jpg)
![Authenticated dashboard](.github/screenshots/dashboard.jpg)
![Creative production workspace](.github/screenshots/production-workspace.jpg)
![Concept generation form](.github/screenshots/concept-generation-form.jpg)
![Alternate dashboard palette](.github/screenshots/colored-cycle-dashboard.jpg)
![SaaS launch experience](.github/screenshots/saas-launch.jpg)
![Sign-in and sign-up experience](.github/screenshots/sign-in-signup.jpg)

## Make it your own

The codebase keeps customization points separated so you can change one layer without flattening the architecture.

### Brand and product language

- Set the deployed application name and URL through `NEXT_PUBLIC_APP_NAME` and `NEXT_PUBLIC_APP_URL`.
- Replace the English and Arabic catalogs under `apps/web/src/lib/i18n/messages`.
- Update the application icon, marketing components, email/public-surface copy, and plan display names.
- Keep visible UI copy inside the typed i18n layer so both locales and LTR/RTL layouts stay valid.

### Domain workflow

- Replace ad-specific feature modules under `apps/web/src/features`.
- Keep authenticated mutations in server actions and durable data access under `apps/web/src/server`.
- Model important workflow transitions in Supabase instead of long-lived browser state.
- Add or replace job handlers under `apps/worker/src/jobs/handlers` for slow or retryable work.

### AI and media providers

- Implement provider contracts in `packages/providers` and connect them through worker factories.
- Use the existing Runway, local HTTP, and mock preview paths as integration examples.
- Extend `packages/media` when output composition or media processing changes.

### Infrastructure and commercial model

- Replace Supabase, R2, or Stripe behind their server-side boundaries if your stack differs.
- Change seeded billing plans, entitlements, operator ceilings, and usage policies together so enforcement remains consistent in the web app and worker.
- Add migrations before changing TypeScript database contracts.

### Public experiences

- Adapt campaign pages for promotion, delivery workspaces for structured handoff, and share links for lightweight distribution.
- Preserve token scoping and canonical-output rules unless your replacement workflow defines a different trust model.

## Architecture

The starter uses a thin web layer, a durable database, and an asynchronous worker.

- **Web:** Next.js 16 App Router and React 19 own product UX, authentication, server actions, state transitions, billing, and public pages.
- **Database and auth:** Supabase is the durable system of record for users, workflow state, jobs, approvals, notifications, billing, and analytics.
- **Worker:** A Node/TypeScript process polls and claims jobs, calls providers, performs render orchestration, and runs reminder sweeps.
- **Storage:** Cloudflare R2 stores uploaded and generated media; database records keep lineage and access metadata.
- **Providers:** OpenAI supports text and speech flows. Preview and scene-video generation can use Runway or the local HTTP sidecar.
- **Composition:** FFmpeg remains the final export compositor.
- **Billing:** Stripe-backed subscriptions are reconciled into schema-backed plans, limits, usage, and audit records.
- **Localization:** Typed English and Arabic catalogs support persisted locale choice and document-level LTR/RTL switching.

Important state is persisted so long-running work can resume, fail visibly, and remain reviewable. Public surfaces are intentionally separated by purpose rather than implemented as alternate skins over one route.

## Monorepo layout

```text
apps/web/                  Next.js product, dashboard, billing, and public surfaces
apps/worker/               Async job execution and scheduled operational work
packages/config/           Runtime configuration utilities
packages/media/            Media pipeline and composition helpers
packages/providers/        AI provider contracts and adapters
packages/shared/           Shared contracts and types
packages/ui/               Reusable UI primitives
services/local-inference/  Optional Python HTTP inference sidecar
supabase/migrations/       Versioned database changes
scripts/checks/            Local, deployment, and release verification
```

## Public surfaces in the reference app

The three token-backed public experiences serve different trust and product goals:

1. **Campaign pages** promote the current finalized canonical winner.
2. **Delivery pages** provide structured client handoff anchored to the canonical export, with related finalized batch exports when included.
3. **Share links** expose one owner-selected export for lightweight preview or distribution.

Campaign and delivery pages are winner/canonical-only. Share links remain a separate, owner-controlled single-export utility.

## Getting started

### Prerequisites

- Node.js 22 or newer
- pnpm 10
- a configured Supabase project
- Cloudflare R2 credentials for uploads and media delivery
- OpenAI credentials for text and speech generation
- Python 3.11 or newer when using the local inference sidecar
- a paid Runway account and `RUNWAYML_API_SECRET` only when a selected media provider is `runway`
- FFmpeg for final media composition

### Install

```bash
pnpm install
cp .env.example .env.local
```

Fill in `.env.local`, then apply the migrations in `supabase/migrations` to your Supabase project using your normal Supabase deployment workflow.

The example environment file covers the primary web, worker, storage, OpenAI, Runway, and local-inference settings. Billing and operator features additionally use the optional Stripe and operator variables defined in `apps/web/src/lib/env.ts`.

### Minimum web configuration

The authenticated web app needs:

```text
NEXT_PUBLIC_APP_NAME
NEXT_PUBLIC_APP_URL
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
```

The full server-backed workflow also needs:

```text
SUPABASE_SERVICE_ROLE_KEY
R2_ACCOUNT_ID
R2_ACCESS_KEY_ID
R2_SECRET_ACCESS_KEY
R2_BUCKET_NAME
```

### Worker configuration

The worker needs Supabase service-role access, R2 credentials, `OPENAI_API_KEY`, and the credentials or endpoint required by the selected media providers.

The worker reads directly from `process.env`; it does not load `.env.local` itself. Export the values in the shell that starts the worker:

```bash
set -a
source .env.local
set +a
pnpm dev:worker
```

## Media provider modes

Preview and scene-video generation are selected independently:

```text
PREVIEW_PROVIDER=runway|local_http|mock
SCENE_VIDEO_PROVIDER=runway|local_http
```

Supported combinations include:

- **Runway only:** Runway generates previews and scene video.
- **Hybrid:** Runway generates previews while the local sidecar generates scene video.
- **Fully local:** The local sidecar generates previews and scene video.
- **Lightweight development:** Mock previews avoid image-provider calls while another configured provider handles scene video.

Conditional requirements:

- `RUNWAYML_API_SECRET` is required when either provider is `runway`.
- `LOCAL_INFERENCE_BASE_URL` is required when either provider is `local_http`.
- `LOCAL_IMAGE_MODEL` applies to local previews.
- `LOCAL_VIDEO_MODEL` applies to local scene generation.

Current local defaults:

| Purpose          | Default               | Alternatives                                                             |
| ---------------- | --------------------- | ------------------------------------------------------------------------ |
| Preview image    | `flux-schnell`        | `sdxl-turbo` for a lighter path                                          |
| Scene video      | `cogvideox1.5-5b-i2v` | `wan2.1-i2v-14b-480p` for high-end hardware; `svd-img2vid` as a fallback |
| Device and dtype | `cuda` / `bf16`       | Configure to match the inference host                                    |

Local video generation is GPU-intensive. CPU-only and many macOS environments should use mock previews or a hosted provider for practical development.

### Local inference sidecar

The sidecar exposes `GET /health`, `POST /v1/preview`, `POST /v1/scene-video`, and `GET /v1/artifacts/{artifactId}`.

```bash
cd services/local-inference
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd ../..
pnpm dev:local-inference
```

The default base URL is `http://127.0.0.1:8788`.

## Run locally

Start each process in its own terminal:

```bash
pnpm dev:web
pnpm dev:worker
pnpm dev:local-inference # only when using local_http
```

`pnpm dev` starts the workspace applications together, but the worker-required values must already be exported into that shell.

Build and start one application directly when needed:

```bash
pnpm --filter @ai-ad-studio/web build
pnpm --filter @ai-ad-studio/web start

pnpm --filter @ai-ad-studio/worker build
pnpm --filter @ai-ad-studio/worker start
```

## Verification

Run the standard repository checks:

```bash
pnpm lint
pnpm test
pnpm build
pnpm typecheck
```

Do not run `pnpm build` and `pnpm typecheck` in parallel. Both touch `.next`, and concurrent execution can produce false-negative Next.js type-generation errors.

The supported sequential wrapper is:

```bash
pnpm verify:phase-31
```

Browser tests use deterministic Supabase-backed fixtures and require a reachable test project with service-role access:

```bash
pnpm --filter @ai-ad-studio/web test:e2e:setup
pnpm --filter @ai-ad-studio/web test:e2e:smoke
```

## Deployment validation

Apply migrations before starting production services, configure every runtime separately, and verify the deployed health endpoint:

```bash
curl -sS https://your-app.example.com/api/health
SMOKE_BASE_URL=https://your-app.example.com pnpm smoke:runtime
```

Optional token inputs extend the smoke test across public routes:

- `SMOKE_SHARE_TOKEN`
- `SMOKE_CAMPAIGN_TOKEN`
- `SMOKE_DELIVERY_TOKEN`
- `SMOKE_DELIVERY_EXPORT_ID`
- `SMOKE_REVIEW_TOKEN`
- `SMOKE_CHECK_SHARE_DOWNLOAD=true`
- `SMOKE_CHECK_CAMPAIGN_DOWNLOAD=true`
- `SMOKE_ALLOW_DEGRADED_HEALTH=true`
- `SMOKE_REQUEST_TIMEOUT_MS=15000`

Billing readiness can be checked separately with an operator secret:

```bash
SMOKE_BASE_URL=https://your-app.example.com \
SMOKE_BILLING_OPERATOR_SECRET=... \
pnpm smoke:billing
```

Do not treat token-backed media delivery as production-ready while `/api/health` reports degraded Supabase, service-role, R2, or public-URL readiness. `SMOKE_ALLOW_DEGRADED_HEALTH=true` is diagnostic only.

## Known limitations

- Infrastructure provisioning and migration deployment happen outside this repository.
- The worker must receive its environment through the launching shell or deployment runtime.
- Provider-backed rendering can require paid API access or substantial local GPU capacity.
- Local sidecar availability changes generation only; FFmpeg is still required for final composition.
- Browser automation requires a reachable Supabase environment and seeded fixtures.
- Public token routes must be smoke-tested against each real deployment and storage configuration.
- The reference workflow is intentionally constrained; an open-ended editor would be a separate product direction.

## Contributing

Read [CONTRIBUTING.md](CONTRIBUTING.md), [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md), [SECURITY.md](SECURITY.md), and [SUPPORT.md](SUPPORT.md) before contributing.

Install the repository-managed Git hooks with `pnpm hooks:setup`. Use `pnpm verify:push` for the shared pre-push gate or `pnpm safe-push -- <git push args>` for the repository wrapper.

## Security

Do not report vulnerabilities in public issues. Follow the private reporting guidance in [SECURITY.md](SECURITY.md).

## License

Licensed under the [MIT License](LICENSE).
反馈内容错误

看看同类模板

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