Turn natural-language prompts into customizable, shareable forms with AI.
FormCraft AI is a full-stack SaaS application that uses Google Gemini to help users create forms, customize their appearance, publish public links, collect responses, and review submission analytics. It also includes authentication, subscription management, and automated quality checks.
- Overview
- Screenshots
- Features
- How It Works
- Technology Stack
- Testing and Code Quality
- Getting Started
- Environment Variables
- Database Setup
- Available Commands
- Project Structure
- Payment Flow
- Security Considerations
- Roadmap
- Contributing
- Author
Creating forms manually can be repetitive. FormCraft AI lets users describe what they need in natural language and uses Google Gemini to generate a structured form that they can review and customize.
The application brings the entire form creation workflow together in one place:
- Generate form fields from a natural-language prompt.
- Edit fields and customize the form's appearance.
- Publish forms through shareable public URLs.
- Collect submissions and review responses.
- Export responses to Excel and view analytics.
- Manage Free and Pro access through subscription functionality.
The project also includes unit and component tests, browser-based end-to-end tests, linting, production build verification, and a GitHub Actions CI workflow.
| Live application | https://formcraft-ai-mocha.vercel.app |
| GitHub repository | https://github.com/Vishwak-Tech/ai-formbuilder |
Landing Page
|
Dashboard
|
AI Form Generator
|
Public Form
|
Responses Dashboard
|
Analytics
|
Upgrade Page
|
|
- Generate form definitions from natural-language prompts using Google Gemini.
- Convert generated structured content into editable form fields.
- Handle loading states and generation failures.
- Preview forms while editing.
- Render fields dynamically from the form definition.
- Edit field labels and remove fields.
- Customize themes, backgrounds, and form branding.
- Publish forms with shareable public URLs.
- Provide responsive public form pages.
- Validate responses before submission.
- Collect and manage form submissions.
- Review submissions from the dashboard.
- Export responses to Excel.
- View form response analytics.
- Sign up and sign in with Clerk.
- Protect dashboard routes.
- Manage authenticated user sessions.
- Integrate Razorpay for payments.
- Verify payment signatures using HMAC.
- Support monthly Pro subscriptions.
- Track subscription status and expiry.
- Gate features based on Free and Pro access.
- Neo-brutalism-inspired visual design.
- Responsive dashboard layouts.
- Mobile-friendly public forms.
- Interactive form creation and customization.
- Describe: The user enters a prompt explaining the form they need.
- Generate: Google Gemini produces a structured form definition.
- Validate: The generated content is parsed and validated.
- Customize: The user edits fields and adjusts the form's appearance.
- Publish: The form is made available through a public URL.
- Collect: Respondents submit their answers.
- Review: The owner reviews submissions, exports responses, and checks analytics.
Natural-language prompt
↓
Google Gemini
↓
Parse and validate generated content
↓
Save form
↓
Edit and customize
↓
Publish public URL
↓
Collect form responses
↓
Review submissions and analytics
| Area | Technology |
|---|---|
| Framework | Next.js 16 |
| UI library | React 19 |
| Styling | Tailwind CSS 4 |
| Authentication | Clerk |
| AI integration | Google Gemini |
| Database | Neon PostgreSQL |
| ORM | Drizzle ORM |
| Payments | Razorpay |
| Unit and component tests | Vitest, React Testing Library |
| End-to-end tests | Playwright |
| Linting | ESLint |
| CI | GitHub Actions |
| Deployment | Vercel |
FormCraft AI includes automated tests and CI checks to help detect regressions during development.
| Check | Tool | Reported result |
|---|---|---|
| Unit and component tests | Vitest | ✅ 38 tests passed |
| Component testing | React Testing Library | ✅ Included in Vitest suite |
| Browser end-to-end tests | Playwright | ✅ 8 tests passed |
| Linting | ESLint | ✅ Passed |
| Production build | Next.js | ✅ Passed |
| Continuous integration | GitHub Actions | ✅ Successful workflow run |
Note
These are the results documented for the project. Rerun the commands and inspect the latest workflow before relying on them as current status.
- Form creation dialog and user interactions.
- AI form generation loading and failure states.
- Form generation logic with mocked dependencies.
- API route behavior and payment verification.
- Subscription logic with mocked database queries.
- Homepage rendering and major sections.
- Access behavior for unauthenticated and authenticated dashboard users.
- Create Form dialog interactions in the browser.
npx vitest runRun Vitest in watch mode during development:
npx vitestInstall the required Playwright browser if needed:
npx playwright install chromiumRun the Chromium test suite with one worker:
npx playwright test --project=chromium --workers=1Important
E2E prerequisite: Authenticated scenarios require a valid local Playwright authentication state. Keep authentication-state files and credentials out of version control.
npx eslint .
npm run buildThe GitHub Actions workflow runs on pushes to main and on pull requests targeting main. The documented workflow:
- Checks out the repository.
- Sets up Node.js.
- Installs dependencies using
npm ci. - Runs ESLint.
- Runs the Vitest suite.
- Builds the production application.
Workflow configuration: .github/workflows/ci.yml
Warning
Current testing scope: The documented CI workflow does not run a separate live-database integration suite or the Playwright E2E suite. Database behavior in unit tests is mocked. Passing these checks does not establish that every production integration or payment scenario has been verified.
Follow these steps to run FormCraft AI locally.
- Node.js version compatible with the project
- npm
- A Neon PostgreSQL database
- A Clerk application
- Google Gemini API access
- A Razorpay account (only if you want to use payment functionality)
git clone https://github.com/Vishwak-Tech/ai-formbuilder.git
cd ai-formbuildernpm ciCreate a .env.local file in the project root and add the variables expected by the application. See Environment Variables.
After reviewing the schema changes and confirming that the connection points to your development database, run:
npm run db:pushnpm run devOpen http://localhost:3000 in your browser.
- Create an account or sign in.
- Open the dashboard.
- Select Create AI Form.
- Describe the form you want to generate.
- Review and customize the generated fields.
- Publish the form and share its public URL.
- Review submissions in the dashboard.
Example prompt:
Create a customer feedback form for a restaurant with a rating,
comments, and contact information.
The following variable names are documented by the current project. Confirm each name against the code before configuring a deployment.
NEXT_PUBLIC_DATABASE_URL_CONFIG=
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
NEXT_PUBLIC_GEMINI_API_KEY=
NEXT_PUBLIC_RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
NEXT_PUBLIC_APP_URL=http://localhost:3000- General: Never commit
.env.local, API secrets, database credentials, or real payment credentials. Variables prefixed withNEXT_PUBLIC_can be exposed to browser code when referenced by client-side modules. - Database: If
NEXT_PUBLIC_DATABASE_URL_CONFIGcontains a database connection string or credentials, rename it to a server-only variable and ensure it is only accessed by server-side code. - Gemini: If
NEXT_PUBLIC_GEMINI_API_KEYis used in browser code, the key may be exposed. Prefer making authenticated, validated requests through server-side code and keeping the key in a server-only environment variable. - Clerk: Keep
CLERK_SECRET_KEYon the server. The publishable key is intended for client-side configuration. - Razorpay: Keep
RAZORPAY_KEY_SECRETon the server. The key ID may be public, but payment verification must be performed on the server. - App URL: Set the production application URL to the actual deployed origin.
Note
The variable names above preserve the supplied project's configuration. Review the implementation before changing names, since the code must be updated to match.
The project uses Neon PostgreSQL with Drizzle ORM. To push the configured schema to your database:
npm run db:pushCaution
Use this command only after confirming the target database and reviewing the schema changes. Prefer a development database while setting up the project locally.
| Command | Purpose |
|---|---|
npm run dev |
Start the development server |
npm run build |
Create a production build |
npx eslint . |
Run ESLint |
npx vitest |
Run tests in watch mode |
npx vitest run |
Run tests once |
npx playwright install chromium |
Install the Chromium browser for Playwright |
npx playwright test --project=chromium --workers=1 |
Run the Chromium E2E suite |
npm run db:push |
Push the Drizzle schema to the configured database |
These commands reflect the supplied README. Check package.json and the current Playwright configuration if a command behaves differently in your checkout.
app/
├── api/
│ ├── create-order/
│ └── verify-payment/
├── dashboard/
│ ├── _components/
│ ├── analytics/
│ ├── responses/
│ └── upgrade/
├── aiform/
├── edit-form/
├── sign-in/
├── sign-up/
└── _components/
components/
└── ui/
configs/
├── index.js
└── schema.js
lib/
├── razorpay.js
└── subscription.js
e2e/
├── homepage.spec.js
├── dashboard.spec.js
└── create-form.spec.js
.github/
└── workflows/
└── ci.yml
vitest.config.js
playwright.config.js
This is a high-level view of the structure documented for the project. Individual files may vary as the repository evolves.
The documented Razorpay flow is:
User selects a Pro plan
↓
Create Razorpay order
↓
User completes payment
↓
Verify payment signature on the server
↓
Create or update subscription
↓
Enable Pro features
Important
Security requirement: Never treat a client-side payment success message as proof of payment. Verify the payment signature server-side and validate the order, amount, payment status, and association with the intended user before granting subscription access.
The project integrates authentication, AI APIs, database access, public forms, and payments. Before using it with real users, review the following areas:
| Area | Recommendation |
|---|---|
| Secrets | Keep database credentials, Clerk secret keys, Gemini keys, and Razorpay secrets server-side. |
| Authentication & authorization | Enforce ownership checks on form management, responses, analytics, and subscription operations. Hiding a UI element is not an authorization control. |
| Public form submissions | Validate submitted data on the server, enforce field and payload limits, and consider rate limiting and spam protection. |
| AI input and output | Treat prompts and generated content as untrusted. Validate the generated schema before saving or rendering it. |
| Payments | Verify signatures server-side and validate order identity, amount, status, and user association before updating subscriptions. |
| Database changes | Use the intended environment and review schema changes before applying them. |
| Testing | Add integration tests for critical database and payment paths, and include E2E tests in CI when the required authentication setup is available. |
Note
These are recommended review areas, not claims that every item is already implemented or that a vulnerability has been confirmed.
- Improve analytics and response insights
- Add more AI form templates
- Improve dashboard usability
- Expand automated test coverage
- Authentication-required public forms
- Team workspaces and collaboration
- Email notifications
- AI-powered response insights
- PDF export
- Custom domains
- Webhooks and API access
Contributions, bug reports, and suggestions are welcome.
-
Fork the repository.
-
Create a feature branch:
git checkout -b feature/my-feature
-
Make your changes and run the relevant checks:
npx eslint . npx vitest run npm run build -
Commit your changes:
git commit -m "feat: describe your change" -
Push your branch:
git push origin feature/my-feature
-
Open a pull request with a clear description of the change.
Vishwak Koleti
- GitHub: Vishwak-Tech
- LinkedIn: www.linkedin.com/in/vishwak-koleti-tech
If you find FormCraft AI useful:
- Star the repository.
- Fork the project.
- Report bugs or suggest improvements.
Built with Next.js, React, Tailwind CSS, Google Gemini, Clerk, Drizzle ORM, Neon PostgreSQL, Razorpay, Vitest, Playwright, and GitHub Actions.






