This repository uses a dual-branch deployment strategy to optimize for different platforms.
Optimized for: Vercel serverless functions
Configuration:
- Runtime:
nodejs - Full Playwright support for browser automation
- 60-second function timeout
- Three-tier scraping: Firecrawl → Playwright → fetch
Deploy to Vercel:
# Automatic deployment on push to main
git push origin main
# Or manual deployment
vercel --prodBest for:
- Quick deployment with GitHub integration
- Full scraping capabilities
- Development and testing
Optimized for: Cloudflare Workers global edge network
Configuration:
- Runtime:
edge - D1 Database caching (30-day cache)
- Two-tier scraping: Firecrawl → fetch (Playwright not available)
- Global edge performance
Deploy to Cloudflare:
# Build for Cloudflare Workers
npm run worker:build
# Deploy
npm run deploy
# Or manually
wrangler deployBest for:
- Production deployment with D1 caching
- Global edge performance
- Cost-effective at scale
| Feature | main (Vercel) |
worker (Cloudflare) |
|---|---|---|
| Runtime | Node.js | Edge |
| Playwright | ✅ Yes | ❌ No |
| Database Cache | ❌ No | ✅ D1 (30 days) |
| Timeout | 60s | Configurable |
| Deployment | Auto (GitHub) | CLI/GitHub Actions |
| Best For | Development, Full features | Production, Caching |
When you make changes to core logic (not platform-specific config):
# On worker branch
git checkout worker
git merge main
# Resolve conflicts (keep worker's runtime config)
# Usually conflicts will be in:
# - src/app/api/analyze/route.ts (runtime config)
# - src/app/api/v1/analyzer/route.ts (runtime config)
git push origin workerFiles that should differ between branches:
src/app/api/*/route.ts- Runtime configuration.github/workflows/- Deployment workflows (if different)
Files that should be the same:
- All business logic and components
- Analysis prompts and scoring
- UI and frontend code
- Shared utilities
- Make changes on
mainbranch (default development) - Test locally:
npm run dev - Push to main: Auto-deploys to Vercel
- Merge to worker: When ready for Cloudflare deployment
- Deploy worker:
npm run deploy
Already handled by Vercel's GitHub integration.
Create .github/workflows/deploy-worker.yml:
name: Deploy to Cloudflare Workers
on:
push:
branches: [worker]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run worker:build
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}# Switch to Vercel branch
git checkout main
# Switch to Cloudflare branch
git checkout worker
# Sync worker with main changes
git checkout worker
git merge main
git push origin worker
# Deploy Vercel (main branch)
git push origin main
# Deploy Cloudflare (worker branch)
git checkout worker
npm run deploy