A schema-driven system that uses an LLM to generate structured forms and automatically deploy them as Google Forms via API.
Instead of manually building forms in a UI, users define or generate a JSON schema and the system compiles it into a working Google Form.
This project enables:
- Generation of form structures using LLMs
- Strict JSON-based form DSL
- Automatic creation of Google Forms
- Web UI + CLI support
- OAuth-based authentication with Google
Core idea: treat forms as code artifacts, not UI constructs.
Prompt (LLM)
→ JSON Form DSL
→ Validation Layer
→ Mapping Engine (Compiler)
→ Google Forms API
→ Live Google Form
Frontend
- Angular
- JSON editor (optional Monaco editor)
Backend
- Node.js / NestJS
- Google Forms API integration
- OAuth2 authentication
External
- Google Forms API
- Google Identity Services (OAuth)
- Optional LLM provider (OpenAI or others)
- Form DSL (Schema)
All forms are defined using a strict JSON structure.
{
"title": "Customer Feedback",
"description": "Help us improve",
"sections": [
{
"title": "General",
"items": [
{
"type": "text",
"title": "Your name",
"required": true
},
{
"type": "multiple_choice",
"title": "Rate us",
"options": ["1", "2", "3", "4", "5"]
}
]
}
]
}- text
- multiple_choice
- checkbox
- dropdown
- image
- video
- section_break
Generates DSL from natural language prompts.
Rules:
- Must output valid JSON only
- No explanations
- Must strictly follow schema
Validates DSL with:
- JSON schema validation (AJV)
- Required fields enforcement
- Type validation
- Option validation
Transforms DSL into Google Forms API requests.
Responsibilities:
- Sections -> page breaks
- Items -> question items
- Maintain ordering via index
- Normalize field types
Wrapper over Google Forms API:
- Create form
- Batch update items
- Authentication handling
Uses Google OAuth.
Scope:
https://www.googleapis.com/auth/forms.body
Flow:
- Login with Google
- Receive access token
- Use token to call Google Forms API
Features:
- Paste JSON DSL
- Validate structure
- Generate Google Form
- Return shareable link
Optional enhancements:
- Live preview
- Visual schema editor
- Template library
Usage:
create-form form.jsonBehavior:
- Read JSON file
- Validate schema
- Call backend or API
- Output form URL
{
"title": "Survey",
"sections": [
{
"title": "Basics",
"items": [
{
"type": "text",
"title": "Name",
"required": true
}
]
}
]
}Google Form created:
https://docs.google.com/forms/d/FORM_ID
- No native JSON import in Google Forms
- Media handling limitations:
- Images may require upload handling
- Videos must be YouTube links
- Updates are limited (append-first model)
- Ordering must be explicitly managed
- Schema-first architecture
- Deterministic transformation
- Stateless pipeline
- Strict validation at boundaries
- No UI logic in core engine
/frontend
Angular application
/backend
api
auth
forms
mapper
validators
/cli
create-form tool
/dsl
schema definition
examples
/docs
architecture
API documentation
Recommended stack for this repository:
- Railway single-service deploy (frontend + backend in one container)
- Configured with
railway.toml+Dockerfile(non-deprecated flow)
Step-by-step guide:
- See
docs/deploy-railway-single-service.md
- OAuth tokens not persisted long-term
- Strict schema validation before API calls
- Rate limiting on form creation endpoint
- Input sanitization
- Visual form builder (schema-driven UI)
- Multi-provider support (Typeform, Airtable)
- Versioning system for forms
- Diff-based updates
- Prompt -> form -> preview -> deploy pipeline
- Template marketplace
- LLM = code generator
- DSL = contract
- Mapper = compiler
- Google Forms API = runtime
MVP-ready architecture.
Main work items:
- Finalize DSL
- Implement mapping engine
- Build OAuth flow
- Create Angular UI
- Add CLI tool
Phase 1 baseline is now scaffolded with:
- npm workspaces monorepo (
backend,frontend,cli) - NestJS backend skeleton
- Angular frontend skeleton
- CLI starter command
- Shared ESLint, Prettier, TypeScript, and Jest baseline
- GitHub Actions CI for lint + test
- Environment templates for backend and frontend
- Node.js 20 LTS
- npm 10+
npm installnpm run devDefault local endpoints:
- Backend health:
http://localhost:3000/health - Frontend dev server:
http://localhost:4200
npm run build
npm run test
npm run lint- Backend:
backend/.env.example - Frontend:
frontend/.env.example
npm installcompletes without blockersnpm run devstarts backend and frontendnpm run lintpassesnpm run testpasses- CI runs lint + test on push and pull_request