TruthLens is a Chrome extension that uses AI to detect fake news in real-time and verifies credibility through trusted sources.
Check out the demo video on YouTube.
TruthLens helps users:
- Analyze news articles for credibility in real-time
- Detect bias and sentiment in content
- Cross-verify information with trusted sources
- Store verified news metadata for transparency
- Make more informed decisions about the content they consume
- Extension: React.js, Tailwind CSS, TypeScript, Manifest V3
- Backend: Python, FastAPI, Hugging Face Transformers
- Data Storage: Redis (caching), PostgreSQL (optional for production)
- APIs: Google Fact-Check API, Newspaper3k
- Real-time credibility analysis of news articles
- Visual trust indicators (High ✅, Medium
⚠️ , Low ❌) - Detailed analysis popup with sentiment, bias tags, and source verification
- Persistent storage of verified articles
- User reporting system for feedback
extension/
: Chrome extension frontend codebackend/
: FastAPI backend for NLP analysisshared/
: Common interfaces and types
- Clone this repository
- Navigate to the extension directory:
cd extension
- Install dependencies:
npm install
- Build the extension:
npm run build
- Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked" and select the
extension/dist
directory
- Open Chrome and go to
- Navigate to the backend directory:
cd backend
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt
- Start the FastAPI server:
uvicorn app.main:app --reload
- Ensure both the extension and backend are running
- Visit any news article website
- The TruthLens badge will appear, analyzing the article content
- Click on the extension icon for detailed analysis
- Test verification by clicking "Verify Article" in the extension popup
Create a .env
file in the backend directory with the following variables:
# API Keys
HUGGINGFACE_API_KEY=your_huggingface_key
GOOGLE_FACT_CHECK_API_KEY=your_google_api_key
# Redis Configuration (optional)
REDIS_URL=redis://localhost:6379/0
# Database Configuration (for production)
DB_CONNECTION_STRING=postgresql://username:password@localhost/truthlens
# Other Settings
USE_GPU=false
LOG_LEVEL=INFO
PORT=8000
Manas Dutta
Lead Developer
- GitHub: github.com/manasdutta04
- LinkedIn: linkedin.com/in/manasdutta04
This project is licensed under the MIT License.