Professional PDF Fact-Checking Application — Extract and verify claims from documents using AI-powered analysis and live web search.
FactCheck App is a full-stack application that:
- Accepts PDF uploads with intelligent drag-and-drop interface
- Extracts verifiable claims (statistics, dates, financial & technical figures) using advanced NLP
- Verifies claims against live web sources via multiple search APIs
- Provides verdicts per claim:
- ✅ Verified — Multiple reliable sources confirm the claim
⚠️ Inaccurate — Outdated or conflicting evidence found- ❌ False — No credible evidence found
- Frontend: React 19 + Vite + TypeScript
- Backend: Cloudflare Workers + Hono framework
- Search Engines:
- SearXNG (recommended - open source)
- Brave Search API (commercial alternative)
- Firecrawl API (web scraping fallback)
- PDF Processing: pdfjs-dist (client-side)
factcheck-app/
├── src/ # React frontend
│ ├── App.tsx # Main application component
│ ├── App.css # Styling
│ ├── lib/
│ │ ├── pdf.ts # PDF extraction logic
│ │ ├── types.ts # TypeScript interfaces
│ │ └── ...
│ ├── main.tsx
│ └── index.css
├── worker/ # Cloudflare Worker backend
│ ├── src/
│ │ ├── index.ts # Hono API server
│ │ └── lib/
│ │ ├── claim-extractor.ts
│ │ ├── verifier.ts
│ │ ├── brave.ts
│ │ ├── firecrawl.ts
│ │ └── searxng.ts
│ ├── wrangler.jsonc # Cloudflare config
│ └── package.json
├── package.json
├── vite.config.ts
└── README.md
- Node.js v20+ (Download)
- npm v10+ (comes with Node)
# Clone repository
git clone https://github.com/yourusername/factcheck-app.git
cd factcheck-app
# Install dependencies (root + worker)
npm installnpm run devThis starts both the frontend and worker concurrently:
- Frontend: http://localhost:5173
- Worker API: http://localhost:8787
# Terminal 1 - Frontend
npm run dev:web
# Terminal 2 - Backend Worker
npm run dev:workerCreate .env from .env.example:
cp .env.example .envSet your API endpoint:
VITE_API_BASE_URL=http://localhost:8787Edit worker/wrangler.jsonc to configure search provider:
"vars": {
"BRAVE_API_KEY": "your_brave_api_key"
}"vars": {
"FIRECRAWL_API_KEY": "your_firecrawl_key"
}Get free tier at firecrawl.dev
npm run buildOutputs:
dist/— Built frontend (ready for Cloudflare Pages)worker/dist/— Built worker code
npm testTests cover:
- Claim extraction accuracy
- Verdict scoring logic
- API integration
npm run lintcd worker
# Authenticate with Cloudflare
wrangler login
# Deploy
npm run deployNote your Worker URL (e.g., https://factcheck-api.your-account.workers.dev)
Option 1: CLI
npm run build
wrangler pages deploy dist/Option 2: GitHub Integration
- Push to GitHub
- Connect repository to Cloudflare Pages
- Set
VITE_API_BASE_URLenvironment variable - Pages auto-deploys on push
✅ Implemented:
- Input validation on all form fields
- CORS headers properly configured
- Environment variables for sensitive data
- Client-side PDF processing (no uploads to servers)
- TypeScript for type safety
- Rotate API keys regularly
- Use
.envfiles (never commit.envto git) - Enable Cloudflare DDoS protection
- Monitor worker logs for suspicious activity
See SECURITY.md for detailed security guidelines.
Request:
multipart/form-data
- pdf: File # PDF document
- extractedText: string # Pre-extracted text (optional)
Response:
{
"id": "uuid",
"results": [
{
"claim": {
"id": "unique_id",
"text": "Global AI market reached $150B in 2023",
"numbers": ["150"],
"years": ["2023"]
},
"verdict": "verified",
"confidence": 0.92,
"evidence": [
{
"title": "Global AI Market Report 2023",
"url": "https://example.com/ai-market",
"snippet": "The global artificial intelligence market...",
"matchedNumbers": ["150"]
}
]
}
],
"warning": null
}- PDF Processing: ~2-5s (client-side)
- Claim Extraction: ~3-8s (depends on document length)
- Verification: ~2-3s per claim (parallel)
- Total: Typically 10-20s for average PDF
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Areas for contribution:
- Additional search providers integration
- Improved claim extraction models
- UI/UX enhancements
- Documentation improvements
- Test coverage expansion
MIT License — see LICENSE file for details.
@PARASAGARWAL
Built with:
- Cloudflare Workers — Serverless compute
- Hono — Lightweight web framework
- React — UI library
- Vite — Frontend tooling
Last Updated: May 2026 | Status: Production Ready ✨