How akhan1502/news-evaluation-tool works
Purpose and Topology
NET is a news-credibility evaluation system: a browser extension extracts the current article, submits it for analysis, and presents reliability-oriented results. The repository contains three deployable concerns: a Chrome/Firefox extension, a React web client, and a Python API with SQLite persistence. A top-level bridge script may support extension-to-backend communication: backend/extension_communicator.py.
Browser Extension Entry and Capture
The extension is the primary in-page interaction surface. Its manifest defines browser integration and likely registers the content script: news-extension/manifest.json, news-extension/manifest.chrome.json, news-extension/src/content-script.js. The extension UI is bootstrapped through news-extension/src/main.tsx and composed in news-extension/src/components/extension-app.tsx.
Extension Analysis Presentation
The extension presents the credibility result rather than implementing analysis locally. Its UI components encode major result dimensions—criteria checks, score visualization, and sentiment display—at news-extension/src/components/ui/criteria-check.tsx, news-extension/src/components/ui/gauge.tsx, and news-extension/src/components/ui/sentiment-chart.tsx. Browser API abstractions and shared result types form the boundary between extension runtime APIs and application code: news-extension/src/lib/browser.ts, news-extension/src/types/index.ts.
API Boundary and Backend Entry
The Python backend is the analysis and persistence service, entered through news-analyzer/backend/main.py. News-specific HTTP endpoints are isolated in news-analyzer/backend/routers/news.py; request/response contracts are defined in news-analyzer/backend/schemas.py. Both the extension and web client contain dedicated API clients—news-extension/src/lib/api.ts and news-analyzer/src/lib/api.ts—which should be treated as the frontend/backend protocol boundary.
Domain Persistence
Backend domain entities and database setup are separated into news-analyzer/backend/models.py and news-analyzer/backend/database.py. SQLite database artifacts (news-analyzer/backend/news.db, backend/news_analyzer.db) indicate local-file persistence rather than managed external storage. Analysis requests flow from captured article content through the news router, domain models, and SQLite records, then return structured results to clients.
Web Client
news-analyzer is a separate Vite/React application, bootstrapped by news-analyzer/src/main.tsx and rooted at news-analyzer/src/App.tsx. It provides route-level experiences for analysis, authentication, home, and profile: news-analyzer/src/routes/analyzer/page.tsx, news-analyzer/src/routes/auth/page.tsx, news-analyzer/src/routes/profile/page.tsx. Authentication state is centralized in news-analyzer/src/contexts/auth-context.tsx, while protected-route enforcement is at news-analyzer/src/components/protected-route.tsx.
Runtimes and Key Boundaries
Frontend clients use TypeScript/React, Vite, Tailwind/PostCSS, and browser extension manifests. The service layer is Python with SQLite. The essential control flow is: browser page → extension content script/UI → API client → Python news router → database/models → structured analysis result → extension or web analyzer UI. The README describes AI-powered text comparison and credibility scoring, but no explicit AI-provider integration is visible in the supplied tree; it should remain an implementation boundary behind the backend API.
Main entry points: extension-app.tsx Extension App · api.ts Extension API Client · news.py News Router · App.tsx Web App
Components 21
Browser Extension
In-page article capture and credibility result presentation.
- Extension Manifests
news-extension/manifest.json - Content Script
news-extension/src/content-script.js - Extension Entry
news-extension/src/main.tsx - Extension App
news-extension/src/components/extension-app.tsx - Result Views · Visualizes credibility dimensions.
news-extension/src/components/ui/criteria-check.tsx - Browser API Boundary
news-extension/src/lib/browser.ts - Extension API Client
news-extension/src/lib/api.ts - Shared Result Types
news-extension/src/types/index.ts
Python API
Analysis and persistence boundary.
- API Entry
news-analyzer/backend/main.py - News Router
news-analyzer/backend/routers/news.py - API Schemas
news-analyzer/backend/schemas.py - Domain Models
news-analyzer/backend/models.py - SQLite Setup
news-analyzer/backend/database.py - SQLite Records
news-analyzer/backend/news.db
Web Client
Separate React application for analysis and accounts.
- Web Entry
news-analyzer/src/main.tsx - Web App
news-analyzer/src/App.tsx - Analyzer Route
news-analyzer/src/routes/analyzer/page.tsx - Web API Client
news-analyzer/src/lib/api.ts - Auth State
news-analyzer/src/contexts/auth-context.tsx - Protected Routes
news-analyzer/src/components/protected-route.tsx
Other components
- Browser Page
Connections 22
- Extension Manifests → Content Script: registers
- Extension Manifests → Extension Entry: loads UI
- Browser Page → Content Script: article content
- Content Script → Browser API Boundary: browser messaging
- Browser API Boundary → Extension App: captured article
- Extension Entry → Extension App: mounts
- Extension App → Extension API Client: analysis request
- Extension API Client → Shared Result Types: uses
- Extension API Client → API Entry: HTTP
- API Entry → News Router: routes
- News Router → API Schemas: validates and returns
- News Router → Domain Models: creates analysis records
- Domain Models → SQLite Setup: persists through
- SQLite Setup → SQLite Records: stores
- API Schemas → Extension App: structured result
- Extension App → Result Views: renders
- Web Entry → Web App: mounts
- Web App → Analyzer Route: analysis route
- Analyzer Route → Web API Client: analysis request
- Web API Client → API Entry: HTTP
- Web App → Auth State: provides state
- Auth State → Protected Routes: authorizes