How srichu05/truthlens-ai works
TruthLens AI is a web platform for assessing news credibility. A user submits text, a URL, or a document through the analyzer; the backend extracts claims, combines heuristic signals with fact-check evidence, and returns a verdict with supporting explanations. The product also provides authentication, analysis history, dashboards, real-article corrections, shared results, and PDF reports. The README documents the verification stages, while sampled source confirms application routing, API/auth behavior, persistence setup, and fact-check lookup/cache behavior; unsampled implementation details limit some wiring shown here.
Main entry points: api.ts API client · analyzer.py Analysis endpoints · RealArticles.tsx Article browsing · real_articles.py Real-article endpoints
Components 24
Web application
- App routing
src/App.tsx - News analyzer
src/pages/NewsAnalyzer.tsx - History and dashboard
src/pages/AnalysisHistory.tsx - Article browsing
src/pages/RealArticles.tsx - Article detail
src/pages/RealArticleDetail.tsx - Shared result
src/pages/SharedResultPage.tsx - Profile and auth
src/pages/Profile.tsx - API client
src/services/api.ts - PDF report
src/utils/pdfGenerator.ts
Credibility analysis
- Analysis endpoints
backend/app/api/analyzer.py - Web and file input
backend/app/services/web_scraper.py - Claim extraction
backend/app/services/nlp_analyzer.py - Verdict and explanation
backend/app/api/analyzer.py
Accounts and history
- History endpoints
backend/app/api/history.py - Auth endpoints
backend/app/api/auth.py - Application database
backend/app/db/session.py - User and analysis records
backend/app/models/analysis.py
Real articles
- Real-article endpoints
backend/app/api/real_articles.py - Article sourcing
backend/app/services/real_articles.py
Evidence services
- Claim verification
backend/app/services/factcheck_service.py - Fact-check cache
backend/app/services/factcheck_cache.py
Other components
- News reader
- Global fact-check registry
- Supabase Auth
Connections 28
- News reader → App routing: opens
- App routing → News analyzer: routes to
- News analyzer → API client: submits input
- API client → Analysis endpoints: requests analysis
- Analysis endpoints → Web and file input: extracts content
- Analysis endpoints → Claim extraction: extracts claims
- Analysis endpoints → Claim verification: checks claims
- Claim verification → Fact-check cache: reads and writes
- Claim verification → Global fact-check registry: queries reviews
- Analysis endpoints → Verdict and explanation: synthesizes result
- Verdict and explanation → API client: returns result
- News reader → History and dashboard: views analyses
- History and dashboard → API client: requests history
- API client → History endpoints: requests records
- History endpoints → Application database: reads and writes
- User and analysis records → Application database: maps records
- News reader → Profile and auth: signs in
- Profile and auth → API client: authenticates
- API client → Supabase Auth: uses auth
- API client → Auth endpoints: checks backend session
- News reader → Article browsing: browses articles
- Article browsing → API client: requests articles
- API client → Real-article endpoints: requests articles
- Real-article endpoints → Article sourcing: loads articles
- Real-article endpoints → Application database: reads and writes
- Article browsing → Article detail: selects article
- News reader → Shared result: opens shared result
- Verdict and explanation → PDF report: formats report