A full-stack system that scrapes blog articles, exposes REST APIs, and automatically enhances content using external references and AI.
- The frontend consumes REST APIs exposed by the backend to display blog articles.
- The backend handles scraping, persistence, and CRUD operations using MongoDB.
- A standalone automation script periodically enhances articles by:
- Fetching unprocessed articles
- Scraping external references via Google Search
- Enhancing content using the Gemini LLM
- Publishing updates back through the backend APIs
- Scrape the latest blog articles from BeyondChats
- Store them in a MongoDB database
- Expose RESTful CRUD APIs for article management
Node.js (ES Modules), Express.js, MongoDB Atlas, Mongoose, Axios, Cheerio, dotenv
- Scrapes the latest 5 blog articles from: https://beyondchats.com/blogs/
- Extracts title, excerpt content, and source URL
- Prevents duplicate inserts using unique
sourceUrl - Idempotent scraper (safe to re-run)
- Clean and standard REST API design
titlecontent(initial excerpt)sourceUrl(unique)isUpdatedcreatedAt,updatedAt
GET /api/articlesGET /api/articles/:idPOST /api/articlesPUT /api/articles/:idDELETE /api/articles/:id
Phase 2 automates the enhancement of existing blog articles using external references and an AI language model.
This phase is implemented as a standalone automation script and uses the Phase 1 CRUD APIs to publish updates.
- Fetches existing articles via REST API
- Skips articles already marked as updated
- Uses article title and original content as base input
- Uses SerpAPI to search Google for relevant reference articles
- Scrapes content from external sources for contextual enrichment
- Integrates Google Gemini (gemini-2.5-flash) using the official SDK
- Generates improved article content using:
- Original article content
- External reference content
- Ensures:
- No verbatim copying
- Original intent preserved
- Improved clarity, structure, and depth
- Appends reference links at the bottom of the enhanced article
- Publishes the updated article using existing CRUD APIs
- Marks articles as updated to prevent reprocessing
- Implemented in
automation/updateArticles.js - Runs independently using Node.js
- Safe to re-run (idempotent)
- Environment variables loaded securely from backend
.env
- Node.js (ES Modules)
- MongoDB + Mongoose
- SerpAPI (Google Search)
- Google Gemini API (
@google/generative-ai) - Axios, dotenv
To visually validate the backend APIs and AI-enhanced content, a minimal frontend was added.
- Fetches articles from the backend REST API
- Displays scraped and AI-enhanced blog content
- Reflects updates made during Phase 2 automation
- React (Vite)
- Axios
- Plain CSS (Will Replace With Tailwind Later)



