Case study 07 of 07 · Real-time video · Serverless · Privacy
Singles
A live online speed-dating platform that runs real, moderated events in the browser. One serverless object runs each event and the server decides who can speak.
In 20 seconds
- What it is
- Paid singles events for my events brand: up to 12 people in one live video room, 2 likes each, mutual matches revealed by the moderator, then 3 minutes to say hi on WhatsApp before contact numbers are erased automatically.
- My part
- Product owner. I wrote the requirements, made the architecture and cost decisions, ran real events to test every release and run the accounts. I directed Claude Code and GitHub Copilot to build it.
- Built with
- Claude Code (with sub-agents for research, security review and front-end work) and GitHub Copilot, wrangler, the Node.js test runner, headless Chromium with a fake camera and microphone, ffmpeg
- AI in the product
- None in the platform. The AI is in how it was built: Claude Code with sub-agents, and GitHub Copilot.
- Status
- Live in production. Live on Cloudflare. Planned next: an intro round and quick reactions.
Straight answer: The platform itself has no AI features. The AI is in how I built it. The app takes no payments: tickets are sold on Eventbrite and on my website.
- 122 automated tests in 17 files
- 12 players in one live video room
- 3 min to say hi, then every phone number is erased automatically
- 7 hosting options researched before choosing Cloudflare
Overview
Singles runs paid online singles events for my events brand, Social Field (socialfield.uk). Guests with a ticket enter one live video room of up to 12 people, give 2 likes each, and when the moderator presses Reveal, mutual matches are announced. Matched people confirm each other and get 3 minutes to say hi on WhatsApp. The system then erases the contact numbers automatically.
Who uses it. The host (the organiser), moderators who run the call, and paying guests, mostly on phones. The host works on a PC.
What makes it different
- It runs on Cloudflare’s free tier. The whole event lives in one serverless object, with no server and no database to maintain.
- The server decides who can speak and who receives which video stream, so moderator controls can’t be bypassed from a guest’s browser.
- Ticket checks combine Eventbrite and my website’s sales automatically.
- Privacy is built in. Numbers are shared only between confirmed pairs and erased afterwards, and there is a plain-words privacy page.
- A full Mafia party game runs inside the video room.
Screens
How it works
How an event runs
- Client
- Service
- External service
Read this diagram as a list
The boxes
- Browsers: phone or PC, vanilla JavaScript
- Cloudflare Worker: static files, WebSocket router
- Zoho Mail: posts website ticket sales
- Event Durable Object: the whole event, SQLite, alarms
- Realtime SFU: WebRTC video, permissions set by the server
- Eventbrite API: ticket checks
- Cloudflare analytics: real video usage
The connections
- Browsers ⇄ Realtime SFU (video media)
- Browsers → Cloudflare Worker (WebSocket)
- Cloudflare Worker → Event Durable Object
- Zoho Mail → Cloudflare Worker (secured webhook)
- Event Durable Object → Realtime SFU (who may speak)
- Event Durable Object → Eventbrite API
- Event Durable Object → Cloudflare analytics
Runs without a person
- Speaking turns end on their own and the next person’s minute starts automatically.
- The 3-minute say-hi countdown, then automatic erasure of every phone number.
- Guests waiting for a ticket are admitted automatically when the sale arrives.
- Lobby dates appear from ticket sales and are deleted an hour after they start.
- The video room is checked against the event every few seconds, and wrong permissions are corrected.
- Real video usage is read from Cloudflare, with warnings to moderators at 900 GB and 960 GB.
- The Mafia game detects the winner automatically.
Needs a person
- The moderator runs the call: admits guests, mutes one or all, lets guests speak, kicks, and presses Reveal.
- The host works from a PC: resets the event and sets the moderator code.
- Guests choose their likes and confirm their matches.
Stack
AI techniques
- Agentic development workflowClaude Code sub-agents and Copilot
Languages
- JavaScriptabout 13,500 lines including tests
- HTML and CSS
- Zoho Delugeone small script
Backend and APIs
- Cloudflare Workersno runtime dependencies
- Durable ObjectSQLite-backed, WebSocket hibernation and alarms
- WebSockets
Frontend
- Vanilla JavaScript (no framework)no build step
- WebRTC videocustom client and server module
- Web Audiosounds, iPhone-safe
- Mobile-first layoutchecked from 320 px to 1920 px
Audio and media
- Cloudflare Realtime SFUWebRTC video
- ffmpeg
- FL Studiofive of the twelve sounds are my own
Data and storage
- Durable Object SQLitethe whole event
Payments and integrations
- Eventbrite APIticket checks
- Cloudflare GraphQL analyticsreal video usage
- Zoho Mailfilter and function posting website sales
- WhatsApp click-to-chat links
Cloud and infrastructure
- Cloudflare Workers and Realtime SFUfree tier
Testing and tooling
- Node.js test runner122 tests in 17 files
- Headless Chromiumfake camera and microphone, real WebRTC
- wrangler
- Claude Code
- GitHub Copilot
- VS Code
AI and machine learning
The platform has no AI features. The AI is in how it was engineered.
Techniques actually used
- I directed Claude Code, including specialised sub-agents for research, security review and front-end work, and GitHub Copilot to implement, test, debug and deploy the system. I reviewed, tested and decided every release.
- AI-assisted deep research on hosting options.
- AI was used to draft a script for an 8-scene promotional video.
Not in this project
- Any AI feature in the platform itself
Features
- Tickets: Eventbrite, website sales and a test list, with a waiting room (admit and decline), a fix-your-email flow and one ticket per person.
- Lobby: each date has 6 spots for men and 6 for women, with public first names.
- Live video room for up to 12 players, with the active speaker’s camera coming forward, a full-screen view and a stable camera order after reconnects.
- Likes, matching and reveal, with choices when there are several matches, a 3-minute countdown and a WhatsApp contact exchange.
- Moderator tools: admit, mute one or all, raised hands, let any number of guests speak, turns that go round with an automatic next speaker, kick, one-tap reveal, and a live panel with likes, matches, ticket status and video usage.
- Host tools: reset the event and set the moderator code.
- Mafia game: five characters, night phases where sleeping players are cut off by the server, votes, eliminations with last words, a public reveal of eliminated characters and automatic win detection.
- Sound: 12 real sound recordings (five I made myself in FL Studio), night music and iPhone-safe audio.
My role
- I defined the product, its rules and its privacy approach.
- I chose the architecture. After researching seven hosting options I moved the project from a self-hosted Node.js and LiveKit plan to Cloudflare Workers, a Durable Object and the Realtime SFU, based on free allowance and projected cost.
- I decided the business rules: paid, non-refundable events, a 6 + 6 lobby per date, usage warnings with no automatic stop, never using my website’s database, and automatic erasure of contact data.
- I set up and run the accounts and integrations: Cloudflare, Eventbrite, and the Zoho filters and function that feed website sales into the app.
- I directed the AI assistants to build it, tested every release, ran events with real people, and turned live problems into fixes.
- I made the sounds for the reveal, likes, eliminations, the door alert and the night music.
Engineering challenges
Intermittent video resets
Video kept resetting for some guests.
How it was solvedHide
I traced it to an idle receiving session that Cloudflare closes after a couple of minutes. The fix renews only the receiving side, so nobody’s video restarts.
The active speaker never enlarged
The app relied on audio-level data that never arrived.
How it was solvedHide
I proved that Cloudflare’s service strips the audio-level data, and replaced it with a measurement made in the browser from received audio, tested with real WebRTC.
Server-enforced muting, turns and last words
Moderator controls must not be bypassable from a guest’s browser.
How it was solvedHide
Tested by putting each old bug back and watching the tests fail.
A crossed microphone on every camera
A CSS rule drew a crossed microphone on every camera.
How it was solvedHide
It led to tests that check what is actually drawn on screen.
Fitting a real-time system inside free-tier limits
A live event needs state, timers and video on a free plan.
How it was solvedHide
One object, one alarm planner, and static files served free.
Reconciling the usage panel with Cloudflare
My usage panel and Cloudflare’s dashboard disagreed.
How it was solvedHide
The difference was month versus last 24 hours. The panel now matches the dashboard.
An early security review
The first version had takeover risks.
How it was solvedHide
I fixed them with per-person secret keys, rate limits and input checks, plus a test that sends broken data to every server event.
iPhone audio and camera order
iPhones handle audio differently, and cameras shuffled after reconnects.
How it was solvedHide
Fixed iPhone audio handling and a stable camera order after reconnects.
Status
Live and working on Cloudflare (Workers plus the Realtime SFU). Every release is checked file by file against the live site after deploy.
Complete
- Tickets from Eventbrite, website sales and a test list, with a waiting room.
- Lobby, live video room, likes, matching, reveal, say-hi with automatic erasure.
- Moderator and host tools, the Mafia game, usage monitoring, a privacy page and sounds.
Not built, and not claimed
- An intro round and quick reactions (planned next).
- Payments. The app takes none.
Evidence
- 122 automated tests in 17 files Plus real-WebRTC tests of sending, receiving and speaking detection. About 13,500 lines including tests.
- 12 players in one live video room Lobby dates have 6 spots for men and 6 for women.
- 3 min to say hi, then every phone number is erased automatically
- 7 hosting options researched before choosing Cloudflare Moved from a self-hosted Node.js and LiveKit plan on free allowance and projected cost.
- 900 and 960 GB usage warnings to moderators Out of Cloudflare's free 1,000 GB, read from Cloudflare, with no automatic stop.
- 392 lines in the README Covers features, settings, tests and credits.
Code worth reading
src/event.jsThe event logic.src/video.js and public/sfu.jsThe custom video server and client.lib/matching.jsMatch logic.lib/tickets.jsTicket sources.Usage monitorReconciled with Cloudflare’s dashboard.Zoho automation scriptFeeds website sales into the app.
What I can't verify, so I don't claim
- Attendance, ticket-sales or revenue numbers. None are published here.
Public links
verified checked against the code, tests, logs or the live system. reported from my own notes or hands-on use. unverified could not be checked, so it is not claimed.
