AI Form Builder Tutorial is now Live!
Let’s build an AI Form Generator, here’s how it works:

Form Generation:
A simple form to take in a prompt from user. I use server action on submit and send a request to OpenAI API. The response is than parsed and validated using zod.
Storing the Form Details
For this part, I host the database on Supabase and use drizzle for queries/mutations/transactions.
Authentication
Only authenticated users can generate forms and implemented it using next-auth(auth.js). As for the login method, I use Google Provider and Adapter for Drizzle to sync the data to my users table in database
Admin Panel
This is where users can see their forms and the responses of submissions. With the magic of nextjs layout, I created layout group for admin and pages.
Stripe Integration
I created 2 APIs: checkout session & create portal and 1 webhook. And also had to integrate stripe packages on the client side to be able to integrate with these apis, so users can purchase the plan and change their subscription.
Analytics
I integrated Plausible and used next-plausible package to be able to track page views and implemented one custom event in addition to other information provided by this open-source google analytics alternative.
Landing Page
Wrote a brief explanation of what the app does for the hero section and added call-to-action to form generation. Also took a few screenshot of the demo and added that as steps in the features section.
Deployment
Deployed the app using vercel. Imported my repository from Github and added environment variables in the settings. Once I had deployment url had to update few configs like the stripe webhook to point to that instance, google auth callback and plausible.
Hope you enjoyed the overview, and here the link for the tutorial:
