An open API service indexing awesome lists of open source software.

https://github.com/colddsam/truth-guardian

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.
https://github.com/colddsam/truth-guardian

ai-news-verification ai-verification chrome-extension fake-news-detection fastapi-backend gemini-api image-authentication machine-learning misinformation-detection news-fact-checking nextjs-api nextjs-app nlp nlp-news-detection social-media-analysis streamlit streamlit-app truth-score

Last synced: 4 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# ๐Ÿ›ก๏ธ Truth Guardian AI - Fake News Detection

![Logo](./content.png)
_Advanced AI-powered tool to detect fake news from **Text**, **Social Media**, and **Images** in real-time._

[![Live Site](https://img.shields.io/badge/๐ŸŒ%20Live%20Website-Visit-green?style=for-the-badge&logo=vercel)](https://fake-news-detection-inky.vercel.app/)
[![Chrome Extension](https://img.shields.io/badge/๐Ÿงฉ%20Extension-Setup-blue?style=for-the-badge&logo=googlechrome)](#-browser-extension)
[![Streamlit App](https://img.shields.io/badge/๐Ÿ“Š%20Streamlit-Launch-orange?style=for-the-badge&logo=streamlit)](#-streamlit-app)
[![Issues](https://img.shields.io/github/issues/colddsam/Fake-News-Detection?style=for-the-badge)](https://github.com/colddsam/Fake-News-Detection/issues)
[![Forks](https://img.shields.io/github/forks/colddsam/Fake-News-Detection?style=for-the-badge)](https://github.com/colddsam/Fake-News-Detection/network/members)
[![Stars](https://img.shields.io/github/stars/colddsam/Fake-News-Detection?style=for-the-badge)](https://github.com/colddsam/Fake-News-Detection/stargazers)
[![License](https://img.shields.io/github/license/colddsam/Fake-News-Detection?style=for-the-badge)](https://github.com/colddsam/Fake-News-Detection/blob/main/LICENSE)
[![Download](https://img.shields.io/badge/โฌ‡๏ธ%20Download-Zip-blue?style=for-the-badge)](https://github.com/colddsam/Fake-News-Detection/archive/refs/heads/main.zip)

---

## ๐Ÿ“ธ Preview

![App Preview](./preview.png)

---

## ๐Ÿ“š Table of Contents

- [๐Ÿ›ก๏ธ Truth Guardian AI - Fake News Detection](#๏ธ-truth-guardian-ai---fake-news-detection)
- [๐Ÿ“ธ Preview](#-preview)
- [๐Ÿ“š Table of Contents](#-table-of-contents)
- [โœ… Features](#-features)
- [๐Ÿง  How it Works](#-how-it-works)
- [๐Ÿงฐ Tech Stack](#-tech-stack)
- [๐Ÿ› ๏ธ Next Website Setup](#๏ธ-next-website-setup)
- [โš™๏ธ Create `.env.local`](#๏ธ-create-envlocal)
- [๐Ÿ“Š Streamlit App](#-streamlit-app)
- [๐Ÿš€ Run Streamlit Locally](#-run-streamlit-locally)
- [โœจ Features](#-features-1)
- [๐Ÿ FastAPI Backend](#-fastapi-backend)
- [๐Ÿงฉ Browser Extension](#-browser-extension)
- [๐Ÿ”ง Installation](#-installation)
- [๐Ÿงพ SEO Configuration](#-seo-configuration)
- [๐Ÿ“ Folder Structure](#-folder-structure)
- [๐Ÿค Contributing](#-contributing)
- [๐Ÿ“œ License](#-license)
- [โœจ Author](#-author)

---

## โœ… 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

```mermaid
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];
```

---

## ๐Ÿงฐ 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

```bash
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`

```env
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

```bash
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

```bash
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):

```ts
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](https://github.com/colddsam/Fake-News-Detection/blob/main/LICENSE)

---

## โœจ Author

**Samrat Kumar Das**
[![LinkedIn](https://img.shields.io/badge/Connect-LinkedIn-blue?style=flat\&logo=linkedin)](https://www.linkedin.com/in/colddsam/)

---