DocsAdvancedDeveloper Setup

Developer Setup

Set up the Draftly codebase locally for development or self-hosting.

Prerequisites

To run Draftly locally you need: - Node.js 18+ with npm or pnpm - A Firebase project (Firestore, Auth, Storage enabled) - API keys: Google Gemini, Fal.ai (optional), API-Easy (for Veo video and Nano Banana images) - A Dodo Payments account (for billing webhooks — optional for dev)

Clone & Install

bash
git clone https://github.com/draftly-space/draftly-client.git
cd draftly-client
npm install
cp .env.example .env.local

Edit .env.local with your Firebase config and API keys, then run the dev server.

Environment Variables

VariableDescriptionRequired
GOOGLE_AI_KEYGemini API key for site HTML generationYes
NEXT_PUBLIC_FIREBASE_*Firebase client config (6 vars)Yes
FIREBASE_SERVICE_ACCOUNTFirebase Admin SDK JSON (base64)Yes
FAL_KEYFal.ai — Seedream images, LTX video extendFor full media
APIEASY_KEYAPI-Easy — Veo 3.1 video, Nano Banana imagesFor video
DODO_PAYMENTS_KEYDodo Payments billing webhook secretFor billing
CLOUDFLARE_ZONE_IDCloudflare zone for CDN cache purge on publishFor CDN

Run Development Server

bash
npm run dev

Open http://localhost:3000. The 3D builder is at http://localhost:3000/3d-builder.