A Next.js application that uses AI to fact-check claims and displays trending fake news debunked by the community.
- 🔍 AI-powered fact checking using Google Gemini
- 📊 Trending fake news dashboard
- 💾 Supabase database integration
- 🎨 Modern UI with Tailwind CSS
- Node.js 18+ installed
- A Supabase account and project
- A Google Gemini API key
```bash git clone cd factchecker1 npm install ```
- Create a new project at Supabase
- Go to Project Settings > API
- Copy your project URL and anon/public key
-
Copy the example environment file: ```bash cp .env.example .env.local ```
-
Fill in your environment variables in
.env.local:NEXT_PUBLIC_SUPABASE_URL: Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anon/public keyGEMINI_API_KEY: Your Google Gemini API key from Google AI Studio
Run the SQL script to create the necessary table:
```sql -- Run this in your Supabase SQL Editor CREATE TABLE IF NOT EXISTS fake_checks ( id UUID DEFAULT gen_random_uuid() PRIMARY KEY, claim TEXT NOT NULL, result TEXT NOT NULL, confidence INTEGER DEFAULT 0, is_fake BOOLEAN DEFAULT false, session_id TEXT, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() );
-- Create an index for better query performance CREATE INDEX IF NOT EXISTS idx_fake_checks_is_fake_created ON fake_checks(is_fake, created_at DESC); ```
Optionally, seed the database with sample data by running the script in scripts/seed-trending-fakes.sql.
```bash npm run dev ```
Open http://localhost:3000 to see the app.
``` factchecker1/ ├── app/ │ ├── api/ │ │ ├── fact-check/ # AI fact-checking endpoint │ │ └── trending-fakes/ # Trending fakes data endpoint │ ├── page.jsx # Main page │ └── layout.jsx # Root layout ├── components/ │ └── trending-fakes.jsx # Trending fakes component ├── lib/ │ └── supabase/ # Supabase client utilities ├── scripts/ │ └── seed-trending-fakes.sql # Database seed script └── .env.example # Environment variables template ```
- Push your code to GitHub
- Import your repository in Vercel
- Add your environment variables in the Vercel project settings
- Deploy!
Make sure to add these environment variables in your Vercel project settings:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYGEMINI_API_KEY
- Next.js 15 - React framework
- Supabase - Database and backend
- Google Gemini AI - Fact-checking AI
- Tailwind CSS - Styling
- Recharts - Data visualization
MIT