A modern fact-checking web application that analyzes claims using multiple sources to provide balanced, evidence-based assessments.
- Multi-source Analysis: Compare supporting and contradicting sources side-by-side
- Confidence Scoring: Get a 0-100 confidence score with detailed rationale
- Regional Context: Filter results by region (Global, EU, Finland, USA , Custom)
- Clean UI: Modern, responsive design with a green theme
- Example Claims: Quick-start with pre-loaded example claims
- Install dependencies:
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
Currently, Coral uses a deterministic stub provider that simulates fact-checking without making real API calls. This allows for:
- Deterministic Results: The same claim always produces the same results (based on claim hash)
- Realistic Latency: Simulates network delay (700-1200ms)
- Diverse Sources: Uses a pool of 30+ realistic sources across various domains
- Domain Diversity: Ensures no duplicate domains appear in results
- Smart Confidence: Calculates confidence based on claim specificity (numbers, dates, locations)
The stub provider:
- Hashes the input claim + region to create a deterministic seed
- Selects 3 supporting and 3 contradicting sources from a curated pool
- Calculates confidence based on:
- Claim specificity (presence of numbers, dates, locations)
- Support/contradict ratio
- Penalties for underspecified claims
- Generates rationale bullets explaining the confidence score
- Returns results with realistic structure matching the expected API format
The app is built with a provider pattern that makes it easy to swap the stub with real API calls:
lib/provider.ts: Defines theClaimCheckProviderinterfacelib/stubProvider.ts: Implements the stub (current)lib/types.ts: Zod schemas and TypeScript typeslib/utils.ts: Utility functions (hashing, formatting, etc.)
To integrate a real API, simply:
- Create a new provider class implementing
ClaimCheckProvider - Replace
StubClaimCheckProviderwith your real provider inapp/page.tsx
├── app/
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Main page component
│ └── globals.css # Global styles
├── components/
│ ├── ClaimForm.tsx # Input form component
│ ├── ResultsSummary.tsx # Confidence score & rationale
│ ├── SourceColumn.tsx # Column wrapper for sources
│ ├── SourceCard.tsx # Individual source card
│ └── SkeletonResults.tsx # Loading skeleton
├── lib/
│ ├── types.ts # Zod schemas & TypeScript types
│ ├── provider.ts # Provider interface
│ ├── stubProvider.ts # Stub implementation
│ └── utils.ts # Utility functions
└── package.json
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Zod (validation)
- Client-side only (no backend)
The codebase includes TODO comments for future improvements:
- Replace stub provider with real retrieval (OWI / search API)
- Add server route
/api/check(optional) - Add citation extraction and quote highlighting
- Add filters (date range, language)
- Add export to JSON / shareable link
MIT