red
A Reddit-style community platform that runs entirely on Cloudflare.
No separate app servers. No managed Postgres elsewhere. No S3 account on another cloud. The app, database, media, AI, search vectors, bot protection, and edge rate limits all live on Cloudflare’s network.
Built end-to-end with Cursor (AI pair-programming), with human steering on architecture and product direction — a practical example of shipping a full product without leaving Cloudflare’s platform.
Source + deploy instructions. Fork it and deploy your own instance on Cloudflare.
Why this exists
1. Cloudflare as the whole backend — Workers are versatile enough for a real social app: SSR UI, APIs, stateful coordination, SQL, object storage, embeddings, and abuse controls.
2. Modern AI-assisted engineering — most of the implementation was written by an agent in Cursor; the result is meant to be readable, deployable, and honest about that workflow.
Cloudflare stack
| Product | Role in red |
| --- | --- |
| Workers + OpenNext | Next.js app + custom edge entry (src/worker.ts) |
| D1 | Primary SQL database (users, posts, votes, DMs, …) |
| R2 | Media uploads |
| Durable Objects | Per-post vote aggregation (PostObject) |
| KV *(optional)* | Edge cache / challenge state (falls back to memory) |
| Vectorize + Workers AI | Post embeddings, recommendations, translation |
| Workers Rate Limiting | Cheap IP flood gates *before* Next/SSR |
| Turnstile | Human checks on auth and write paths |
| Workers Logs | Observability (observability in wrangler.jsonc) |
flowchart LR
Browser --> Worker["Worker / OpenNext"]
Worker --> D1[(D1)]
Worker --> R2[(R2)]
Worker --> DO["Durable Object\nPostObject"]
Worker --> KV[(KV)]
Worker --> AI["Workers AI"]
Worker --> VZ[Vectorize]
Worker --> TS[Turnstile]
Features
- Communities, posts, comments, votes, profiles
- Auth (Better Auth) with email/password + username
- Search and AI-backed recommendations
- Direct messages and notifications
- Media uploads (R2)
- Ads + post analytics
- Admin / moderation tools
- Achievements, karma, badges, tags
- Content translation via Workers AI
- Sealed Protobuf API tunnel (/i/api) with bot / PoW challenges
- Personal API keys
Quick start (local)
[... continued on GitHub]