![]() | ||||||||||
| Printed from wandabuilds.ai/t/StHp
| ||||||||||
| Tutorials · Intermediate How to add login and forms to your website with AILearn to add login and forms to your website with AI, no coding: ask Claude Code, store the data in Supabase and protect your private pages.
Almost every real website needs two things: a form (so people can write to you or sign up) and sometimes a login (so only certain people reach certain pages). They sound hard, but with AI you add them by describing them in words, no fighting with code. In this guide you’ll add login and forms to a site you’re already building, using Claude Code to write the code and Supabase to store the data and handle accounts. Tap each step to open it.
1 Create your Supabase projectSupabase is a free database that also brings the login system almost done. If you’ve never used it, follow the tutorial How to create a database with Supabase; it takes 5 minutes.
2 Add a contact formOpen your project in VS Code, open Claude Code (✳) and ask for the form with a clear prompt. The more specific, the better:
Claude Code will show you the files it will create or change. Skim them and approve. It doesn’t save anything yet: we connect that in the next step.
3 Store what people submitNow connect the form to Supabase so each message is stored in a table. Give Claude Code your data and the prompt:
Notice the last part: keys go in a When it’s done, open your table in Supabase (Table Editor → messages) and you’ll see rows appear each time someone submits the form. 4 Add the loginSupabase includes login (it’s called Auth), so you don’t have to invent anything about passwords: it stores them encrypted for you. Ask Claude Code:
In Supabase, go to Authentication → Providers and confirm Email is enabled (it is by default). With that, people can create their account and log in. 5 Protect your private pagesA login without protected pages isn’t worth much. Tell Claude Code which pages should be only for logged-in people:
That’s how you separate the public part (your normal page, the form) from the private part (a dashboard, the profile, whatever you want to hide).
Shortcut: ask for it all at onceIf you already have your Supabase project ready (Step 1), you can ask Claude Code for the full package in a single prompt and then review as you go:
I prefer going step by step (you understand what’s happening better), but if you’re in a hurry, this shortcut works. Test that it works
If all four work, you’ve got a site with real forms and login. If something goes wrong
And there it is: you went from a page that only displays to one that receives people and stores information. That jump is exactly what separates a pretty site from a site that works for you. Start with the form, the easiest part, and once you feel comfortable, add the login. You can build it too. Frequently asked questionsDo I need to know how to code to add a login?No. You describe what you want to Claude Code in plain words and it writes the code; you review and approve. This tutorial uses Supabase, which brings login almost done. Is it safe to store passwords this way?Yes, because you don't store them: Supabase handles passwords encrypted for you. Never store passwords in plain text or put them in your code. How much does it cost to have login and forms?Supabase's free plan covers up to 50,000 active users a month, plenty to start. You only pay for Claude Pro (from $20/mo) to use Claude Code. Can I get forms by email instead of storing them?Yes. Ask Claude Code to, instead of (or besides) saving to Supabase, email you the form content with a service like Resend. Here we store it in a table because it's the simplest to review. |
