💾
CC10045 min

Day 27

Saving Form Data

Let's make that contact form actually work!

Today's Lesson

Now the contact form saves submissions to a real database. When someone fills out your form, their message will be stored in Supabase, waiting for you to read it.

Today's Tasks

  1. 1Connect your contact form to Supabase
  2. 2Save submissions to the database
  3. 3Test it live
  4. 4View the data in Supabase

Prompt to Use

Connect my contact form to Supabase so submissions are saved to the 'contacts' table. Walk me through:
1. Installing the Supabase client
2. Updating the form to save data
3. Testing it on my live site
4. Viewing the submission in Supabase

Expected Outcome

Contact form saves to database.

New Terms

  • Supabase Client
  • Insert
  • API Route

Pro Tip

Check Supabase's Table Editor after submitting. Seeing your data appear is incredibly satisfying.

Coming Tomorrow

We'll display the submissions (admin view).

P.S. Your website now has a backend. You're a full-stack developer!