This documentation will guide you through setting up and running the MedBuster application, which consists of a React frontend and a FastAPI backend.
MedBuster is a claim verification platform designed to combat misinformation by providing AI-powered verification for claims from videos, text, and images. The application features:
- Video URL verification
- Text claim verification
- Image deepfake detection
- Dark/light theme support
- Progressive verification status feedback
- Python 3.10.6
- Node.js 14+
- npm 6+
The project is divided into two main components:
- Backend: A FastAPI application that handles the verification logic, including video downloading, transcription, claim extraction, and verification.
- Frontend: A React application that provides a user interface for submitting claims and displaying verification results.
- Clone the repository:
git clone https://github.com/yourusername/verifyai.git
cd verifyai/backend- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtThe backend is run using Uvicorn:
uvicorn main:app --reload --host 0.0.0.0 --port 8000This will start the backend server at http://localhost:8000.
GET /: Check if the API is runningPOST /verify-video: Submit a video URL for verificationPOST /verify-claim: Submit a text claim for verificationGET /verification-status: Check the status of an ongoing verificationPOST /api/detect-deepfake/: Upload an image to detect if it's a deepfake
- Navigate to the frontend directory:
cd verifyai/frontend- Install dependencies:
npm installStart the development server:
npm startThis will start the frontend application at http://localhost:3000.
The frontend consists of the following main components:
LandingPage.js: The main entry point of the applicationVerificationForm.js: Handles user input for different verification methodsGradientBackground.js: Creates a dynamic background effect
ResultCard.js: Displays verification resultsLoadingIndicator.js: Shows loading state during verificationProgressIndicator.js: Shows detailed verification progressImageUploader.js: Component for uploading images for deepfake detectionStampAnimation.js/SvgStampAnimation.js: Animations for verification results
The application supports both light and dark themes. Theme can be toggled using the button in the top-right corner of the UI.
// Example from LandingPage.js
const toggleTheme = () => {
const newTheme = theme === 'light' ? 'dark' : 'light';
setTheme(newTheme);
document.documentElement.className = newTheme;
};- Submit Claim: Users can submit claims via video URLs, direct text, or images.
- Processing: The backend processes the claim through several steps:
- For videos: Download video → Extract audio → Transcribe audio → Extract claims → Verify claims
- For text claims: Direct verification
- For images: Deepfake detection using Vision Transformer (ViT) model
- Results: Results are displayed with visual indicators and detailed information.
- Use the fetch API or axios for making requests to the backend
- Example API call:
const checkVerificationStatus = async () => {
try {
const response = await fetch('/verification-status');
if (!response.ok) throw new Error('Error checking status');
return await response.json();
} catch (error) {
console.error('Error:', error);
throw error;
}
};- FastAPI Documentation: https://fastapi.tiangolo.com/
- React Documentation: https://reactjs.org/docs/
- Framer Motion: https://www.framer.com/motion/