LogoAI Ad Generator 文档
LogoAI Ad Generator 文档
首页AI Ad Generator Guide
X (Twitter)

AI Ad Generator Guide

A complete guide to AI Ad Generator — the AI-powered platform for creating stunning advertisements.

What is AI Ad Generator?

AI Ad Generator is a powerful AI-powered platform that helps you create professional, high-converting advertisements in seconds. Just describe your product or service, and our advanced AI generates compelling ad copy tailored to your needs.

Tech Stack

  • Framework: Next.js App Router with TypeScript
  • Auth: Better Auth (GitHub + Google OAuth, email/password)
  • Database: PostgreSQL with Drizzle ORM
  • Payments: Stripe (subscriptions, one-time purchases, credit packages)
  • AI Model: bytedance/seedance-2-mini
  • UI: Tailwind CSS + Radix UI + Lucide icons
  • i18n: next-intl (English + Chinese)
  • Email: Resend with React Email templates
  • Content: Fumadocs for documentation, MDX for blog

Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (recommended)
  • PostgreSQL database

Installation

git clone https://github.com/zhangst23/ai-ad-generator.git
cd ai-ad-generator
pnpm install

Environment Setup

Copy the example environment file and fill in your values:

cp env.example .env.local

Key environment variables:

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/ai-ad-generator

# Auth
BETTER_AUTH_SECRET=your-secret-key
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# AI
NEXT_PUBLIC_KIE_API_KEY=your-kie-api-key
NEXT_PUBLIC_KIE_MODEL=bytedance/seedance-2-mini

# Stripe
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...

# Email
RESEND_API_KEY=re_...

Database Setup

Generate and run migrations:

pnpm db:generate
pnpm db:migrate

Start Development

pnpm dev

Visit http://localhost:3000 to see your app.

Project Structure

src/
├── app/                  # Next.js App Router pages
│   ├── api/              # API routes (auth, webhooks, etc.)
│   └── [locale]/         # Localized pages
├── components/           # React components
├── config/               # App configuration
├── db/                   # Database schema and connection
├── lib/                  # Utilities and shared code
├── credits/              # Credit system logic
├── payment/              # Stripe integration
├── mail/                 # Email templates
├── ai/                   # AI provider configuration
└── i18n/                 # Internationalization config

Key Features

AI Ad Generation

AI Ad Generator uses the bytedance/seedance-2-mini model to:

  • Generate catchy taglines and headlines
  • Create compelling ad copy for any product
  • Optimize content for different advertising platforms
  • Generate multiple variations for A/B testing

Authentication

Uses Better Auth with:

  • GitHub and Google OAuth
  • Email/password credentials
  • Account linking
  • Session management with caching

Payments (Stripe)

Supports multiple payment models:

  • Subscriptions: Monthly and yearly plans (Free, Pro)
  • One-time purchases: Lifetime access, credit packages
  • Credits: Usage-based billing with monthly refresh

Internationalization

Built-in support for multiple languages:

  • As-needed prefix strategy (default locale omitted from URL)
  • Translation files in messages/en.json and messages/zh.json
  • Localized email templates

Credit System

Flexible credit management:

  • Monthly credit refresh for subscribers
  • Registration bonus credits
  • Credit packages (Basic, Standard, Premium)
  • Usage tracking with transaction history

Generating Ads

  1. Navigate to the AI Ad Generator page
  2. Select the AI model (bytedance/seedance-2-mini)
  3. Describe your product or service
  4. Click generate to receive professional ad copy
  5. Use the generated content for your campaigns

Common Tasks

Adding a New Page

  1. Create a new file in src/app/[locale]/(marketing)/
  2. Add the route to src/routes.ts
  3. Add navigation links in src/config/navbar-config.tsx

Adding a New Language

  1. Add locale config in src/config/website.tsx
  2. Create translation file in messages/{locale}.json
  3. Update i18n routing in src/i18n/routing.ts

Deploying to Production

pnpm build

The app is ready for deployment on Vercel, Docker, or any Node.js hosting platform.

Learn More

  • Configuration Guide — Customize the template for your needs
  • API Reference — Explore available endpoints and actions

目录

What is AI Ad Generator?Tech StackQuick StartPrerequisitesInstallationEnvironment SetupDatabase SetupStart DevelopmentProject StructureKey FeaturesAI Ad GenerationAuthenticationPayments (Stripe)InternationalizationCredit SystemGenerating AdsCommon TasksAdding a New PageAdding a New LanguageDeploying to ProductionLearn More