Describe your form in plain English β get a fullyβconfigured Google Form in seconds.
- Overview
- Key Features
- Screenshots
- Architecture
- Tech Stack
- Project Structure
- Prerequisites
- Getting Started
- Environment Variables
- Database Setup
- API Endpoints
- Developer Scripts
- Deployment
- License
AI-Powered Google Form Generator is a full-stack web application that lets users sign in with their Google account and create professional Google Forms using natural language prompts. Powered by Google Gemini AI, the app interprets your description, generates structured questions, and publishes a real Google Form to your account β all in one click.
| Feature | Description |
|---|---|
| π Google OAuth 2.0 | Secure user-consent login β forms are created in your own Google account |
| π§ AI Form Generation | Describe your form in plain text and Gemini AI generates structured questions |
| π Generate from Document | Upload a PDF or DOCX and auto-generate a form from the document content |
| π Form Templates | Quick-start templates for surveys, quizzes, feedback forms, and more |
| βοΈ Edit Forms | Modify generated forms before or after publishing |
| π Form Analytics | Visualize response data with interactive charts (D3.js + Recharts) |
| π My Forms Dashboard | View, manage, archive, and track all your generated forms |
| π‘οΈ Security | Helmet, rate limiting, encrypted token storage, Zod validation |
| π³ Docker Ready | Multi-stage Dockerfile for single-service production deployment |
| Sign In | Dashboard |
![]() |
|
| Create Form with AI | My Forms |
![]() |
![]() |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React + Vite (SPA) β
β TailwindCSS Β· Framer Motion Β· Redux Toolkit Β· Recharts β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β /api/* (Vite proxy in dev)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Node.js + Express Backend β
β β
β ββββββββββββββ ββββββββββββββ βββββββββββββββββββββ β
β β Controllers βββ Services βββ External APIs β β
β β (thin) β β (business β β β’ Google Forms β β
β β β β logic) β β β’ Google OAuth β β
β ββββββββββββββ ββββββββββββββ β β’ Google Gemini β β
β βββββββββββββββββββββ β
β Middlewares: auth Β· rateLimit Β· validate Β· errorHandler β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Supabase (PostgreSQL) β
β Tables: users Β· user_google_tokens Β· forms β
β form_questions Β· form_analytics β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Technology | Purpose |
|---|---|
| Node.js β₯ 20 | Runtime |
| Express 4 | HTTP framework |
| Google Gemini | AI-powered question generation |
| googleapis | Google Forms & OAuth integration |
| Supabase JS | Database client (PostgreSQL) |
| Zod | Environment & request validation |
| Helmet | HTTP security headers |
| express-rate-limit | API rate limiting |
| jsonwebtoken | Session JWT tokens |
| Pino | Structured JSON logging |
| Multer | File upload handling |
| pdf-parse / Mammoth | Document text extraction (PDF & DOCX) |
| Technology | Purpose |
|---|---|
| React 18 | UI framework |
| Vite 5 | Build tool & dev server |
| Redux Toolkit | Global state management |
| TailwindCSS 3 | Utility-first styling |
| Framer Motion | Animations & transitions |
| React Router v6 | Client-side routing |
| React Hook Form | Form handling & validation |
| D3.js + Recharts | Data visualization & charts |
| Lucide React | Icon library |
| Axios | HTTP client |
AI-powered-Google-Form-Generator/
β
βββ src/ # ββ Backend (Node + Express) ββ
β βββ server.js # Entry point β starts HTTP server
β βββ app.js # Express app factory (middleware, routes, static)
β βββ config/
β β βββ env.js # Zod-validated environment variables
β βββ controllers/
β β βββ generateFormController.js # AI form generation
β β βββ generateFromDocumentController.js # Document β form
β β βββ extractFromImagesController.js # Image β form
β β βββ formsController.js # CRUD for user forms
β β βββ formTemplateController.js # Template endpoints
β β βββ improveFormController.js # AI form improvement
β β βββ analyticsController.js # Response analytics
β βββ services/
β β βββ geminiService.js # Google Gemini AI integration
β β βββ googleFormsService.js # Google Forms API wrapper
β β βββ googleOAuthService.js # OAuth2 token management
β β βββ userFormsService.js # Form CRUD (Supabase)
β β βββ userGoogleFormsService.js # User-scoped Google Forms ops
β β βββ analyticsService.js # Response analytics logic
β β βββ documentFormService.js # PDF/DOCX text extraction
β β βββ formTemplateService.js # Template management
β β βββ formImprovementService.js # Form improvement logic
β β βββ aiFormImprovementService.js # AI-powered improvements
β β βββ sessionService.js # JWT session helpers
β β βββ supabaseClient.js # Supabase client init
β βββ middlewares/
β β βββ auth.js # JWT cookie authentication
β β βββ requireUser.js # Require authenticated user
β β βββ validate.js # Request body validation
β β βββ rateLimit.js # Rate-limiting config
β β βββ errorHandler.js # Global error handler
β βββ routes/
β β βββ authRoute.js # /auth/* β login, callback, logout
β β βββ generateFormRoute.js # /generate β AI generation
β β βββ formsRoute.js # /forms/* β CRUD, analytics, templates
β βββ utils/
β βββ appError.js # Structured AppError class
β βββ asyncHandler.js # Async route wrapper
β βββ crypto.js # Token encryption/decryption
β βββ formTemplates.js # Built-in template definitions
β βββ logger.js # Pino logger instance
β
βββ FRONTEND/ # ββ Frontend (React + Vite) ββ
β βββ src/
β β βββ index.jsx # React entry point
β β βββ App.jsx # Root app component
β β βββ Routes.jsx # Route definitions
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page-level components
β β β βββ dashboard/ # Main dashboard
β β β βββ create-form/ # AI form creation
β β β βββ generate-from-document/ # Document upload β form
β β β βββ my-forms/ # Form management
β β β βββ edit-form/ # Form editor
β β β βββ form-analytics/ # Response analytics
β β β βββ templates/ # Template browser
β β β βββ profile/ # User profile
β β β βββ login/ # Google sign-in
β β βββ context/ # React context providers
β β βββ services/ # API service layer
β β βββ styles/ # Global CSS
β β βββ utils/ # Frontend utilities
β βββ vite.config.mjs # Vite config + API proxy
β βββ tailwind.config.js # TailwindCSS config
β βββ package.json
β
βββ supabase/
β βββ schema.sql # Database schema (PostgreSQL)
β
βββ scripts/ # Developer utility scripts
β βββ check-supabase.mjs # Verify Supabase connection
β βββ test-gemini.js # Test Gemini API
β βββ test-generate.js # Test form generation
β βββ ... # More test/debug scripts
β
βββ docs/images/ # Screenshots for docs
βββ Dockerfile # Multi-stage production build
βββ render.yaml # Render.com deploy config
βββ package.json # Backend dependencies & scripts
βββ eslint.config.js # ESLint flat config
βββ LICENSE # Proprietary (evaluation-only)
- Node.js β₯ 20 β Download
- npm (bundled with Node.js)
- Google Cloud Project with the following APIs enabled:
- Google Forms API
- Google Drive API (for form permissions)
- OAuth 2.0 Credentials (Web application type) β Console
- Google Gemini API Key β AI Studio
- Supabase Project β supabase.com
git clone https://github.com/your-username/AI-powered-Google-Form-Generator.git
cd AI-powered-Google-Form-Generatornpm installcd FRONTEND
npm install
cd ..Copy the example env file and fill in your credentials:
cp .env.example .envSee Environment Variables for the full reference.
Run the SQL schema against your Supabase project:
# Copy contents of supabase/schema.sql into your Supabase SQL Editor and executeTerminal 1 β Backend (port 3000):
npm run devTerminal 2 β Frontend (port 4028):
cd FRONTEND
npm run devNavigate to http://localhost:4028 β sign in with Google and start generating forms!
Create a .env file in the project root with the following variables:
| Variable | Required | Description |
|---|---|---|
PORT |
Β· | Backend port (default: 3000) |
NODE_ENV |
Β· | development or production |
FRONTEND_APP_URL |
β | Frontend URL (e.g., http://localhost:4028) |
GEMINI_API_KEY |
β | Google Gemini API key |
GOOGLE_OAUTH_CLIENT_ID |
β | OAuth 2.0 client ID |
GOOGLE_OAUTH_CLIENT_SECRET |
β | OAuth 2.0 client secret |
GOOGLE_OAUTH_REDIRECT_URI |
β | OAuth callback URL (e.g., http://localhost:3000/auth/google/callback) |
SESSION_JWT_SECRET |
β | JWT signing secret (min 32 chars) |
TOKENS_ENCRYPTION_KEY_BASE64 |
β | AES encryption key for tokens (base64, 32 bytes) |
SUPABASE_URL |
β | Supabase project URL |
SUPABASE_SERVICE_ROLE_KEY |
β | Supabase service role key (not the anon key) |
β οΈ Important: Do not use the Supabaseanonkey β the app will detect this and throw an error at startup.
Execute the schema in supabase/schema.sql via the Supabase SQL Editor. This creates:
| Table | Purpose |
|---|---|
users |
Google-authenticated user profiles |
user_google_tokens |
Encrypted OAuth refresh tokens |
forms |
Form metadata (title, prompt, URLs, settings) |
form_questions |
Individual questions per form |
form_analytics |
Cached response analytics (reduces API calls) |
| Method | Endpoint | Description |
|---|---|---|
GET |
/auth/google |
Initiate Google OAuth flow |
GET |
/auth/google/callback |
OAuth callback handler |
GET |
/auth/me |
Get current user info |
POST |
/auth/logout |
Clear session & logout |
| Method | Endpoint | Description |
|---|---|---|
POST |
/generate |
Generate a form from a text prompt |
POST |
/generate/from-document |
Generate a form from an uploaded document |
POST |
/generate/from-images |
Generate a form from uploaded images |
| Method | Endpoint | Description |
|---|---|---|
GET |
/forms |
List all user forms |
GET |
/forms/:id |
Get form details |
PATCH |
/forms/:id |
Update form metadata |
DELETE |
/forms/:id |
Delete / archive a form |
POST |
/forms/:id/improve |
AI-powered form improvement |
GET |
/forms/:id/analytics |
Get response analytics |
| Method | Endpoint | Description |
|---|---|---|
GET |
/templates |
List available form templates |
All endpoints are also available under the
/apiprefix (e.g.,/api/generate).
| Command | Description |
|---|---|
npm run dev |
Start backend with --watch (auto-restart on changes) |
npm run start |
Start backend in production mode |
npm run build |
Build frontend for production |
npm run lint |
Run ESLint on backend code |
# Verify Supabase connection & list forms
node -r dotenv/config scripts/check-supabase.mjs
# Test Gemini API connectivity
node -r dotenv/config scripts/test-gemini.js
# Test full form generation pipeline
node -r dotenv/config scripts/test-generate.js
# Test Google Forms API directly
node -r dotenv/config scripts/test-google-create-form.jsThe included multi-stage Dockerfile builds the React frontend and serves everything from a single Express server:
docker build -t ai-form-generator .
docker run -p 3000:3000 --env-file .env ai-form-generatorA render.yaml blueprint is included for one-click deployment:
- Connect your GitHub repo to Render
- Use the Blueprint feature and select
render.yaml - Set the required environment variables in the Render dashboard
- Deploy β the app will be live at your Render URL
Production Note: The backend serves the built frontend from
FRONTEND/build/in production, ensuring same-origin cookies work without cross-site configurations.
Copyright Β© 2025 Deepak Paswan β All Rights Reserved.
This repository is made publicly viewable for academic review, hackathon judging, and evaluation purposes only. No license is granted to use, copy, modify, distribute, or create derivative works. See LICENSE for full terms.
Built with β€οΈ by Deepak Paswan


