Implements #10 - .env.example with all required environment variables - vercel.json with CORS headers and region config - docs/DEPLOYMENT.md with full deployment instructions - API key setup guides - Troubleshooting section Closes #10
3.3 KiB
3.3 KiB
Deployment Guide
This guide covers deploying Cutroom to Vercel.
Prerequisites
- Node.js 18+
- pnpm
- Vercel account
- API keys for external services
Quick Start (Vercel)
The project auto-deploys on push to main. Vercel is pre-configured via the hackathon.
1. Set Environment Variables
In the Vercel dashboard → Settings → Environment Variables:
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
✅ | Vercel Postgres connection string |
OPENAI_API_KEY |
✅ | For script generation |
ELEVENLABS_API_KEY |
✅ | For voice synthesis |
PEXELS_API_KEY |
✅ | For stock footage |
BLOB_READ_WRITE_TOKEN |
✅ | For asset storage |
BASE_RPC_URL |
⚪ | Default: https://mainnet.base.org |
WALLET_PRIVATE_KEY |
⚪ | For token treasury operations |
NEXT_PUBLIC_CUTROOM_TOKEN_ADDRESS |
⚪ | Set after token deployment |
2. Database Setup
Vercel Postgres is recommended:
- Go to Vercel Dashboard → Storage → Create Database
- Select "Postgres"
- Copy the connection string to
DATABASE_URL - Run migrations:
npx prisma db push
3. Deploy
Push to main → Vercel auto-deploys.
Or manually:
vercel --prod
4. Verify
Check the health endpoint:
curl https://team-cutroom.vercel.app/api/health
# → {"status":"ok","timestamp":"..."}
Local Development
# Install dependencies
pnpm install
# Copy environment file
cp .env.example .env.local
# Edit .env.local with your values
# Push database schema
pnpm db:push
# Run dev server
pnpm dev
API Keys
OpenAI
- Go to https://platform.openai.com/api-keys
- Create a new API key
- Add to
OPENAI_API_KEY
ElevenLabs
- Go to https://elevenlabs.io/
- Sign up and go to Profile → API Keys
- Create a key, add to
ELEVENLABS_API_KEY - Find a voice ID at https://elevenlabs.io/voices
- Add to
ELEVENLABS_VOICE_ID
Pexels
- Go to https://www.pexels.com/api/
- Sign up and get an API key
- Add to
PEXELS_API_KEY
Vercel Blob
- In Vercel Dashboard → Storage → Create
- Select "Blob"
- Copy the read-write token to
BLOB_READ_WRITE_TOKEN
Token Deployment
See the main README for token deployment instructions.
Troubleshooting
Database Connection Failed
- Check
DATABASE_URLformat - Ensure Vercel Postgres is provisioned
- Run
npx prisma db pushto sync schema
Build Fails
- Check for TypeScript errors:
pnpm typecheck - Check for lint errors:
pnpm lint - Run tests:
pnpm test
API Routes Return 500
- Check environment variables are set
- Check Vercel logs for error details
- Verify database connection
Architecture
Vercel
├── Next.js App (Edge Functions)
│ ├── /api/pipelines/ → Pipeline CRUD
│ ├── /api/stages/ → Stage operations
│ └── /api/webhooks/ → External integrations
├── Vercel Postgres → Pipeline & stage data
├── Vercel Blob → Generated assets
└── Edge Config (optional) → Feature flags
Security Notes
- Never commit
.env.localor any file with secrets - Use Vercel's encrypted environment variables for sensitive keys
- The
WALLET_PRIVATE_KEYshould only be set in production for treasury operations - API routes validate input; don't bypass validation