Skip to content

Simple webpage that receives a URL and creates an automatic FAQ with it or completes a given FAQ file (support for excel)

Notifications You must be signed in to change notification settings

mageroni/FAQ-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FAQ-Generator

AI-powered FAQ generation tool that uses GitHub Copilot SDK to automatically create FAQs from:

  • 🌐 Web URLs - Extract content from any webpage and generate comprehensive FAQs
  • 📊 Excel Files - Process spreadsheet data to create or enhance FAQ content
  • 🖼️ Images - Analyze images (screenshots, diagrams, documents) to generate relevant FAQs

Features

  • URL Processing: Automatically fetch and analyze webpage content to generate relevant FAQs
  • Excel Support: Upload .xlsx or .xls files to format existing FAQs or generate new ones from data
  • Image Analysis: Upload images and let AI interpret the visual content to create FAQs
  • Powered by Copilot SDK: Uses GitHub Copilot SDK for intelligent content generation
  • Modern UI: Clean, responsive web interface with tabbed navigation
  • Real-time Processing: See your FAQ being generated in real-time

Prerequisites

Before running this application, ensure you have:

  1. Node.js 18+ - Download here
  2. GitHub CLI - Installation guide
  3. GitHub Copilot CLI - Required for AI features
  4. GitHub Copilot access - Individual, Business, or Enterprise subscription

Installation

Step 1: Install GitHub CLI and authenticate

# Install GitHub CLI (if not already installed)
# macOS
brew install gh

# Windows
winget install GitHub.cli

# Linux
# See https://github.com/cli/cli/blob/trunk/docs/install_linux.md

# Then authenticate
gh auth login

Step 2: Install GitHub Copilot CLI extension

gh extension install github/gh-copilot

Step 3: Clone and setup the project

git clone <your-repository-url>
cd FAQ-Generator
npm install

Usage

Development Mode

npm run dev

This will start the server on http://localhost:3000 with hot-reloading enabled.

Production Build

npm run build
npm start

The server will start on http://localhost:3000 (or the port specified in PORT environment variable).

How It Works

1. URL-based FAQ Generation

  • Enter any webpage URL
  • The system fetches and extracts the main content
  • Copilot SDK analyzes the content and generates relevant Q&A pairs
  • Receive a comprehensive FAQ based on the page content

2. Excel File Processing

  • Upload an Excel file (.xlsx or .xls)
  • The system reads and interprets the spreadsheet data
  • If it contains FAQ data, it formats and enhances it
  • If it contains other data, it generates relevant FAQs about that data

3. Image-based FAQ Generation

  • Upload an image (screenshot, diagram, document photo, etc.)
  • Copilot SDK with vision capabilities analyzes the image
  • Generates FAQs based on the visual content
  • Works with charts, text in images, diagrams, and more

API Endpoints

  • POST /api/generate-from-url - Generate FAQ from URL

    • Body: { "url": "https://example.com" }
    • Response: { "faq": "Generated FAQ content..." }
  • POST /api/generate-from-excel - Generate FAQ from Excel file

    • Content-Type: multipart/form-data
    • Field: file (Excel file)
    • Response: { "faq": "Generated FAQ content..." }
  • POST /api/generate-from-image - Generate FAQ from image

    • Content-Type: multipart/form-data
    • Field: file (Image file)
    • Response: { "faq": "Generated FAQ content..." }

Technology Stack

  • Backend: Node.js with Express
  • Language: TypeScript
  • AI: GitHub Copilot SDK
  • Web Scraping: Cheerio
  • Excel Processing: ExcelJS (secure alternative to xlsx)
  • File Uploads: Multer 2.x (secure version)
  • Frontend: Vanilla JavaScript with modern CSS

Project Structure

FAQ-Generator/
├── src/
│   ├── server.ts           # Express server and API routes
│   └── faq-generator.ts    # Copilot SDK integration and processing logic
├── public/
│   └── index.html          # Frontend UI
├── uploads/                # Temporary file storage (auto-created)
├── dist/                   # Compiled TypeScript output
├── package.json
├── tsconfig.json
└── README.md

Configuration

The application can be configured using environment variables:

  • PORT - Server port (default: 3000)

Limitations

  • URL content extraction is limited to 4000 characters for optimal processing
  • File upload size is limited to 10MB
  • Supported Excel formats: .xlsx, .xls
  • Supported image formats: .jpg, .jpeg, .png, .gif, .bmp
  • Requires active GitHub Copilot subscription
  • Note: This is a demonstration application. For production use, consider adding:
    • Rate limiting to prevent abuse
    • Authentication and authorization
    • Input validation and sanitization
    • HTTPS/TLS encryption
    • Database for storing generated FAQs
    • Caching layer for improved performance

Other interesting projects using Copilot SDK

License

MIT

About

Simple webpage that receives a URL and creates an automatic FAQ with it or completes a given FAQ file (support for excel)

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published