How ramya-parsania/truthtell works
Project Type and Purpose
• Nexus of Truth is a full-stack, real-time misinformation detection system for live broadcasts.
• It comprises a React/TypeScript-based dashboard + Chrome extension (nexus-frontend & nexus-extension) and a Python microservice backend (nexus-backend) that ingests media streams, runs NLP and deepfake detection, and delivers fact-check results.
File Structure Analysis
• Top-Level Directories
• nexus-frontend: React/TS dashboard + static assets + Vite config + Tailwind CSS
• nexus-backend: Python services subdivided into Deep_fake_detection, deepfake2, fc (fact-checking), knowledge_graph, routes, db initializer + NLTK data
• nexus-extension: Browser extension with manifest, popup UI, Python backend integration
• Architectural Patterns
• Backend is organized as lightweight microservices (each folder is a self-contained module)
• Routes directory defines REST endpoints (likely using Flask or FastAPI)
• Event-driven stream processing implied by Kafka (README)
• Data persistence via a relational/NoSQL database (init_db.py) and knowledge graph (Neo4j mentioned in README)
• Deployment / Infrastructure
• Docker containerization (README)
• Apache Kafka for real-time messaging
• External fact-check APIs and social media streaming sources
Key Components
A. Frontend Layer
• Web Dashboard (React + Tailwind)
• Browser Extension (popup.html, popup.js)
B. API Gateway / Ingress
• REST/WebSocket endpoints (routes/*.py)
• Authentication service (auth.py)
C. Message Broker
• Apache Kafka topics for “raw_media_stream,” “fact_check_requests,” “detection_requests,” “results”
D. Microservices
1. Deepfake Detection
– Deep_fake_detection module (detector.py, videoprocess.py, basemodels.py)
– deepfake2 module (deepfake2.py, .h5 model)
2. Fact-Checking Engine (fc folder)
– news_summ, fact_checker, newsfetcher, serper_search integration
3. Knowledge Graph Generator
– knowledge_graph_generator.py, final.py
4. Social Media Analysis (not in code folder but noted in README)
5. Impact Analysis & Source Correction (framework described in README)
6. Continuous Learning Feedback Loop (user reports → model retraining)
E. Data Stores
• Primary DB (init_db.py)
• Knowledge Graph DB (Neo4j)
• NLTK data asset store
• Temporary JSON store (fetched_pages.json)
F. External Services
• FactCheck APIs (Google FactCheck, Loki, WordLift)
• Social media streams (Twitter, Facebook, TikTok)
• Cloud storage (AWS S3/GCS if deployed)
Component Relationships & Data Flow
• UI → API Gateway: HTTP / WebSocket calls (user inputs, live stream URLs)
• Gateway → Kafka: Publish raw data to media or NLP topics
• Microservices consume from Kafka, process (e.g., run BERT on text, TensorFlow/PyTorch on video frames)
• Microservices emit results back to Kafka “results” topic
• Result aggregator service reads from “results,” persists to DB & Knowledge Graph
• API Gateway pushes updates to UI (via WebSocket) and triggers browser extension notifications
• User feedback flows back as events for Continuous Learning
Architectural Patterns & Design Principles
• Microservices & Event-Driven Architecture via Apache Kafka
• Separation of Concerns: detection, NLP, graph generation, and API layers are independent
• Containerization: each service packaged in Docker for scalability
• Polyglot Persistence: relational DB + graph DB
• Asynchronous Processing for real-time throughput