Courses

Build a guestbook

Add a guestbook to your website that stores entries in a database, screens them for spam, and tells you when someone signs it.

Build a guestbook

A guestbook is a small feature with most of what a real app needs: a form, somewhere to keep what people write, a way to keep out spam, and a way to hear about new entries.

You can add it to the site you built in Publish a website, to any other app you have on Cloudflare, or to a new Worker made just for it. You’ll build the form and list first, then store entries in a D1 database, screen each one with Clef, a decision model on Workers AI, and get a notification whenever someone signs it.

Exercises

  1. 00.Interview: Tell your agent where your guestbook will live, how it should feel, and how it should handle spam and new entries.
  2. 01.Build the UI: Build your guestbook's form and list, with a small API that keeps entries in memory for now.
  3. 02.Connect a database: Save your guestbook's entries in a database so they last and every visitor sees the same ones.
  4. 03.Moderate messages: Screen new entries with an AI decision model and hold back the ones that look like spam.
  5. 04.Get notified: Get an email or a chat message whenever someone signs your guestbook.