FactDrop is an AI-powered fact-checking engine designed to make claim verification faster, more accessible, and more scalable. Instead of relying solely on manual fact-checking workflows, FactDrop combines large language models, web intelligence, fact-check databases, and source credibility analysis to automate much of the verification process.
- Framework: Next.js 16, React 19, TypeScript 6
- AI: Vercel AI SDK, Anthropic, OpenAI, Google, xAI, Vercel AI Gateway, MCP
- API and data: tRPC, TanStack Query, Drizzle ORM, PostgreSQL, Zod
- Auth and UI: Better Auth, Tailwind CSS, Radix UI, Zustand, next-intl
- Search and media: Tavily, Exa, Firecrawl, Parallel, Vercel Blob, Cloudinary
- Editing and visualization: Lexical, CodeMirror, Recharts, ECharts
- Tooling and observability: Ultracite, Playwright, Vitest, Evalite, Langfuse, OpenTelemetry, Pino
pnpm install
cp .env.example .env.local
pnpm check-env
pnpm db:migrate
pnpm devDev server runs at http://localhost:3000.
Dev login shortcut (development only): GET /api/dev-login
pnpm dev # Start dev server (runs check-env + DB branch resolution first)
pnpm lint # Biome via ultracite
pnpm format # Biome format (auto-fix)
pnpm test:unit # Vitest only (needs local Postgres)
pnpm test:e2e # Playwright only (uses .env.local)
pnpm test # E2E + unit
pnpm test:types # Next typegen + full type-check
pnpm build # Production build (prebuild runs check-env)
pnpm check-env # Validate required env varschat.config.ts is the single source of truth for feature switches and model/gateway behavior.
Flow:
chat.config.ts -> lib/config-schema.ts -> lib/config.ts
Use this to configure:
- Gateway selection
- Enabled models and defaults
- Tool toggles (MCP, search, URL fetch, code execution, docs, research)
- Credit and rate-limit behavior
- Schema:
lib/db/schema.ts - Migrations:
lib/db/migrations/ - Production migration runner:
lib/db/migrate.ts(runs whenVERCEL_ENV=production) - Database connection: set
DATABASE_URLto your PostgreSQL instance
- Most product routes live under
app/workspace/* - Legacy route aliases redirect to workspace routes via
next.config.ts lib/db/queries.tsis server-only- tRPC root router:
trpc/routers/_app.ts - Prefer
protectedProcedurefor authenticated endpoints - Lazy prefetch pattern: call
prefetchQuery(withoutawait) in Server Components and hydrate on client
flowchart TD
A([User Query]) --> B{Image attached?}
B -- Yes --> C[Extract claim from image<br>OCR or describe via vision model]
B -- No --> D[Split into claims<br>LLM claim-splitter]
C --> D
D --> E{Single or multi?}
E -- Single --> F[Run pipeline once]
E -- Multi --> G[Run pipeline per sub-claim<br>in parallel via same pipeline]
F --> H
G --> H
subgraph PIPE [Per-claim pipeline]
H{Bangla?} -- Yes --> I[Translate to English<br>Add English query]
H -- No --> J[Run in parallel via Promise.all]
I --> J
J --> K[Web search<br>Tavily + Exa + Parallel + MCP<br>Concurrent and merged]
J --> L[Google Fact Check API]
K --> M{Results empty?}
M -- Yes --> N[Firecrawl fallback search]
M -- No --> O[Trust-rank sources<br>SourceCheck MCP: IFFY + IFCN + GDI + internal rules]
N --> O
O --> P[LLM final verdict<br>Rating + note]
L --> P
end
P --> Q([Output<br>Rating, note, ranked sources])
- Unit tests:
pnpm test:unit(Vitest) - E2E tests:
pnpm test:e2e(Playwright projects:chat,reasoning,artifacts,dashboard) - Types:
pnpm test:types
Use pnpm only.
Apache-2.0

