8000 GitHub - jassalarjan/truthext Β· GitHub
[go: up one dir, main page]

Skip to content
jassalarjanPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TruthGuard AI - Misinformation Detection Browser Extension

A comprehensive browser extension that detects and flags misinformation in real-time using 100% free, open-source AI models.

🎯 Features

  • Real-time Text Analysis: Automatically scans web pages and highlights suspicious claims
  • Image Verification: Right-click context menu to verify images for manipulation
  • Source Credibility: Automatic domain credibility scoring
  • Cross-reference Verification: Links to existing fact-checks
  • Privacy-first Design: No user tracking, all processing server-side
  • Educational Insights: Tips and explanations to help users identify misinformation
  • 100% Free: Zero-cost infrastructure using open-source AI

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Chrome or Edge browser
  • Free account on Render.com or Railway.app (for backend deployment)

Installation

πŸš€ Quick Start in 5 Minutes

1. Start the Backend

The backend runs the AI models locally on your machine.

cd backend
npm install
npm start

Backend is now running at http://localhost:3000

2. Setup the Extension

The extension is pre-configured to connect to your local backend.

cd extension
npm install
npm run build

3. Load in Chrome

  1. Open chrome://extensions
  2. Turn on Developer mode (top right)
  3. Click Load unpacked
  4. Select the truthguard-ai/extension/dist folder

That's it! Browsing a page will now trigger local analysis.


☁️ Optional: Cloud Deployment

To share your extension with others, you can deploy the backend for free. See MIGRATION.md for instructions on deploying to Render.com or Railway.app.

πŸ“ Project Structure

truthguard-ai/
β”œβ”€β”€ backend/              # Node.js + Express backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.js     # Express server
β”‚   β”‚   β”œβ”€β”€ handlers/    # API endpoints
β”‚   β”‚   β”œβ”€β”€ ml/          # AI/ML models
β”‚   β”‚   └── data/        # JSON databases
β”‚   └── README.md        # Backend documentation
β”œβ”€β”€ extension/           # Browser extension
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ popup/      # Extension popup UI
β”‚   β”‚   β”œβ”€β”€ content/    # Content scripts
β”‚   β”‚   β”œβ”€β”€ background/ # Service worker
β”‚   β”‚   β”œβ”€β”€ sidepanel/  # Side panel
β”‚   β”‚   └── utils/      # Utilities
β”‚   └── public/         # Manifest and icons
β”œβ”€β”€ MIGRATION.md        # Migration guide from Google Cloud
└── README.md           # This file

πŸ› οΈ Technology Stack

Backend

  • Runtime: Node.js 18+ with Express
  • AI Models: Hugging Face Transformers (@xenova/transformers)
    • Credibility scoring: facebook/bart-large-mnli
    • Semantic search: Xenova/all-MiniLM-L6-v2
  • Storage: Local JSON files (no database needed)
  • Caching: In-memory with node-cache
  • Hosting: Render.com / Railway.app (free tier)

Frontend (Extension)

  • Framework: React 18 with TypeScript
  • Build Tool: Vite
  • UI: Tailwind CSS + Radix UI
  • State: Zustand + TanStack Query

πŸ’° Cost Breakdown

Component Service Cost
Backend Hosting Render.com Free Tier $0/month
AI Inference Self-hosted Transformers $0/month
Storage Local JSON files $0/month
Total $0/month

Compare to Google Cloud setup: $50-200/month

πŸ”’ Privacy & Ethics

TruthGuard AI is designed with privacy and ethics in mind:

  • βœ… No user tracking - No analytics or telemetry
  • βœ… No data persistence - Requests are not stored
  • βœ… Transparent AI - All outputs include confidence scores and explanations
  • βœ… Appropriate disclaimers - Probabilistic assessments clearly labeled
  • βœ… Open source - Full transparency in how decisions are made

πŸ“Š Performance

  • Cold start: 10-15s (model loading on first request)
  • Warm requests: 2-5s (text analysis)
  • Cache hits: <100ms
  • Accuracy: 75-85% (vs. 90%+ with fine-tuned models)

πŸ§ͺ Development

Backend Development

cd backend
npm install
npm start
# Server runs on http://localhost:3000

Extension Development

cd extension
npm install
npm run dev
# Note: Extensions require building and loading dist folder

Testing

# Backend tests
cd backend
npm test

# Extension tests
cd extension
npm test

πŸ“ API Documentation

See backend/README.md for detailed API documentation.

Quick Example

# Analyze text
curl -X POST http://localhost:3000/analyze-text \
  -H "Content-Type: application/json" \
  -d '{"text": "Breaking: Scientists discover cure for all diseases!"}'

# Response
{
  "score": 35,
  "confidence": 0.78,
  "classification": "misleading",
  "explanation": "This text may contain misleading information...",
  "evidence": ["Sensational language detected", "Lacks source citations"]
}

πŸš€ Deployment

Production Deployment

  1. Deploy backend to Render/Railway (see MIGRATION.md)
  2. Update extension .env with production backend URL
  3. Build extension: npm run build
  4. Package for Chrome Web Store:
    cd extension/dist
    zip -r ../truthguard-extension.zip .
  5. Submit to Chrome Web Store

Scaling Considerations

Free tier limits:

  • Render.com: 750 hours/month, 512MB RAM
  • Railway.app: $5 credit/month, 1GB RAM

For production scale (>100k requests/month), consider:

  • Upgrading to paid tier ($7-20/month)
  • Using CDN for static assets
  • Implementing request rate limiting

🀝 Contributing

Contributions welcome! Please read our contributing guidelines.

Adding Verified Claims

Edit backend/src/data/verified-claims.json:

{
  "id": "claim-new",
  "text": "Your verified claim",
  "verdict": "true",
  "sources": ["https://source.com"],
  "category": "science"
}

Adding Domain Reputation

Edit backend/src/data/domain-reputation.json:

"newdomain.com": {
  "score": 85,
  "verified": true,
  "factors": { ... }
}

πŸ“„ License

[Add your license here]

πŸ“§ Support

πŸ™ Acknowledgments

  • Hugging Face for Transformers.js
  • Xenova for browser-compatible ML models
  • Render.com for free hosting
  • Open-source community for making this possible

Note: This is a free-tier MVP suitable for hackathons, demos, and early pilots. For production use with high traffic, consider upgrading to paid hosting or implementing additional optimizations.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0