Skip to content

Repository files navigation

TruthCheck

Evidence-first fact-checking. Paste a claim, a URL, an image, or a document and get a sourced verdict (True / False / Misleading / Partly True / Unverified) with reasoning, supporting and contradicting evidence, and a list of sources you can export to PDF. Optionally run "AI or Original?" image detection via Hive.

Built with TanStack Start, React 19, Tailwind CSS, and shadcn/ui. Evidence retrieval is by Tavily; reasoning is by OpenAI.

How it works

  1. Extract a concise checkable claim from your input.
  2. Search the web for evidence with Tavily.
  3. Analyze the evidence with OpenAI and return a strict JSON verdict.
  4. Render the verdict card (and let you download a PDF report).

API calls are proxied through the app's own server routes (/api/openai, /api/tavily, /api/hive-detect), which inject the keys from server-side environment variables. The keys are never bundled into the client or exposed to the browser, so the app is safe to deploy publicly. No request data is stored.

Setup

Requires Bun (or npm/pnpm).

bun install
cp .env.example .env   # then add your keys
bun dev                # http://localhost:3000

API keys

You need a Tavily key and an OpenAI key. A Hive key is optional (only for the image AI-detection feature). Set them as server environment variables: copy .env.example to .env and fill in the values (locally), or set the same variables in your host's dashboard when deploying. They stay on the server and are used by the /api/* proxies — there is no in-app key entry, and the keys are never sent to the browser.

Variable Required Purpose
TAVILY_API_KEY yes Web search / evidence
OPENAI_API_KEY yes Reasoning over evidence
OPENAI_MODEL no Model name (default gpt-5.5)
HIVE_API_KEY no "AI or Original?" image detection

Security note: These variables have no VITE_ prefix, so they are not bundled into the client — the keys never reach the browser. All provider requests are made server-side by the /api/* routes. It is safe to deploy this app with real keys set in your host's environment.

Scripts

Command Description
bun dev Start the dev server
bun run build Production build
bun run preview Preview the production build
bun run lint Lint
bun run format Format with Prettier

Project layout

  • src/routes/ — pages (file-based routing) and the server proxies under /api/ (openai, tavily, hive-detect, and config).
  • src/components/ — UI (VerdictCard, PipelineStatus, plus the shadcn primitives in components/ui/).
  • src/lib/factcheck/ — the pipeline: tavily.ts, openai.ts, pipeline.ts, parseDocument.ts, detectAi.ts, exportPdf.ts, types.ts.
  • src/hooks/useApiKeys.ts — reports which keys the server has configured (via /api/config); it never handles key values.

About

AI-powered fact-checking & news verification tool. Verify claims, detect misinformation, and check sources with AI. Built with Bun + React + TypeScript.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages