AI-powered news verification platform that combats misinformation by auditing claims and media against trusted sources, detecting bias, and revealing the underlying truth.
TruthLens leverages AI to verify news claims and media content with contextual intelligence. It cross-references information against a curated "Golden List" of trusted sources, analyzes sentiment bias, and presents balanced perspectives to help users make informed decisions.
Rather than simple fact-checking, TruthLens provides structured truth analysis with source-backed reasoning.
- Enter a Claim - Type a news claim or paste a screenshot
- AI Verification - The system analyzes your input against trusted sources
- Get Results - View verdict, certainty score, bias analysis, and supporting sources
- Save History - Logged-in users can store and revisit past verifications
- News Verification - Cross-check claims with reliable sources
- Media Verification - Analyze images and screenshots for manipulation
- Bias Detection - Identify sentiment and narrative bias
- Source Analysis - Evaluate credibility and reliability of sources
- Alternative Perspectives - Compare consensus vs differing viewpoints
- User Authentication - Secure signup, login, and session handling
- Search History
- Logged-in users: Stored permanently in database
- Guest users: Stored temporarily in localStorage
- Demo Mode - Explore features without AI API integration
- Dark/Light Mode - Seamless theme switching
- Responsive Design - Optimized for desktop, tablet, and mobile
- Smooth Animations - Clean transitions and interactions
- Modern Interface - Minimal and intuitive design
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, TypeScript |
| Styling | Tailwind CSS |
| Backend | Next.js API Routes |
| Database | PostgreSQL with Prisma ORM |
| Auth | NextAuth.js (Credentials Provider) |
| Icons | Lucide React |
| Charts | Recharts |
- Node.js 18+ installed
- A PostgreSQL database (local or cloud)
git clone <repository-url>
cd truthlensnpm installCreate a free PostgreSQL database on https://neon.tech:
- Sign up with GitHub
- Create a new project
- Copy the connection string
Update your .env file:
DATABASE_URL="postgresql://your-username:your-password@your-host/database?sslmode=require"
NEXTAUTH_SECRET="generate-with-openssl-rand-base64-32"
NEXTAUTH_URL="http://localhost:3000"Generate a secret key:
openssl rand -base64 32npx prisma db push
npx prisma generatenpm run devtruthlens/
βββ app/
β βββ api/
β β βββ auth/
β β β βββ [...nextauth]/route.ts
β β β βββ register/route.ts
β β βββ history/route.ts
β βββ components/
β β βββ Providers.tsx
β β βββ BiasMeter.tsx
β β βββ VerificationCharts.tsx
β β βββ TrendChart.tsx
β β βββ ExampleQueryCards.tsx
β βββ dashboard/
β β βββ page.tsx
β βββ history/
β β βββ page.tsx
β βββ login/
β β βββ page.tsx
β βββ signup/
β β βββ page.tsx
β βββ page.tsx
β βββ layout.tsx
β βββ globals.css
βββ lib/
β βββ prisma.ts
β βββ auth.ts
βββ prisma/
β βββ schema.prisma
βββ .env
| Route | Description |
|---|---|
/ |
Landing page with features and CTA |
/dashboard |
Main verification interface |
/login |
User login page |
/signup |
User registration page |
/history |
View saved search history |
| Endpoint | Method | Description |
|---|---|---|
/api/auth/[...nextauth] |
GET, POST | NextAuth handlers |
/api/auth/register |
POST | Create new user |
| Endpoint | Method | Description |
|---|---|---|
/api/history |
GET | Get user's search history |
/api/history |
POST | Save search to history |
/api/history |
DELETE | Delete a search |
git add .
git commit -m "update readme"
git push origin main-
Go to https://vercel.com
-
Import your repository
-
Add environment variables:
- DATABASE_URL
- NEXTAUTH_SECRET
- NEXTAUTH_URL
Vercel will automatically build and deploy your app.
After first deployment:
npx prisma db pushThe dashboard includes Demo Cards for testing without AI API:
- Verified Claim
- Misleading Claim
- Fake News
Click any demo card to preview system output and UI behavior.
| Variable | Description | Required |
|---|---|---|
| DATABASE_URL | PostgreSQL connection string | Yes |
| NEXTAUTH_SECRET | Secret for NextAuth | Yes |
| NEXTAUTH_URL | App URL (dev or production) | Yes |
Contributions are welcome. Feel free to open issues or submit pull requests.
MIT