Cloudflare Experiments
Build at the edge. For real.
60+ deployable experiments across the Cloudflare platform - not Hello World demos.
Philosophy
Reference implementations, not toy examples
Most Cloudflare tutorials stop at Hello World. This repo shows what you can actually build - one focused experiment per product capability, with tests, docs, and a deploy button.
Edge-first
Every experiment runs on Cloudflare Workers at the edge - low latency, global reach, no servers to manage.
Single responsibility
One experiment, one capability. Copy a focused reference instead of untangling a monolith.
Independently deployable
Each folder is self-contained with its own wrangler.json, tests, and one-click Deploy button.
Under 60 seconds
Request paths are designed to complete quickly - ideal for learning, demos, and prototyping.
Workflow
From clone to deployed Worker in four steps
Every experiment follows the same Turborepo layout. Pick one, run it locally, deploy independently, then adapt the pattern.
Pick an experiment
Browse by category - AI, scraping, monitoring, storage - or search docs by binding name like d1 or r2.
Run locally
Clone the monorepo, npm install, and npm run dev -- --filter=<name>. Wrangler serves on port 8787.
Deploy to Workers
Use the Deploy button in each README or wrangler deploy. Configure bindings in the Cloudflare dashboard.
Adapt the pattern
Fork the code into your project. Each experiment is MIT licensed - use it as a starting point, not a dependency.
git clone https://github.com/shrinathsnayak/cloudflare-experiments.git
cd cloudflare-experiments
npm install
npm run dev -- --filter=ai-website-summary
curl "http://localhost:8787/summary?url=https://example.com"Popular
Featured experiments
A starting point if you are not sure where to begin - each links to full API docs and a Deploy button.
Platform
Cloudflare capabilities in practice
Every experiment maps to a specific product or binding. Use these as copy-paste references when wiring up your own Workers.
Workers AI & Gateway
Summarization, translation, embeddings, image generation, speech-to-text, and AI Gateway caching.
Browser Rendering
Headless Chrome at the edge for screenshots, PDFs, metrics, and JS-rendered content extraction.
HTMLRewriter
Parse and transform HTML without a browser - metadata, stats, social tags, and rewrites.
Edge networking
DNS lookup, propagation checks, uptime monitoring, CORS testing, TLS inspection, and geolocation.
D1, KV & Vectorize
Edge SQL, key-value storage, semantic search, mock APIs, and short links with cache layers.
R2 object storage
Private and public buckets, presigned uploads, and snapshot storage for change tracking.
Durable Objects
Strongly consistent state, WebSockets, alarms, and webhook capture sessions at the edge.
Cron & Queues
Scheduled handlers, background job processing, retries, and pipeline orchestration.
Bindings
Search docs by binding
Use the docs search bar with tags like ai, browser, d1, r2, or do to filter experiments by Cloudflare binding.
Structure
Consistent experiment layout
Every Worker under apps/experiments/ uses the same folder conventions - routes, lib, types, tests, and wrangler.json.
apps/experiments/<name>/Standalone Worker packagesrc/routes/Hono route handlerssrc/lib/Domain logictest/Vitest smoke + unit testswrangler.jsonBindings and config
Catalog
All experiments by category
Browse the full catalog - 60+ deployable Workers organized the same way as the documentation sidebar.
AI & Machine Learning
Workers AI, embeddings, RAG, image generation, and AI Gateway patterns.
12 experiments
Web Scraping & Parsing
Fetch, HTMLRewriter, metadata extraction, and structured page APIs.
8 experiments
Browser Rendering
Fully rendered DOM via Puppeteer at the edge.
5 experiments
Network & Monitoring
Reachability, DNS, TLS, latency, change tracking, and CORS debugging.
11 experiments
Edge Platform
Web Crypto, caching, WebSockets, auth helpers, and platform APIs.
8 experiments
Storage & Data
R2, D1, KV, Vectorize, and mock API patterns.
7 experiments
Stateful & Async
Durable Objects, Cron, Queues, Workflows, and Analytics Engine.
9 experiments
Documentation
Learn how the monorepo works
Guides for getting started, contributing new experiments, and understanding deployment patterns.
Get started
Jump in with the path that fits your goal.
Introduction
What this project is, how experiments are organized, and platform capabilities.
Quick Start
Install dependencies, run locally, and deploy an experiment in minutes.
Browse experiments
Explore 60+ Workers covering AI, scraping, monitoring, storage, and more.
Philosophy
Design principles behind edge-first, single-responsibility experiments.
Contributing
Add a new experiment, run tests, and open a pull request.
Cloudflare features
Reference guide to bindings and platform capabilities used across experiments.
Ready to build at the edge?
Pick an experiment, deploy it in minutes, and use the source as a reference for your next Cloudflare Worker. All experiments are MIT licensed.