Skip to content

khanak0509/autopilot-forms

Repository files navigation

🤖✨ AI Google Form Filler

Python Flutter FastAPI WebSocket Gemini

🚀 Real-time AI-powered Google Forms automation with Flutter web interface, WebSocket communication, and intelligent Gemini LLM integration.

🎬 Demo

📹 Watch Demo Video — See the AI form filler in action!


🌟 Features

  • 🧠 Smart AI Answers — Gemini 2.5 Flash generates contextual responses
  • 🔄 Real-time Updates — Live progress via WebSocket communication
  • Modern Web UI — Beautiful Flutter web interface
  • Instant Feedback — Approve, reject, or improve AI answers
  • 🎯 Auto-submission — One-click approval fills and submits forms
  • 🔐 Persistent Chrome — Maintains login sessions across runs

🏗️ Architecture

graph TB
    subgraph "Frontend"
        F[Flutter Web App<br/>Real-time UI]
    end
    
    subgraph "Backend"
        API[FastAPI Server<br/>WebSocket + REST]
        WS[WebSocket Manager<br/>Connection Handler]
        LLM[Gemini LLM<br/>Answer Generation]
        WORK[LangGraph Workflow<br/>State Management]
    end
    
    subgraph "Browser Automation"
        CHROME[Chrome Browser<br/>Playwright Control]
        FORM[Google Form<br/>Auto-fill & Submit]
    end
    
    F <==>|WebSocket| WS
    WS --> API
    API --> LLM
    API --> WORK
    API --> CHROME
    CHROME --> FORM
    
    style F fill:#02569B,stroke:#fff,stroke-width:2px,color:#fff
    style API fill:#009688,stroke:#fff,stroke-width:2px,color:#fff
    style LLM fill:#4285F4,stroke:#fff,stroke-width:2px,color:#fff
    style CHROME fill:#34A853,stroke:#fff,stroke-width:2px,color:#fff
Loading

🔄 Workflow

graph TD
    A[Start] --> B[Launch Chrome Browser]
    B --> C[Navigate to Google Form]
    C --> D[Parse Form Questions]
    D --> E[Generate AI Answers with Gemini]
    E --> F{User Review}
    F -->|Approve| G[Fill Form Fields]
    F -->|Reject| H[Regenerate with Feedback]
    H --> E
    G --> I[Auto-Submit Form]
    I --> J[Verify Submission]
    J --> K[Complete]

    style E fill:#4285F4,stroke:#fff,stroke-width:2px,color:#fff
    style F fill:#EA4335,stroke:#fff,stroke-width:2px,color:#fff
    style G fill:#34A853,stroke:#fff,stroke-width:2px,color:#fff
    style I fill:#FBBC04,stroke:#fff,stroke-width:2px,color:#333
Loading

🚀 Quick Start

📦 Installation

# Clone repository
git clone <your-repo-url>
cd google-form

# Install Python dependencies
pip install fastapi uvicorn playwright langchain-google-genai langgraph python-dotenv pydantic websockets

# Install Playwright browser
playwright install chromium

# Setup Flutter (for UI)
cd google_form
flutter pub get

⚙️ Configuration

Create .env file:

GEMINI_API_KEY=your_gemini_api_key_here

🎬 Run Application

# 1. Start FastAPI server
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000

# 2. Start Flutter web (new terminal)
cd google_form
flutter run -d web-server --web-port 3000

🌐 Access: Open http://localhost:3000 in your browser


� Usage

  1. 🎯 Start Process — Click "Start AI Form Filling" button
  2. 👀 Watch Progress — Real-time status updates as Chrome opens and form loads
  3. 🧠 AI Generation — Gemini analyzes questions and generates smart answers
  4. ✅ Review & Approve — Check answers, provide feedback if needed
  5. 🚀 Auto-submit — Single approval fills and submits the entire form
  6. 🎉 Done! — Confirmation of successful submission

🛠️ Tech Stack

Layer Technology Purpose
Frontend Flutter Web Modern reactive UI
Backend FastAPI + WebSocket Real-time API server
AI Google Gemini 2.5 Smart answer generation
Workflow LangGraph State management
Automation Playwright Browser control
Validation Pydantic Type safety

📝 Supported Form Fields

✅ Text inputs • ✅ Email fields • ✅ Textareas • ✅ Radio buttons • ✅ Checkboxes • ✅ Dropdowns


📁 Project Structure

google-form/
├── main.py                 # FastAPI WebSocket server
├── fill.py                 # LangGraph workflow logic  
├── form_utils.py           # Reusable form automation
├── ws_manager.py           # WebSocket connection manager
├── initialize_llm.py       # Gemini LLM setup
├── prompt.py               # AI prompts & user data
└── google_form/            # Flutter web app
    └── lib/                # Flat file structure
        ├── main.dart       # Flutter entry point
        ├── workflow_provider.dart
        ├── websocket_service.dart
        ├── form_models.dart
        └── *.dart          # UI components

🎨 Customization

📝 User Details: Edit personal information in prompt.py

🔗 Form URL: Update target form URL in main.py

🎨 UI Styling: Modify Flutter components in google_form/lib/

🧠 AI Prompts: Enhance LLM instructions in prompt.py and fill.py


🌟 Built with ❤️ using Flutter, FastAPI, and Google Gemini AI

Real-time • Intelligent • Automated

About

A real-time web app that uses Flutter (frontend) and FastAPI (backend) to automatically extract questions from any Google Form, generate smart answers using Google Gemini LLM, and fill & submit the form in Chrome

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors