Save orders with a Server Action

About 60 minutesYou need: Cursor with adjoas-kitchen running, the Supabase dashboard (Table Editor) in Chrome, and your notebook
This video is in the full courseGet the course to watch every video and read every lesson in full. GHS 399, paid once.Get the course · GHS 399
Video · 14:07
Goal

Make the Order form save real orders to the orders table through a Server Action that checks every field on the server, show clear success and error messages, and prove it all works, including when someone tries to cheat.

Why this matters

This is the "after" picture. In Lesson 6.3, the Place order button said "This form doesn't save orders yet." In about an hour, it will put a real row in a real database, and Adjoa's Kitchen will be a working ordering system.

Everything from the last two modules comes together here. The form in the dining room (Lesson 6.3). The eight-step journey (Lesson 6.2). The server check that nobody can switch off. The publishable key from .env.local (Lesson 7.5). The bouncer's rule that anyone may add an order but nobody may read them (Lesson 7.4).

Take your time with the checks at the end. Anyone can make a form that works when you fill it in properly. A professional makes one that still behaves when someone fills it in badly, or on purpose to cause trouble. You'll try both.

In the full lesson

  1. The idea in plain English
  2. Do it
  3. The prompt
  4. Check it worked
  5. Understand what AI wrote
  6. Quick check
  7. What you can do now
Stage 2 · Make it workYou’ve seen the why. The how is in the course.

The step-by-step, the prompt to copy, the video and the check-it-worked list, for every lesson in all 15 modules. GHS 399 ($40), paid once by mobile money or card, yours to keep.

Get the course · GHS 399See what’s inside
Already have the course? Open the full lesson