""" app_demo.py — Hugging Face Spaces interactive demo. A standalone FastAPI app that provides: 1. The production WebSocket backend (from main.py) 2. A beautiful HTML/JS demo dashboard at /demo — Live claim submission with animated results — WebSocket connection indicator — Color-coded verdict cards with confidence arcs — No browser extension required to test Mount order: /demo static HTML, /ws WebSocket, all other routes from main.py """ from __future__ import annotations import os from fastapi import FastAPI from fastapi.responses import HTMLResponse from fastapi.middleware.cors import CORSMiddleware # Re-export the main app with the demo page bolted on from main import app as fact_app # Inject the demo route @fact_app.get("/demo", response_class=HTMLResponse, include_in_schema=False) async def demo_page(): return HTMLResponse(DEMO_HTML) @fact_app.get("/favicon.ico", include_in_schema=False) async def favicon(): from fastapi.responses import Response # 1x1 transparent gif return Response( content=b"GIF89a\x01\x00\x01\x00\x00\xff\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x00;", media_type="image/gif", ) DEMO_HTML = r""" ⚡ Fact & Hallucination Intelligence Engine

Fact & Hallucination Intelligence Engine

Real-time claim verification across Twitter/X, Instagram, YouTube, and AI chat interfaces. Powered by Groq · BGE-M3 · Qdrant · Memgraph.

Connecting… ·
0
Analyzed
0
Flagged
0
Cached
Avg ms
Verified
Widely corroborated
Unverified
Breaking / contested
Misleading
Debunked / false
AI Hallucination
Fabricated / impossible
Enter a claim to analyze
Try:
""" # This module is imported by Dockerfile CMD via main.py # For Hugging Face, rename this file to main.py or import it as the entry point.