Save orders with a Server Action
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
- The idea in plain English
- Do it
- The prompt
- Check it worked
- Understand what AI wrote
- Quick check
- What you can do now
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.