A Next.js application for managing and editing social media scripts with AI-powered features.
- 📝 Script management dashboard
- ✏️ Rich text editor with auto-save
- 🤖 AI-powered writing tools (Fix CTA, Rewrite Hook, Shorten)
- 🌐 English translation generation
- 🔊 Text-to-Speech audio generation
- 💾 Supabase integration for data storage
- Node.js 18+ installed
- npm or yarn package manager
- Supabase account and project
- Google Gemini API key (for AI features)
- Minimax API key and Group ID (for TTS feature)
- Install dependencies:
npm install
# or
yarn install- Set up environment variables:
Copy .env.example to .env.local and fill in your credentials:
cp .env.example .env.localEdit .env.local with your actual values:
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Your Supabase anonymous keyGEMINI_API_KEY- Your Google Gemini API keyMINIMAX_API_KEY- Your Minimax API keyMINIMAX_GROUP_ID- Your Minimax Group ID
- Create a
scriptstable with the following schema:
CREATE TABLE scripts (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
source_url TEXT,
raw_text TEXT NOT NULL,
title TEXT NOT NULL,
content_cn_draft TEXT NOT NULL,
content_cn_final TEXT,
content_en TEXT,
audio_url TEXT,
status TEXT CHECK (status IN ('new', 'editing', 'done')) DEFAULT 'new',
tags TEXT[] DEFAULT '{}'
);- Create a storage bucket named
scripts-audio:- Go to Storage in your Supabase dashboard
- Create a new bucket called
scripts-audio - Set it to public (or configure RLS policies)
npm run dev
# or
yarn devOpen http://localhost:3000 in your browser.
npm run build
npm start├── app/
│ ├── actions/ # Server actions (AI, audio generation)
│ ├── editor/[id]/ # Editor page and components
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Dashboard page
│ └── globals.css # Global styles
├── lib/
│ └── supabase/ # Supabase client configuration
└── types/ # TypeScript type definitions
See detailed deployment guides:
Quick start:
- Create GitHub repository (see
GITHUB_SETUP.md) - Deploy to Vercel (see
VERCEL_DEPLOY.md) - Configure environment variables in Vercel Dashboard
- Next.js 14 (App Router)
- React 18
- TypeScript
- Tailwind CSS
- Supabase (Database & Storage)
- Google Gemini API (
@google/genai) - Minimax T2S API