Skip to content

An intelligent application that instantly generates web forms from natural language prompts, built for the Google Chrome AI Challenge

License

Notifications You must be signed in to change notification settings

Nicoding1996/InstantForm

Repository files navigation

InstantForm: AI-Powered Form Generation

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.

Key Features

  • 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.

How the AI Works

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 a fields 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.

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/instantform.git
  2. Navigate to the project directory:
    cd instantform
  3. Install the dependencies:
    npm install

Local Development

  1. 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.
  2. Run the backend server:
    npm start
  3. Run the frontend development server:
    npm run dev

Security

  • 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.

About

An intelligent application that instantly generates web forms from natural language prompts, built for the Google Chrome AI Challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published