A production-ready MERN stack application that crawls websites, extracts content, and generates contextual FAQs using OpenAI's GPT models.
Try it now! The application is deployed and ready to use:
- π Frontend Application: https://faqforge-ui-app.onrender.com
- π§ Backend API: https://faqforge.onrender.com
- π API Health Check: https://faqforge.onrender.com/api/health
Note: The free tier on Render may take 30-60 seconds to wake up if the service has been idle.
- Intelligent Web Crawling: Extract content from any website with configurable depth and page limits
- AI-Powered FAQ Generation: Generate contextual FAQs using OpenAI GPT-4o
- Content Management: Review, edit, and publish FAQs through an intuitive admin dashboard
- Export Functionality: Export FAQs as JSON for integration with other systems
- Real-time Status Tracking: Monitor crawl progress and FAQ generation
- Material-UI Dashboard: Clean, responsive admin interface
- Node.js & Express.js - Server framework
- MongoDB & Mongoose - Database and ODM
- Cheerio - HTML parsing and content extraction
- OpenAI API - GPT-4o for FAQ generation
- Axios - HTTP client for web crawling
- React.js - UI framework
- Material-UI (MUI) - Component library
- Axios - API communication
- Node.js (v16 or higher)
- MongoDB (v5 or higher)
- OpenAI API Key (Get one here)
git clone <repository-url>
cd FAQForgenpm installcd frontend
npm install
cd ..Create a .env file in the root directory:
cp .env.example .envEdit .env with your configuration:
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/faqforge
# Server Configuration
PORT=5000
NODE_ENV=development
# OpenAI API Key (REQUIRED)
OPENAI_API_KEY=your_openai_api_key_here
# OpenAI Model Configuration
OPENAI_MODEL=gpt-4o
OPENAI_MAX_TOKENS=2000
OPENAI_TEMPERATURE=0.7
# Crawler Configuration
MAX_CRAWL_DEPTH=3
MAX_PAGES_PER_DOMAIN=20
CRAWL_TIMEOUT=10000your_openai_api_key_here with your actual OpenAI API key.
Ensure MongoDB is running on your system:
# Windows
net start MongoDB
# macOS/Linux
sudo systemctl start mongodnpm run devnpm run servernpm run clientnpm run build
npm startThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Health Check: http://localhost:5000/api/health
POST /api/crawl
Content-Type: application/json
{
"url": "https://example.com"
}GET /api/crawl/status/:websiteIdGET /api/crawl/websitesGET /api/pagesGET /api/pages/website/:websiteIdGET /api/pages/:pageIdPOST /api/faq/generate-page
Content-Type: application/json
{
"pageId": "page_id_here"
}POST /api/faq/generate-website
Content-Type: application/json
{
"websiteId": "website_id_here"
}GET /api/faq?websiteId=xxx&published=truePUT /api/faq/:id
Content-Type: application/json
{
"question": "Updated question?",
"answer": "Updated answer.",
"published": true
}DELETE /api/faq/:idGET /api/faq/export?websiteId=xxx&published=true- Navigate to the Website Crawler tab
- Enter a website URL (e.g.,
https://example.com) - Click Start Crawling
- Monitor the crawl progress in real-time
- Once crawling is complete, click Generate FAQs on the website
- The system will process all crawled pages
- FAQs are generated using OpenAI GPT-4o based on extracted content
- Navigate to the FAQ Manager tab
- Review generated FAQs
- Edit questions and answers as needed
- Toggle publish status for each FAQ
- Export FAQs as JSON
- Apply filters (Website, Published status)
- Click Export FAQs
- Download JSON file with all FAQs
FAQForge/
βββ backend/
β βββ config/
β β βββ database.js # MongoDB connection
β βββ controllers/
β β βββ crawlController.js # Crawl logic
β β βββ pageController.js # Page management
β β βββ faqController.js # FAQ operations
β βββ models/
β β βββ Website.js # Website schema
β β βββ PageContent.js # Page content schema
β β βββ FAQ.js # FAQ schema
β β βββ CrawlStatus.js # Crawl status schema
β βββ routes/
β β βββ crawlRoutes.js # Crawl endpoints
β β βββ pageRoutes.js # Page endpoints
β β βββ faqRoutes.js # FAQ endpoints
β βββ services/
β β βββ crawlerService.js # Web crawler with Cheerio
β β βββ openaiService.js # OpenAI integration
β βββ server.js # Express app entry
βββ frontend/
β βββ public/
β β βββ index.html
β βββ src/
β β βββ components/
β β β βββ CrawlPanel.js # Crawl UI component
β β β βββ FAQManager.js # FAQ management UI
β β βββ services/
β β β βββ api.js # API client
β β βββ App.js # Main app component
β β βββ index.js # React entry point
β βββ package.json
βββ .env.example # Environment template
βββ .gitignore
βββ package.json
βββ README.md
{
url: String,
domain: String,
status: ['pending', 'crawling', 'completed', 'failed'],
totalPages: Number,
crawlStartedAt: Date,
crawlCompletedAt: Date,
errorMessage: String
}{
websiteId: ObjectId,
url: String,
title: String,
headings: [{ level: Number, text: String }],
paragraphs: [String],
extractedContent: String,
wordCount: Number,
crawlStatus: ['pending', 'success', 'failed']
}{
websiteId: ObjectId,
pageId: ObjectId,
sourcePage: String,
question: String,
answer: String,
confidenceScore: Number,
published: Boolean,
edited: Boolean,
createdAt: Date
}The system uses OpenAI GPT-4o with the following prompt strategy:
You are an AI assistant that generates FAQs strictly from the provided website content.
RULES:
1. Use ONLY the content below.
2. Do NOT add external knowledge.
3. If answer is not present, say 'Information not available in the source content.'
4. Generate user-friendly questions.
5. Keep answers under 120 words.
CONTENT:
<<<EXTRACTED_TEXT>>>
Return JSON:
[
{
"question": "...",
"answer": "...",
"source": "page-url-or-section"
}
]
This ensures:
- β No hallucination
- β Context-aware responses
- β Factual accuracy
- β Proper citation
Current Implementation: This project currently uses OpenAI's GPT models (GPT-4/GPT-3.5) because I have an OpenAI API key readily available.
Claude Integration Available: The application architecture is designed to be AI-agnostic. If you prefer to use Claude (Anthropic) or any other AI model, the integration is straightforward:
- Update the API client in
backend/services/openaiService.js - Adjust the prompt format to match Claude's requirements
- Update the environment variables with your Claude API key
Want to switch to Claude? Just let me know, and I can easily integrate Claude API or any other AI provider you prefer! The core logic remains the same - only the API client needs to be swapped.
- β OpenAI (GPT-4, GPT-3.5) - Currently Active
- β Claude (Anthropic) - Ready to integrate
- β Google Gemini - Can be added
- β Any other LLM API - Flexible architecture
{
"exportDate": "2026-01-01T10:00:00.000Z",
"totalFAQs": 2,
"faqs": [
{
"question": "What services does the company offer?",
"answer": "The company offers web development, mobile app development, and cloud solutions for businesses of all sizes.",
"source": "https://example.com/services",
"published": true,
"confidence": 0.8,
"createdAt": "2026-01-01T09:30:00.000Z"
},
{
"question": "How can I contact support?",
"answer": "You can reach our support team via email at support@example.com or call us at 1-800-123-4567.",
"source": "https://example.com/contact",
"published": true,
"confidence": 0.85,
"createdAt": "2026-01-01T09:31:00.000Z"
}
]
}MAX_CRAWL_DEPTH: Maximum link depth to follow (default: 3)MAX_PAGES_PER_DOMAIN: Maximum pages to crawl per domain (default: 20)CRAWL_TIMEOUT: Request timeout in milliseconds (default: 10000)
OPENAI_MODEL: GPT model to use (default: gpt-4o)OPENAI_MAX_TOKENS: Maximum response tokens (default: 2000)OPENAI_TEMPERATURE: Response creativity (0-1, default: 0.7)
# Check if MongoDB is running
mongosh
# If connection fails, check MONGODB_URI in .env- 401 Unauthorized: Invalid API key - check
OPENAI_API_KEYin.env - 429 Rate Limited: Too many requests - wait or upgrade your OpenAI plan
- 500 Server Error: OpenAI service issue - retry later
- Timeout Errors: Increase
CRAWL_TIMEOUTin.env - No Content Extracted: Website may block crawlers or use JavaScript rendering
- Too Many Pages: Reduce
MAX_PAGES_PER_DOMAINin.env
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions, please open an issue on GitHub.
Built with β€οΈ using MERN Stack and OpenAI