Skip to content

An advanced AI-powered fake news detection system that verifies text, images, and social media posts using Gemini AI, FastAPI, and Next.js. Includes a modern web interface, a lightweight Streamlit app, and a Chrome extension for real-time fake content detection. Built to combat misinformation with explainable AI results and contextual source links.

License

Notifications You must be signed in to change notification settings

colddsam/Truth-Guardian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Truth Guardian AI - Fake News Detection

Logo
Advanced AI-powered tool to detect fake news from Text, Social Media, and Images in real-time.

Live Site Chrome Extension Streamlit App Issues Forks Stars License Download


πŸ“Έ Preview

App Preview


πŸ“š Table of Contents


βœ… Features

Category Description
πŸ” Text Checker Detects manipulated or misleading text using NLP and ML
πŸ–ΌοΈ Image Checker Uses Gemini AI to analyze image authenticity
🧡 Social Checker Cross-verifies social media claims using real-time search engine results
🌐 Browser Ext. Chrome Extension to detect fake news directly on websites and posts
πŸ“Š Streamlit App Lightweight Python-based app interface for simple testing and analysis
🐍 Python API FastAPI backend for serving fake news detection APIs (text/image/social)
πŸ“ˆ Realtime Data Live AI scoring system with contextual feedback
βš™οΈ SEO Optimized Auto-generated sitemap, robots.txt, meta description

🧠 How it Works

graph TD;
    A[Input News] --> B{Choose Type};
    B -->|Text| C[Analyze Text];
    B -->|Image| D[Analyze Image with Gemini AI];
    B -->|Social Link| E[Fetch Context & Analyze];
    C --> F[Score + Verdict];
    D --> F;
    E --> F;
    F --> G[Result with Sources];
Loading

🧰 Tech Stack

Layer Technology
πŸ’» Frontend React.js, Next.js, TailwindCSS
πŸ“Š Streamlit Python Streamlit for UI + testing
βš™οΈ Backend Next.js API Routes, FastAPI (Python)
🧠 AI Google Gemini API
🌐 Extension Chrome Extension (Manifest V3)
☁️ Hosting Vercel (Frontend), Render (Backend)

πŸ› οΈ Next Website Setup

git clone https://github.com/colddsam/Fake-News-Detection.git
cd Fake-News-Detection/website
npm install
npm run dev

Visit: http://localhost:3000

βš™οΈ Create .env.local

GEMINI_API_KEY=your_gemini_api_key
ALLOWED_EXTENSION_ORIGIN=chrome-extension://your-extension-id
NEXT_PUBLIC_BASE_URL=https://yourappdomain.com

πŸ“Š Streamlit App

The Streamlit app is a minimal interface built for testing and rapid prototyping. Located in the frontend/ directory.

πŸš€ Run Streamlit Locally

cd Fake-News-Detection/frontend
pip install -r requirements.txt
streamlit run app.py

Open in browser: http://localhost:8501

✨ Features

  • Simple UI to test text, image, and social media inputs
  • Sends requests to the FastAPI backend
  • Displays AI-based scoring and verdicts
  • Lightweight and easy to modify

🐍 FastAPI Backend

cd Fake-News-Detection/backend
python3 -m venv venv
source venv/bin/activate  # on Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload

Backend will run at http://localhost:8000


🧩 Browser Extension

πŸ”§ Installation

  1. Visit chrome://extensions/
  2. Enable Developer Mode
  3. Click Load Unpacked
  4. Select the extension/ folder

🧾 SEO Configuration

Defined inside layout.tsx (Next.js):

export const metadata = {
  title: "Truth Guardian AI - Fake News Detection",
  description: "Advanced AI tool to detect fake news from text, social media, and images",
};

Other SEO tools:

  • next-sitemap for sitemap & robots
  • Optimized metadata & OG tags

πŸ“ Folder Structure


Fake-News-Detection
β”œβ”€β”€ backend/                   # FastAPI Backend
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ search.py
β”‚   β”œβ”€β”€ verify.py
β”‚   β”œβ”€β”€ utils.py
β”‚   └── requirements.txt
β”œβ”€β”€ frontend/                 # Streamlit App (New)
β”‚   β”œβ”€β”€ app.py
β”‚   └── requirements.txt
β”œβ”€β”€ extension/                # Browser Extension
β”‚   β”œβ”€β”€ icons/
β”‚   β”œβ”€β”€ config.js
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ popup.css
β”‚   β”œβ”€β”€ popup.html
β”‚   └── popup.js
β”œβ”€β”€ website/                  # Next.js Frontend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚    └──api/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ styles/
β”‚   β”œβ”€β”€ next.config.mjs
β”‚   β”œβ”€β”€ package.json
β”‚   └── ...
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ content.png
└── preview.png

🀝 Contributing

We welcome contributions! To get started:

  1. Fork the repository
  2. Create a new branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m "Added something cool"
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the Apache License


✨ Author

Samrat Kumar Das LinkedIn


About

An advanced AI-powered fake news detection system that verifies text, images, and social media posts using Gemini AI, FastAPI, and Next.js. Includes a modern web interface, a lightweight Streamlit app, and a Chrome extension for real-time fake content detection. Built to combat misinformation with explainable AI results and contextual source links.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published