InstantForm is a dynamic form-building application that leverages AI to generate forms from user prompts, images, or documents. It features a drag-and-drop interface, real-time previews, advanced scoring, and AI-powered response analysis to streamline the entire form creation and data collection process.
- AI-Powered Form Generation: Automatically create forms from text descriptions, images, or documents (PDF, DOCX, TXT).
- Hybrid AI Model: Utilizes a cloud-based AI for full capabilities and can fall back to a local, in-browser AI for offline text-to-form generation.
- Drag-and-Drop Editor: Easily customize forms by reordering fields, adding new ones, and configuring scoring logic.
- Advanced Scoring & Form Types:
- Knowledge Quizzes: Create traditional quizzes with correct/incorrect answers and point-based scoring.
- Outcome Assessments: Build personality tests (like Enneagram), assessments, or quizzes that categorize users into predefined outcomes based on their answers.
- Normal Forms: Standard data collection forms without any scoring logic.
- AI-Powered Response Analysis: Generate a detailed Markdown summary and analysis of collected responses with a single click.
- Data Visualization: View response data through clear, informative charts, including outcome distributions and response breakdowns per question.
The AI in InstantForm is guided by a carefully crafted system prompt that instructs it to act as an "expert form generator." This prompt ensures the AI's output is reliable and structured correctly.
- Strict JSON Output: The AI is required to return only a valid JSON object, which the application can directly parse and render.
- Defined Structure: The prompt specifies the exact JSON structure, including a
title
,description
, and afields
array, along with all allowed field types. - Intelligent Scoring Rules: For outcome-based assessments, the prompt provides specific instructions for creating scoring rules, ensuring a logical and effective point distribution.
This detailed system prompt is the key to the AI's accuracy, ensuring that all generated forms are well-structured and compatible with the application's data model.
- Node.js (v14 or higher)
- npm
- Clone the repository:
git clone https://github.com/your-username/instantform.git
- Navigate to the project directory:
cd instantform
- Install the dependencies:
npm install
- Set up your environment variables:
- Copy the
.env.example
file to a new.env
file. - Add your
GEMINI_API_KEY
to the.env
file for the backend server.
- Copy the
- Run the backend server:
npm start
- Run the frontend development server:
npm run dev
- Secrets: Never commit secrets to this repository. The
.gitignore
file is configured to ignore.env
files. - Environment Configuration: Backend-only secrets (e.g.,
GEMINI_API_KEY
) should be managed on the server. Avoid placing secrets in Vite client-side environment files. - Accidental Commits: If a secret is accidentally committed, revoke the key immediately, remove the file from the Git index, and rewrite the repository history to purge the exposed data.