deploy-router
npx skills add https://github.com/anton-abyzov/specweave --skill deploy-router
Agent 安装分布
Skill 文档
Deploy Router – Vercel vs Cloudflare vs GitHub Pages Decision Engine
I intelligently route your deployment to the optimal platform based on project analysis, including repository visibility (private vs public).
When to Use This Skill
Ask me when you need help with:
- Platform Decision: “Should I deploy to Vercel or Cloudflare?”
- Project Analysis: “Analyze my project for deployment”
- SEO-Aware Routing: “I need dynamic SEO for my Next.js app”
- Cost Optimization: “What’s the cheapest deployment option?”
- Edge-First: “I want global edge deployment”
- Private Repo Deployment: “Where can I deploy my private repo for free?”
ð¨ CRITICAL: Repository Visibility Check (ALWAYS DO FIRST)
GitHub Pages has a major limitation: Free GitHub accounts can ONLY deploy GitHub Pages from public repositories. Private repo deployment requires GitHub Pro, Team, or Enterprise.
Priority Decision Based on Visibility
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â STEP 0: CHECK REPOSITORY VISIBILITY â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââ
â Is the repository PRIVATE? â
âââââââââââââââââââââââââââââââââ
â â
YES NO (Public)
â â
â¼ â¼
âââââââââââââââââââââââââââ âââââââââââââââââââââââââââââââ
â â GitHub Pages FREE â â â
All platforms available â
â â
Cloudflare Pages â â GitHub Pages is an option â
â â
Vercel â â for static public sites â
â â
Netlify â âââââââââââââââââââââââââââââââ
âââââââââââââââââââââââââââ
How to Detect Repository Visibility
# Check if git remote exists and get repo visibility
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
if [[ "$REMOTE_URL" =~ github.com[:/]([^/]+)/([^/.]+) ]]; then
OWNER="${BASH_REMATCH[1]}"
REPO="${BASH_REMATCH[2]}"
# Use GitHub CLI to check visibility
VISIBILITY=$(gh repo view "$OWNER/$REPO" --json visibility -q '.visibility' 2>/dev/null)
if [[ "$VISIBILITY" == "PRIVATE" ]]; then
echo "â ï¸ PRIVATE REPOSITORY DETECTED"
echo " GitHub Pages requires GitHub Pro/Team/Enterprise for private repos"
echo " â Recommended: Cloudflare Pages (free for private repos)"
echo " â Alternative: Vercel (free tier available)"
else
echo "â
PUBLIC REPOSITORY - All deployment options available"
fi
fi
Platform Availability by Repo Visibility
| Platform | Private Repo (Free) | Public Repo (Free) | Notes |
|---|---|---|---|
| Cloudflare Pages | â Yes | â Yes | Best for private repos – No visibility restrictions |
| Vercel | â Yes | â Yes | Free tier works for both |
| Netlify | â Yes | â Yes | Free tier works for both |
| GitHub Pages | â No (requires Pro) | â Yes | BLOCKED for free private repos |
Decision Matrix
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PROJECT ANALYSIS â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â
â¼
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Does project require Node.js runtime features? â
â (Server Components with DB, fs, crypto, native modules) â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â â
YES NO
â â
â¼ â¼
âââââââââââââââââââââââ âââââââââââââââââââââââââââââââ
â VERCEL â â Static/Edge compatible? â
â (Node.js runtime) â â (No Node.js dependencies) â
âââââââââââââââââââââââ âââââââââââââââââââââââââââââââ
â
ââââââââââ´âââââââââ
YES NO
â â
â¼ â¼
âââââââââââââââââââ âââââââââââââââââââ
â CLOUDFLARE â â VERCEL â
â (Edge/Pages) â â (needs runtime) â
âââââââââââââââââââ âââââââââââââââââââ
Detailed Decision Tree
Step 1: Framework Detection
| Framework | Detection | Default Recommendation |
|---|---|---|
| Next.js | next.config.js/ts/mjs |
Depends on features used |
| Remix | remix.config.js |
Vercel (Node) or Cloudflare (adapter) |
| Astro | astro.config.mjs |
Cloudflare (static-first) |
| Nuxt | nuxt.config.ts |
Vercel (SSR) or Cloudflare (static) |
| SvelteKit | svelte.config.js |
Either (adapter-based) |
| Static (Vite/CRA) | vite.config.ts, no SSR |
Cloudflare Pages |
Step 2: Feature Analysis
Signals for VERCEL (Node.js Runtime):
- Server Components with database calls (
prisma,drizzle, direct SQL) -
fsmodule usage (file system operations) -
cryptoor native Node.js modules - Server Actions with complex backend logic
- Long-running API routes (> 30s execution)
- WebSocket connections (real-time features)
- Heavy image processing (Sharp, Jimp)
- PDF generation (Puppeteer, Playwright)
- Dynamic OG images with complex rendering
-
getServerSidePropswith database queries
Signals for CLOUDFLARE (Edge/Static):
- Static site generation (SSG)
- Simple API routes (< 30s, no Node.js deps)
- Edge-compatible database (Cloudflare D1, Turso, PlanetScale)
- KV storage for caching
- R2 for file storage
- Durable Objects for state
- Cost-sensitive deployment
- Global edge distribution priority
- Simple auth (JWT, sessions without DB)
Step 3: SEO Requirements (Vercel Wins for Dynamic SEO)
When SEO matters most, choose carefully:
| SEO Need | Vercel | Cloudflare | GitHub Pages |
|---|---|---|---|
| Static meta tags | â | â | â |
| Dynamic meta from DB | â (SSR) BEST | â ï¸ (ISR/Edge only) | â (static only) |
| Per-page dynamic OG | â BEST | â ï¸ (limited) | â |
| Real-time product data | â (SSR) BEST | â ï¸ (stale cache) | â |
| Sitemap generation | â | â | â (manual) |
| robots.txt | â | â | â |
| Structured data (JSON-LD) | â (dynamic) | â (static) | â (static) |
| Core Web Vitals | â (optimized) | â (fast edge) | â (fast static) |
| SSR/ISR for freshness | â BEST | â ï¸ (edge-limited) | â |
SEO Tier Recommendations
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â SEO REQUIREMENTS ROUTING â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â TIER 1 - Critical SEO (choose VERCEL): â
â ââ E-commerce product pages (prices change, inventory) â
â ââ News/content sites (freshness matters for Google) â
â ââ SaaS landing pages with dynamic pricing â
â ââ Marketplace listings (real-time availability) â
â ââ Any page where DB-driven meta tags are required â
â â
â TIER 2 - Good SEO (CLOUDFLARE works): â
â ââ Blogs with static content â
â ââ Documentation sites â
â ââ Marketing pages (rarely changing) â
â ââ Portfolio sites â
â ââ ISR with revalidation (1-hour stale OK) â
â â
â TIER 3 - Basic SEO (any platform): â
â ââ Internal tools (SEO doesn't matter) â
â ââ Admin dashboards â
â ââ Private apps â
â ââ Prototypes/MVPs â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Why Vercel Wins for Dynamic SEO
- True SSR: Every request can fetch fresh data from database
- ISR with on-demand revalidation:
revalidateTag()andrevalidatePath() - Dynamic OG images:
@vercel/oggenerates images server-side - Edge + Node.js hybrid: Edge for speed, Node.js for data fetching
- Built-in image optimization: Automatic WebP/AVIF conversion
- Preview deployments: Test SEO before going live
When Cloudflare is SEO-Acceptable
- Static blogs: Meta tags baked at build time
- Documentation: Content rarely changes
- ISR with Workers: If 1-hour stale data is acceptable
- Hybrid approach: Cloudflare Pages + external API for dynamic data
Platform Comparison
Vercel
Best For:
- Next.js apps with full Node.js features
- Dynamic SEO (meta tags from database)
- Server Components with complex data fetching
- Image optimization (built-in)
- Preview deployments for PRs
- Teams needing easy DX
Pricing (2025):
- Hobby: Free (limited)
- Pro: $20/user/month
- Serverless Functions: 100GB-hours free, then $0.18/GB-hour
- Edge Functions: 500K free, then $0.65/million
Limitations:
- Serverless function timeout: 10s (Hobby), 60s (Pro), 300s (Enterprise)
- Edge function timeout: 30s
- Cold starts on low-traffic sites
Cloudflare
Best For:
- Static sites with edge caching
- Edge-first applications
- Cost-sensitive projects
- Simple API routes
- Global CDN distribution
- Cloudflare ecosystem (R2, D1, KV)
- ð PRIVATE REPOS (works with free tier!)
Pricing (2025):
- Workers Free: 100K requests/day
- Workers Paid: $5/month + $0.50/million requests
- Pages: Unlimited sites, 500 builds/month free
- R2: 10GB free, then $0.015/GB
Limitations:
- No Node.js runtime (V8 isolates only)
- CPU time limit: 10ms (free), 30s (paid)
- Memory: 128MB
- No native modules (Sharp, Prisma binary, etc.)
Why Cloudflare for Private Repos:
- â No repository visibility restrictions
- â Connect private GitHub repos directly
- â Automatic deployments from private branches
- â Preview deployments for PRs
- â Free tier is generous
GitHub Pages
Best For:
- PUBLIC repositories only (free tier)
- Open-source documentation
- Public project sites
- Static Jekyll/Hugo/Astro sites
- When source code visibility is intentional
Pricing (2025):
- Free for public repos
- Requires GitHub Pro/Team/Enterprise for private repos ($4-21/user/month)
- 1GB storage limit
- 100GB bandwidth/month
Limitations:
- â NO PRIVATE REPO SUPPORT on free accounts
- No server-side rendering
- No API routes
- No dynamic content
- Build time limit: 10 minutes
- No environment variables at runtime
When to Use GitHub Pages:
â
DO use GitHub Pages when:
- Repository is PUBLIC
- Content is 100% static
- You want zero deployment config
- Open-source project docs
â DO NOT use GitHub Pages when:
- Repository is PRIVATE (use Cloudflare Pages instead!)
- You need SSR/dynamic content
- You need API routes
- You need environment variables
Analysis Workflow
When user asks “where should I deploy?”, I follow this order:
0. Check Repository Visibility (FIRST!)
# CRITICAL: Check if repo is private BEFORE anything else
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
if [[ "$REMOTE_URL" =~ github.com[:/]([^/]+)/([^/.]+) ]]; then
OWNER="${BASH_REMATCH[1]}"
REPO="${BASH_REMATCH[2]}"
# Check visibility with GitHub CLI
VISIBILITY=$(gh repo view "$OWNER/$REPO" --json visibility -q '.visibility' 2>/dev/null)
if [[ "$VISIBILITY" == "PRIVATE" ]]; then
echo "ð PRIVATE REPO - GitHub Pages NOT available on free tier"
echo " Recommended: Cloudflare Pages or Vercel"
GITHUB_PAGES_AVAILABLE=false
else
echo "â
PUBLIC REPO - All platforms available"
GITHUB_PAGES_AVAILABLE=true
fi
else
echo "â ï¸ No GitHub remote detected - assuming private"
GITHUB_PAGES_AVAILABLE=false
fi
1. Scan Project Structure
# Framework detection
ls -la | grep -E "next.config|remix.config|astro.config|nuxt.config|svelte.config|vite.config"
# Package.json analysis
cat package.json | jq '.dependencies, .devDependencies'
# Check for SSR/SSG configuration
grep -r "getServerSideProps\|getStaticProps\|generateStaticParams" --include="*.tsx" --include="*.ts" | head -20
2. Detect Node.js Dependencies
# Native module detection
grep -E "prisma|sharp|puppeteer|playwright|canvas|bcrypt|argon2" package.json
# File system usage
grep -r "require\('fs'\)\|from 'fs'\|import fs" --include="*.ts" --include="*.tsx" --include="*.js" | head -10
# Crypto usage
grep -r "require\('crypto'\)\|from 'crypto'" --include="*.ts" --include="*.tsx" | head -10
3. Analyze SEO Requirements
# Dynamic meta detection
grep -r "generateMetadata\|Head.*title\|meta.*content" --include="*.tsx" --include="*.ts" | head -10
# Database calls in metadata
grep -rB5 "generateMetadata" --include="*.tsx" | grep -E "prisma|db\.|fetch\("
# Check for e-commerce/content patterns that need fresh SEO
grep -rE "product|price|inventory|article|news" --include="*.tsx" | head -10
4. Generate Recommendation
Based on analysis, I provide:
## ð Deployment Recommendation
**Platform**: [VERCEL / CLOUDFLARE]
**Confidence**: [HIGH / MEDIUM / LOW]
### Analysis Results
| Factor | Finding | Impact |
|--------|---------|--------|
| Framework | Next.js 14 | Neutral |
| Node.js deps | Prisma, Sharp | â VERCEL |
| SEO needs | Dynamic meta | â VERCEL |
| Budget | Cost-sensitive | â Cloudflare |
| Scale | Global edge | â Cloudflare |
### Why [PLATFORM]
[Detailed reasoning based on findings]
### Configuration
[Platform-specific setup instructions]
### Alternative
If you need [opposite platform features], consider:
- [Migration path]
- [Hybrid approach]
Quick Decision Guide
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â MASTER DECISION TREE (Check in order!) â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â STEP 1: Is repo PRIVATE? â
â ââ YES â â Eliminate GitHub Pages â
â â â Go to Step 2 â
â ââ NO â GitHub Pages is an option (static only) â
â â
â STEP 2: Do you need dynamic SEO? â
â ââ YES â â
VERCEL (SSR, real-time meta, OG images) â
â ââ NO â Go to Step 3 â
â â
â STEP 3: Do you need Node.js runtime? â
â ââ YES â â
VERCEL (Prisma, Sharp, fs, crypto) â
â ââ NO â Go to Step 4 â
â â
â STEP 4: Is it a static site? â
â ââ YES, Private repo â â
CLOUDFLARE Pages â
â ââ YES, Public repo â â
CLOUDFLARE or GitHub Pages â
â ââ NO â Go to Step 5 â
â â
â STEP 5: Do you need edge performance + cost savings? â
â ââ YES â â
CLOUDFLARE (Workers/Pages) â
â ââ NO â â
VERCEL (default choice for Next.js) â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â PLATFORM QUICK REFERENCE â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â Use VERCEL when: â
â ââ Dynamic SEO is critical (e-commerce, news, marketplaces) â
â ââ Next.js with Server Components + DB â
â ââ Native Node.js modules (Sharp, Prisma, Puppeteer) â
â ââ Real-time OG image generation â
â ââ WebSockets/real-time features â
â ââ Team wants easiest DX â
â â
â Use CLOUDFLARE when: â
â ââ ð PRIVATE REPO (GitHub Pages blocked on free tier!) â
â ââ Static site (Astro, Hugo, plain HTML) â
â ââ Edge-first, low latency priority â
â ââ Cost-sensitive (Cloudflare is cheaper) â
â ââ Simple API routes without Node.js deps â
â ââ Already using Cloudflare ecosystem (R2, D1, KV) â
â ââ Global CDN distribution priority â
â â
â Use GITHUB PAGES when: â
â ââ Repository is PUBLIC (required for free tier!) â
â ââ 100% static content (no SSR, no API) â
â ââ Open-source project documentation â
â ââ Zero deployment configuration needed â
â â
â HYBRID approach: â
â ââ Frontend on Cloudflare Pages (edge speed) â
â ââ API/backend on Vercel Functions (Node.js power) â
â ââ Best of both: edge speed + Node.js + full SEO â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Integration with DevOps Agent
After recommendation, I trigger the appropriate deployment:
// For Vercel deployment
Task({
subagent_type: "sw-infra:devops:devops",
prompt: `Deploy to Vercel:
- Project: ${projectName}
- Framework: ${framework}
- Environment: ${env}
Use existing VERCEL_TOKEN from .env`,
description: "Deploy to Vercel"
});
// For Cloudflare deployment
Task({
subagent_type: "sw-infra:devops:devops",
prompt: `Deploy to Cloudflare:
- Project: ${projectName}
- Type: ${isStatic ? 'Pages' : 'Workers'}
Use wrangler CLI (already authenticated)`,
description: "Deploy to Cloudflare"
});
Trigger Keywords
This skill activates for:
- deploy, deployment
- vercel vs cloudflare, cloudflare vs vercel
- where to deploy, where should I deploy
- vercel, cloudflare workers, cloudflare pages
- edge deployment, SSR deployment
- static site deployment, JAMstack deployment
- which hosting, best hosting for
- deployment recommendation, deployment decision
- github pages (â ï¸ will check visibility first!)
- private repo deployment, private repository hosting
- SEO hosting, best SEO platform, dynamic SEO deployment
- e-commerce deployment, product page SEO
Examples
Example 1: Next.js with Prisma
User: "Where should I deploy my Next.js app with Prisma?"
Analysis:
- Framework: Next.js 14
- Database: Prisma (requires Node.js runtime)
- Impact: MUST use Node.js-compatible host
Recommendation: VERCEL
- Prisma requires Node.js runtime (binary execution)
- Cloudflare Workers don't support Prisma's native binary
- Vercel provides Node.js serverless functions
Alternative: Use Prisma Edge with Cloudflare D1 (requires migration)
Example 2: Astro Blog
User: "Best deployment for my Astro blog?"
Analysis:
- Framework: Astro (static-first)
- Database: None
- SEO: Static meta tags only
Recommendation: CLOUDFLARE PAGES
- 100% static site, no server runtime needed
- Free tier covers most blogs
- Global edge CDN included
- Faster than Vercel for static content
Example 3: Next.js E-commerce with Dynamic SEO
User: "I'm building an e-commerce site with product pages that need dynamic meta tags from the database"
Analysis:
- Framework: Next.js
- SEO: Dynamic meta from database (products, prices)
- Database: PostgreSQL with product catalog
Recommendation: VERCEL
- Dynamic `generateMetadata()` with DB calls
- Server-side rendering for SEO
- Product pages need fresh data for Google
- Cloudflare would require ISR which may show stale prices
Example 4: Private Repo Static Site (ð IMPORTANT!)
User: "Where should I deploy my private Astro documentation site?"
Analysis:
- Framework: Astro (static-first)
- Repository: PRIVATE â ï¸
- SEO: Static meta tags only
- Content: Internal documentation
Step 0 - Visibility Check:
ð PRIVATE REPO DETECTED
â GitHub Pages: NOT AVAILABLE (requires GitHub Pro/Team)
â
Cloudflare Pages: Available (free tier)
â
Vercel: Available (free tier)
Recommendation: CLOUDFLARE PAGES
- Private repo works with free tier
- Static site = perfect fit for edge deployment
- Fast global CDN
- 500 builds/month free
- No Node.js needed
Alternative: Vercel (also works, but Cloudflare is cheaper for static)
â ï¸ DO NOT recommend GitHub Pages for private repos!
Example 5: High-SEO E-commerce (Vercel wins)
User: "I need the best SEO possible for my product catalog with 10,000+ products"
Analysis:
- Framework: Next.js 14 with App Router
- Products: 10,000+ items with prices, inventory, reviews
- SEO Requirements: CRITICAL
- Dynamic meta tags per product
- Real-time pricing in structured data
- Fresh inventory status for Google
- Dynamic OG images showing product photos
SEO Analysis Results:
| Requirement | Vercel | Cloudflare | GitHub Pages |
|-------------|--------|------------|--------------|
| Dynamic meta from DB | â
SSR | â ï¸ ISR (stale) | â |
| Real-time prices | â
| â ï¸ (1hr delay) | â |
| Dynamic OG images | â
@vercel/og | â ï¸ Limited | â |
| Inventory freshness | â
SSR | â ï¸ Cache | â |
Recommendation: VERCEL (STRONG)
- SSR ensures Google sees fresh data every crawl
- `generateMetadata()` with database calls
- `@vercel/og` for product OG images
- ISR with on-demand revalidation for cache-then-fresh
- Image optimization built-in
Why NOT Cloudflare:
- ISR cache means Google might see stale prices
- No native OG image generation
- Edge runtime can't run Prisma directly
Cost consideration:
- Vercel Pro ($20/month) vs Cloudflare (free)
- For critical SEO sites, Vercel Pro is worth it
Migration Paths
Vercel â Cloudflare
- Replace Prisma with Drizzle + D1/Turso
- Convert Server Components to Edge-compatible
- Use
@cloudflare/next-on-pagesadapter - Move file storage to R2
Cloudflare â Vercel
- Remove Cloudflare-specific bindings (KV, D1, R2)
- Replace with Vercel equivalents (Edge Config, Postgres, Blob)
- Update
wrangler.tomltovercel.json - Test Node.js compatibility
Enterprise Considerations
Scaling Beyond Free Tier
| Platform | Free Tier Limit | When to Upgrade | Enterprise Cost |
|---|---|---|---|
| Vercel | 100GB bandwidth, 100 serverless hours | > 50K requests/day | $20/user/month (Pro), Custom (Enterprise) |
| Cloudflare | 100K requests/day, 500 builds/month | > 100K requests/day | $5/month (Workers), Custom (Enterprise) |
| GitHub Pages | 100GB bandwidth, 10 min builds | N/A (static only) | Pro: $4/month, Team: $4/user |
Enterprise Features Comparison
| Feature | Vercel Enterprise | Cloudflare Enterprise | Notes |
|---|---|---|---|
| SLA | 99.99% | 100% (edge) | Cloudflare edge is bulletproof |
| DDoS Protection | â Included | â Industry-leading | Cloudflare is the gold standard |
| SSO/SAML | â Enterprise | â Enterprise | Both require enterprise tier |
| Audit Logs | â Enterprise | â Enterprise | Compliance requirements |
| Custom Domains | Unlimited | Unlimited | Both generous |
| Private Network | â Secure Compute | â Cloudflare Tunnel | Zero-trust networking |
| Compliance | SOC2, HIPAA | SOC2, HIPAA, PCI-DSS | Cloudflare has broader certs |
When Enterprise Tier is Needed
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â ENTERPRISE TIER TRIGGERS â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â Vercel Enterprise ($$$): â
â ââ > 1M requests/month â
â ââ > 100 team members â
â ââ SOC2/HIPAA compliance required â
â ââ SLA guarantees needed for contracts â
â ââ Advanced observability (OpenTelemetry) â
â ââ Dedicated support â
â â
â Cloudflare Enterprise ($$$): â
â ââ > 10M requests/day â
â ââ Custom WAF rules â
â ââ Advanced bot management â
â ââ PCI-DSS compliance â
â ââ 24/7 phone support â
â ââ Custom SSL certificates â
â â
â Stay on Free/Pro when: â
â ââ < 50K requests/day â
â ââ < 20 team members â
â ââ No compliance requirements â
â ââ Community support is acceptable â
â ââ Standard SLA is fine â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Framework-Specific Guidance
Remix (Special Case)
Remix is uniquely positioned to work well on BOTH platforms:
| Remix Adapter | Platform | Best For |
|---|---|---|
@remix-run/cloudflare |
Cloudflare Workers | Edge-first, cost-sensitive |
@remix-run/cloudflare-pages |
Cloudflare Pages | Static + edge functions |
@remix-run/vercel |
Vercel | Node.js features, dynamic SEO |
@remix-run/node |
Vercel/Railway | Full Node.js, DB access |
Remix + Cloudflare Decision:
If your Remix app:
ââ Uses only edge-compatible packages â Cloudflare â
ââ Needs KV/D1/R2 storage â Cloudflare â
(native support)
ââ Is cost-sensitive â Cloudflare â
(cheaper)
ââ Needs Prisma/native modules â Vercel (Node.js required)
ââ Has critical dynamic SEO â Vercel (SSR power)
ââ Needs WebSockets â Vercel (Durable Objects are complex)
Remix Setup for Cloudflare:
npx create-remix@latest --template cloudflare-pages
Remix Setup for Vercel:
npx create-remix@latest --template vercel
Backend Services (Cron Jobs, Workers)
Not all deployments are frontends. For backend services:
| Use Case | Recommended Platform | Alternative |
|---|---|---|
| Cron < 1/hour | Vercel Cron, GitHub Actions | – |
| Cron >= 1/hour | Railway, Render, Fly.io | Cloudflare Workers (paid) |
| Long-running jobs | Railway, Render | Modal, Inngest |
| Event processing | Cloudflare Queues | AWS SQS, Inngest |
| Background tasks | Inngest, Trigger.dev | Railway |
Backend Platform Comparison
| Platform | Pricing | Best For | Limitations |
|---|---|---|---|
| Railway | $5/month + usage | Full-stack, databases, cron | Can get expensive at scale |
| Render | Free tier + $7/month | Background workers, cron | Cold starts on free |
| Fly.io | Free tier + usage | Global edge, persistent | Learning curve |
| Inngest | Free tier + usage | Event-driven workflows | Requires adapter |
| Cloudflare Workers | $5/month | Edge compute, queues | No Node.js |
Hybrid Architecture
For complex apps, consider hybrid:
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â HYBRID ARCHITECTURE â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â Frontend (Cloudflare Pages) â
â ââ Static assets (CSS, JS, images) â
â ââ Edge-rendered pages (fast TTFB) â
â ââ Cloudflare KV for session cache â
â â
â â¼ API calls â
â â
â API (Vercel Functions) â
â ââ Node.js runtime for DB access â
â ââ Prisma/Drizzle with PostgreSQL â
â ââ Server-side auth (Prisma sessions) â
â â
â â¼ Background jobs â
â â
â Workers (Railway/Render) â
â ââ Cron jobs (hourly+) â
â ââ Email sending â
â ââ Heavy processing â
â â
â Result: Edge speed + Node.js power + Background processing â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Cost Optimization Tips
- Start on Cloudflare if you’re unsure – it’s free and generous
- Migrate to Vercel only when you hit Node.js requirements
- Use Vercel Edge when possible (cheaper than Serverless)
- Cache aggressively on Cloudflare (KV, R2, Workers KV)
- Use ISR with long revalidation periods when real-time isn’t critical
- Monitor usage – set billing alerts on both platforms
- Consider Railway for backend services (cheaper than Vercel for workers)