Tagline: Let's Make Difference Between Fact and Fiction
A comprehensive web application for fact-checking multimedia content (video, audio, image) using Google Cloud Services and Gemini 2.5 Flash with Search Grounding.
- Multi-format Support: Upload and analyze videos, audio files, and images
- Speech-to-Text: Automatic audio extraction from videos and transcription using Google Cloud Speech-to-Text
- AI-Powered Fact-Checking: Leverages Gemini 2.5 Flash with Google Search Grounding for accurate verification
- Citation & Evidence: Displays sources and citations for fact-check results
- User History: Track all your past fact-checks with admin comments
- Admin Dashboard: Complete oversight of all users and fact-checks with commenting functionality
- Role-Based Access: Separate user and admin interfaces
fact-checker/
βββ .env # Environment variables
βββ gcp-credentials.json # Google Cloud credentials (not included)
βββ package.json # Root package scripts
βββ README.md # This file
βββ Project_Plan.md # Detailed project plan
β
βββ Data/ # CSV database and uploads
β βββ users.csv
β βββ fact_checks.csv
β βββ admin_comments.csv
β βββ uploads/
β βββ videos/
β βββ audio/
β βββ images/
β
βββ backend/ # FastAPI backend
β βββ main.py
β βββ requirements.txt
β βββ config/
β βββ models/
β βββ routes/
β βββ services/
β βββ utils/
β βββ middleware/
β
βββ frontend/ # React + TypeScript + Vite
βββ index.html
βββ package.json
βββ vite.config.ts
βββ tsconfig.json
βββ src/
βββ main.tsx
βββ App.tsx
βββ components/
βββ pages/
βββ context/
βββ services/
βββ types/
βββ utils/
βββ hooks/
- Python 3.8+
- Node.js 18+
- FFmpeg (for video processing)
- Google Cloud Account with Speech-to-Text API enabled
- Gemini API Key from Google AI Studio
-
Clone the repository
git clone <repository-url> cd Fact_Checker
-
Set up environment variables
Copy the
.envfile and fill in your API keys:# Edit .env file with your credentials GEMINI_API_KEY=your_gemini_api_key_here GCP_PROJECT_ID=your_gcp_project_id GCP_CREDENTIALS_PATH=./gcp-credentials.json JWT_SECRET_KEY=your_secret_key_here -
Download GCP Service Account JSON
- Go to Google Cloud Console
- Create a service account with Speech-to-Text API access
- Download the JSON key file
- Save it as
gcp-credentials.jsonin the root directory
-
Install dependencies
# Install backend dependencies cd backend pip install -r requirements.txt # Install frontend dependencies cd ../frontend npm install # Or install all at once from root cd .. npm install npm run install:all
-
Install FFmpeg (if not already installed)
- Ubuntu/Debian:
sudo apt-get install ffmpeg - macOS:
brew install ffmpeg - Windows: Download from ffmpeg.org
- Ubuntu/Debian:
Option 1: Run both servers concurrently (recommended)
npm run devOption 2: Run servers separately
# Terminal 1 - Backend
npm run dev:backend
# or
cd backend && python main.py
# Terminal 2 - Frontend
npm run dev:frontend
# or
cd frontend && npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/api/docs
# Build frontend
npm run build:frontend
# Start backend
npm run start:backend
# Start frontend preview
npm run start:frontend- Email: admin@factchecker.com
- Password: admin123
- Role: Admin
Users can register through the login page or be added directly to Data/users.csv.
-
Login
- Navigate to http://localhost:5173
- Enter your email and password
- Select "User" role
- Click Login
-
Upload Content
- Select content type (Video, Audio, or Image)
- Drag & drop or browse to select file
- Click "Upload and Fact Check"
-
View Results
- See extracted text (for video/audio)
- Read AI-powered fact-check analysis
- Explore citations and sources
- View admin comments if available
-
Check History
- Navigate to History page
- View all past fact-checks
- Click on any item to see full details
-
Login as Admin
- Use admin credentials
- Select "Admin" role
-
View All Users
- See all registered users
- Click on a user to view their fact-checks
-
Review Fact-Checks
- Browse through user submissions
- Read detailed analysis and results
-
Add Comments
- Open any fact-check
- Add administrative comments
- Users can see these comments in their history
# API Keys
GEMINI_API_KEY=your_key_here
GCP_PROJECT_ID=your_project_id
GCP_CREDENTIALS_PATH=./gcp-credentials.json
# JWT Settings
JWT_SECRET_KEY=your_secret_key
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=1440
# Server Ports
BACKEND_PORT=8000
FRONTEND_PORT=5173
# CORS
CORS_ORIGINS=http://localhost:5173,http://localhost:3000
# File Upload Limits
MAX_FILE_SIZE_MB=100VITE_API_BASE_URL=http://localhost:8000- FastAPI: Modern Python web framework
- Google Cloud Speech-to-Text: Audio transcription
- Gemini 2.5 Flash: AI-powered fact-checking with Search Grounding
- FFmpeg: Video/audio processing
- Pandas: CSV database operations
- JWT: Authentication
- React 18: UI framework
- TypeScript: Type-safe JavaScript
- Vite: Fast build tool
- React Router: Navigation
- Axios: HTTP client
- Context API: State management
- CSV Files: Lightweight database
- Local File System: Media storage
Once the backend is running, visit http://localhost:8000/api/docs for interactive API documentation (Swagger UI).
POST /api/auth/login- User/Admin loginPOST /api/auth/register- User registrationPOST /api/auth/logout- Logout
POST /api/upload/video- Upload video filePOST /api/upload/audio- Upload audio filePOST /api/upload/image- Upload image file
POST /api/fact-check/process- Process uploaded fileGET /api/fact-check/result/{id}- Get fact-check result
GET /api/history/user- Get current user's historyGET /api/history/details/{id}- Get specific fact-check details
GET /api/admin/users- Get all users (admin only)GET /api/admin/fact-checks- Get all fact-checks (admin only)POST /api/admin/comment- Add comment to fact-checkGET /api/admin/comments/{id}- Get comments for fact-check
- JWT-based authentication
- Role-based access control
- Password hashing with bcrypt
- File upload validation
- CORS protection
- Input sanitization
-
FFmpeg not found
- Install FFmpeg: See installation instructions above
- Verify installation:
ffmpeg -version
-
GCP Authentication Error
- Ensure
gcp-credentials.jsonis in the root directory - Verify service account has Speech-to-Text API access
- Check
GCP_CREDENTIALS_PATHin.env
- Ensure
-
Gemini API Error
- Verify
GEMINI_API_KEYis correct - Check API quota and limits
- Ensure you're using Gemini 2.0 Flash Exp or compatible model
- Verify
-
Port Already in Use
- Change ports in
.envfile - Kill existing processes using the ports
- Change ports in
-
CORS Errors
- Update
CORS_ORIGINSin.env - Ensure frontend URL is in the allowed origins
- Update
- CSV files serve as a simple database for development
- For production, consider migrating to PostgreSQL or MongoDB
- File uploads are stored locally; consider cloud storage for production
- Default admin password should be changed in production
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - feel free to use this project for learning and development.
For issues, questions, or suggestions:
- Check the API documentation at
/api/docs - Review
Project_Plan.mdfor detailed architecture - Open an issue on GitHub
- Google Cloud Platform for Speech-to-Text API
- Google AI Studio for Gemini API
- FastAPI and React communities
- All open-source contributors
Built with β€οΈ for truth and accuracy