First, let me just say, āI get it.ā This is the least romantic way to plan anything, much less date night. This is more an experiment to demonstrate how easy it is to ship something now and the nearest problem I had was a Saturday without any concrete date night plans.
Alright, back to the blog.
My wife and I have an eight month old boy at home. We both work full-time. We both travel for work or social obligations frequently. We donāt see each other that often.
One night each week, during the middle of the week, we have a babysitter come visit so that we can get out of the house for dinner. We also have weekends after our son goes down but that means we are typically anchored to the range of our baby monitor unless we plan ahead.
And we are almost always too tired to plan ahead. Instead, we throw out suggestions at the last minute and eventually default to ordering out pizza, splitting a bottle of wine, and streaming something. Lately Hacks.
So, during one of our sonās naps, I decided to try to build something to solve that.
šÆ I have a few goals for this project:
šŗļø This walkthrough covers how to:
ā²ļøTime to complete: ~100 minutes
š I work there. I work at Cloudflare. Several of my posts on this blog that discuss Cloudflare focus on building things with Cloudflare Workers. Iām a Workers customer and pay my invoice to use it.
Want to jump straight to the code? Repo open here.
Plan-a-date.com builds date night itineraries based on the merged, blinded, preferences of two partners. The first partner adds their choices and then receives a unique URL to share with the second partner. When the second partner inputs their preferences, an AI considers both sets of ideas and creates a joint itinerary. It is a compromise machine.
![Plan a Date][./media/plan-a-date.png]
The tool (based on the system prompt send to the AI) also takes into account some important things like if one partner says āNo Thanksā about physical intimacy then it will never recommend any physical activity.
![Plan a Date Architecture][./media/plan-a-date-architecture.png]
And the actual domain, plan-a-date.com, was purchased on Cloudflareās domain registrar. The domain was available which is another data point about how silly this is.
First, Cloudflare Pages. Cloudflare Pages is a āJAMstack platform for frontend developers to collaborate and deploy websites.ā That just means it is a clean and easy place to deploy a simple web app like this.
The front-end consists of a single page Next.js application. The form handles collecting inputs, displaying responses, and interacting with the back-end. The page does feature some lightweight logic of its own. For example, if you select No Screens
then the Genre
options become grayed out. That runs entirely inside the app in your browser.
Cloudflare Pages integrates directly with the GitHub repository where the code lives. I can configure the build template, in this case Next.js, and Pages will build and deploy my application any time I make a change. I could set up a staging pipeline in Pages, as well, and protect it behind a simple authentication layer but this is not exactly a mission critical application and I donāt mind breaking it.
![Pages][./media/plan-a-date-pages-app.png]
Behind the Pages application is a single Cloudflare Worker that has multiple jobs. The UI only ever interacts with this Worker which, in turn, communicates with the storage layer (Workers KV) and the AI LLM (Llama running on AI Gateway). The Worker handles finding your partnerās preferences if already submitted and then matching them up with yours. The Worker also generates the unique ID.
![KV Pairs][./media/kv-pairs.png]
Unlike other recent Workers AI projects, we need a storage layer since this is not a single user inputting their preferences and getting a response. We need those preferences to sit somewhere until the userās partner adds theirs. Workers KV (short for Key Value) provides an ideal set up for this. I can bind my Worker to a KV namespace that I create so that the Worker knows to access it.
Finally, Cloudflare Workers AI. Specifically Cloudflare AI Gateway + Workers AI. Cloudflare Workers AI is an inference platform where you can run AI models (like Metaās popular Llama) on Cloudflare hardware. That makes it very fast, especially for applications running entirely on Cloudflare like this one. My Worker can send the prompts and get the response very, very quickly.
![AI Gateway][./media/ai-gateway.png]
I layered on Cloudflare AI Gateway, as well. AI Gateway logs requests/responses, gives me a feedback mechanism for them, and adds additional features like rate limiting and caching.
And the best part is that I donāt have to worry about anything else. The DNS record was created with a single click. The site is protected from DDoS attacks. The site is safer thanks to the default Cloudflare WAF rules. The site is lightning fast thanks to Cloudflareās CDN. I literally had to do exactly zero work for any of that.
I cannot overstate how easy that new LLM tools make it to build an application - as long as you have the rough idea for what you want, a general architecture in mind, and the ability to debug. I leaned heavily on Anthropicās Claude for this. To the point that writing code manually almost feels as tedious as washing clothes by hand. Like, sure, if you want to spend your time doing that you can and you can even do a better job, but why not just let the machines do it? Theyāll do it faster and make fewer mistakes.
We arenāt (yet) at a place where you could build a full-stack application by just talking it into existence. I still needed to know that this would need to use KV, for example, and I needed to debug some issues with the Next.js application on Pages. These AI tools also really drop the ball when it comes to remembering the names of environment variables, which can cause all sorts of headaches for API tokens or storage retrieval.
Weāre also a ways away from using these kinds of tools as an individual to build a single, complex, SaaS application without a software development background. This app is very simple. That said, it feels like absolute magic to just provide the file to Claude, bark at it with āhey make this dark mode too,ā and then the file is updated and suddenly you have dark mode in your app. Magic.
Again, this is silly. Still can be fun, though. People seem tickled by it and thatās enough for me.
One interesting thing, though, is that Cloudflareās AI Gateway logs the prompts (and responses) sent to the LLM. Since nothing here can be used to identify an individual (there isnāt even free text input), I feel comfortable analyzing that data in aggregate. Iām curious about some of the overlap between partner preferences. Iāll let this run for a bit and then investigate.