This is a static React application that can be deployed to Cloudflare Workers or any static hosting platform. Users bring their own Replicate API keys via the web interface.
- Node.js installed
- A Cloudflare account (free tier works!)
-
Install dependencies:
npm install
-
Login to Cloudflare:
npx wrangler login
This opens a browser to authenticate.
-
Deploy:
npm run deploy
Your site will be live at: https://image-editing-arena.<your-subdomain>.workers.dev
To update your deployed site:
npm run deployCheck your deployment in the Cloudflare dashboard:
- Go to dash.cloudflare.com
- Navigate to Workers & Pages
- Find your
image-editing-arenadeployment
Cloudflare Pages offers more features like preview deployments and git integration.
npm run cf:deploy- Push your code to GitHub
- Go to Cloudflare Pages
- Connect your repository
- Set build settings:
- Build command:
npm run build - Build output directory:
dist
- Build command:
- Deploy!
npm install -g vercel
npm run build
vercel --prodnpm install -g netlify-cli
npm run build
netlify deploy --prod --dir=dist-
Build the site:
npm run build
-
Deploy the
distfolder to yourgh-pagesbranch
To use a custom domain with Cloudflare Workers:
- Add your domain to Cloudflare
- Go to Workers & Pages in the dashboard
- Select your worker
- Go to Settings > Triggers > Custom Domains
- Add your domain
- Worker + static assets - The worker proxies Replicate API calls, static assets are served from dist/
- API keys are client-side - Users enter their own Replicate API keys
- No CORS issues - The worker makes server-side requests to Replicate, avoiding browser CORS restrictions
- No secrets needed - No server-side configuration required
Clear cache and rebuild:
rm -rf node_modules dist
npm install
npm run buildMake sure you're logged in:
npx wrangler whoamiIf not logged in:
npx wrangler loginThe app uses a Cloudflare Worker to proxy requests to the Replicate API. This avoids CORS issues since the worker makes server-side requests. The proxy endpoint is /api/replicate/* which forwards to https://api.replicate.com/*.
- Cloudflare Workers Free Tier: 100,000 requests/day
- Cloudflare Pages Free Tier: Unlimited requests, 500 builds/month
- User API costs: Users pay for their own Replicate API usage with their keys