How jawad-nsu/factcheckerai works
Project Overview
• This project is a Chrome extension that collects data from the current website (such as URL, page title, full HTML, text, meta, links, and images) and sends it to a backend API for further processing.
• In addition to the extension code, there is a backend API located in the api folder. The backend is likely built using Node.js (as seen by the package.json and server.js) and is responsible for receiving and processing the data collected by the extension.
• There is also a ‘src’ folder that appears to be for the frontend part of the extension (such as the popup UI) and is built using modern JavaScript/React with Vite (given the vite.config.js, .jsx files, etc.).
Main Components
a. Chrome Extension Components:
• Manifest & Permissions: The manifest.json file outlines permissions (accessing website content), which ties to the extension’s ability to interact with web pages.
• Content Script (content.js): Injected into webpages; scrapes website data.
• Background Script (background.js): Handles long-running tasks, events, and possibly manages communication between extension parts.
b. Backend API Server:
• API Directory (api folder): Contains server.js, package.json, and related config files. It acts as the endpoint for collected data.
Relationships and Data Flow
• The extension’s popup and content script interact – the user triggers data collection from the popup interface.
• Upon triggering, the content script collects website data and sends the data (via a secured POST request) to the backend API endpoint configured in content.js.
• User interaction → Popup UI → Content Script activation
• Content Script → API Server (HTTP POST)
• The background script potentially manages messaging between different parts of the extension or handles additional asynchronous events.