开发者配置
在本地配置 Draftly 代码库用于开发或自托管。
前提条件
在本地运行 Draftly 需要: - Node.js 18+ 配合 npm 或 pnpm - Firebase 项目(已启用 Firestore、Auth、Storage) - API 密钥:Google Gemini、Fal.ai(可选)、API-Easy(用于 Veo 视频和 Nano Banana 图像) - Dodo Payments 账户(用于计费 webhook —— 开发可选)
克隆与安装
bash
git clone https://github.com/draftly-space/draftly-client.git cd draftly-client npm install cp .env.example .env.local
用您的 Firebase 配置和 API 密钥编辑 .env.local,然后运行开发服务器。
环境变量
| 变量 | 描述 | 是否必需 |
|---|---|---|
GOOGLE_AI_KEY | 用于网站 HTML 生成的 Gemini API 密钥 | 是 |
NEXT_PUBLIC_FIREBASE_* | Firebase 客户端配置(6 个变量) | 是 |
FIREBASE_SERVICE_ACCOUNT | Firebase Admin SDK JSON(base64) | 是 |
FAL_KEY | Fal.ai —— Seedream 图像,LTX 视频扩展 | 完整媒体功能需要 |
APIEASY_KEY | API-Easy —— Veo 3.1 视频,Nano Banana 图像 | 视频功能需要 |
DODO_PAYMENTS_KEY | Dodo Payments 计费 webhook 密钥 | 计费功能需要 |
CLOUDFLARE_ZONE_ID | 发布时 CDN 缓存清除的 Cloudflare 区域 | CDN 功能需要 |
运行开发服务器
bash
npm run dev
打开 http://localhost:3000。3D 构建器位于 http://localhost:3000/3d-builder。