About the Project - Fake News Detector
🌟 What Inspired Us
The inspiration for this project came from witnessing the alarming rise of misinformation that has been terrorizing people and leaving them uninformed, both politically and socially. We observed how false information spreads faster than wildfire on social media, creating confusion, fear, and division in our communities.
The Growing Problem
- Misinformation spreads 6x faster than true information on social platforms
- People struggle to distinguish between credible news and fabricated stories
- Political disinformation influences democratic processes and public opinion
- Health misinformation puts lives at risk during critical moments like pandemics
- Financial fake news manipulates markets and investment decisions
- Social fragmentation occurs when people lose trust in reliable information sources
We realized that people need accessible, intelligent tools to verify information before sharing it, helping them make informed decisions and combat the spread of misinformation.
🎯 What We Learned
Building this project was an incredible learning journey that expanded our knowledge across multiple domains:
Technical Learnings
- Advanced API Integration: Mastered Perplexity's Sonar API, learning to optimize prompts for different use cases
- Dual-Mode Architecture: Developed expertise in creating systems that intelligently choose between fast and comprehensive analysis
- OCR Implementation: Deep-dived into text extraction from images using multiple engines and consensus algorithms
- Real-time Processing: Implemented caching, rate limiting, and graceful degradation patterns
- Modern React Patterns: Leveraged Next.js 15, TypeScript, and advanced animation libraries
AI & Fact-Checking Insights
- Prompt Engineering: Learned how different prompt structures affect AI response quality and speed
- Truth Sandwiching Detection: Understood how sophisticated misinformation mixes facts with lies
- Source Verification: Implemented systems to validate and rank information sources
- Bias Recognition: Developed patterns to identify emotional manipulation and fear-mongering
User Experience Design
- Accessibility: Created interfaces that make complex AI analysis understandable for everyone
- Progressive Enhancement: Built systems that work with or without API keys
- Information Architecture: Designed clear result presentation with actionable recommendations
🏗️ How We Built the Project
Phase 1: Foundation & Research
# Initial setup with modern stack
- Next.js 15 + TypeScript for robust development
- Tailwind CSS + Radix UI for beautiful, accessible components
- Framer Motion for smooth animations and micro-interactions
Phase 2: Core Analysis Engine
- Local Pattern Detection: Built algorithms to identify suspicious language patterns
- Claims Extraction: Developed systems to parse factual, statistical, and causal claims
- Risk Assessment: Created scoring mechanisms for credibility evaluation
Phase 3: Perplexity Integration
// Dual-mode Sonar implementation
const quickAnalysis = await sonar.quickVerification(content) // Sonar-pro
const deepAnalysis = await sonar.verifyNewsClaim(content) // Sonar-reasoning-pro
Phase 4: Advanced Features
- Smart OCR System: Multi-engine text extraction with intelligent consensus
- Dynamic UI: Context-aware interface that adapts based on API availability
- Performance Optimization: Caching, rate limiting, and error handling
Phase 5: Polish & Testing
- User Testing: Validated with diverse news samples and user feedback
- Documentation: Created comprehensive guides for judges and users
- Deployment: Optimized for production with zero-downtime deployment
💪 Challenges We Faced
🔧 Technical Challenges
1. API Response Quality
Problem: Initially, the Perplexity API was returning basic, generic responses that weren't detailed enough for credible fact-checking.
Solution:
- Developed sophisticated prompt engineering with specific instructions
- Created dual-mode architecture using both Sonar-pro and Sonar-reasoning-pro
- Implemented intelligent JSON parsing with fallback mechanisms
- Added source verification and section-by-section analysis
// Before: Generic prompt
"Is this news true or false?"
// After: Comprehensive fact-checking prompt
`You are an expert fact-checker. Analyze this content and provide:
1. Credibility score (0-100)
2. Specific source verification
3. Section-by-section truth analysis
4. Historical context and implications...`
2. OCR Implementation Nightmare
Problem: OCR integration in Next.js was incredibly challenging due to:
- Browser compatibility issues with Tesseract.js
- Performance problems with large images
- Accuracy issues producing fragmented, garbage text
- Memory leaks in client-side processing
Solution:
- Built a smart consensus system using multiple OCR engines
- Implemented image preprocessing for better text extraction
- Created intelligent text cleaning that removes garbage while preserving important data
- Added progressive enhancement with fallback mechanisms
// Smart OCR with consensus
const ocrResults = await Promise.all([
tesseractOCR(image),
ocrSpaceAPI(image),
customOCR(image)
]);
const cleanText = buildConsensus(ocrResults); // Keep text that appears in 2+ engines
3. State Management Complexity
Problem: Managing complex application state with multiple analysis modes, API keys, OCR processing, and real-time updates.
Solution:
- Implemented careful React state management with proper useCallback dependencies
- Created centralized error handling for all async operations
- Built progressive loading states for better user experience
4. Performance Optimization
Problem: Initial response times were too slow for good user experience.
Solution:
- Added intelligent caching for repeated analyses
- Implemented rate limiting to prevent API abuse
- Created background processing for long-running operations
- Optimized bundle size and code splitting
🎨 Design & UX Challenges
1. Complex Information Presentation
Challenge: How to present complex AI analysis results in an understandable way.
Solution:
- Created tabbed interface with clear sections (Recommendations, Analysis, Context, etc.)
- Implemented progressive disclosure showing details on demand
- Added visual indicators (colors, icons, progress bars) for quick understanding
- Built responsive design that works on all devices
2. Trust & Transparency
Challenge: Users need to trust the AI analysis results.
Solution:
- Source transparency: Always show clickable links to verification sources
- Process explanation: Clear indication of which AI model is being used
- Confidence scoring: Honest assessment of analysis reliability
- Educational content: Teach users how to verify information manually
🚀 Integration & Deployment Challenges
1. Environment Configuration
Challenge: Making the app work for judges/testers without complex setup.
Solution:
- Built in-app API key field for easy testing
- Created graceful degradation that works without environment configuration
- Added clear instructions and direct links to obtain API keys
2. Error Handling
Challenge: Robust error handling across multiple API integrations.
Solution:
- Implemented comprehensive try-catch blocks with specific error messages
- Created intelligent fallback systems for API failures
- Added user-friendly error messages instead of technical jargon
🏆 What We're Proud Of
Innovation
- First-of-its-kind dual-mode Sonar implementation optimizing for both speed and depth
- Sophisticated truth sandwiching detection for mixed-content misinformation
- Smart OCR consensus system that dramatically improves text extraction accuracy
Social Impact
- Democratized fact-checking - anyone can now verify news in seconds
- Educational component - users learn to identify fake news patterns
- Accessibility focus - complex AI analysis made simple for everyone
Technical Excellence
- Production-ready architecture with comprehensive error handling
- Performance optimization with sub-2-second response times
- Modern development practices with TypeScript, proper testing, and documentation
🔮 Future Vision
This project represents just the beginning. We envision:
- Browser extension for real-time web content verification
- Mobile apps for on-the-go fact-checking
- API for developers to integrate into other platforms
- Educational partnerships with schools and media literacy programs
- Multi-language support for global misinformation combat
💝 Acknowledgments
Special thanks to:
- My wife - Cynthia Caldas, for all her support and patience.
- My children - Miguel, Daniel and Priscila.
- Perplexity team for creating the innovative Sonar API that makes real-time fact-checking possible
- Hackathon organizers for providing this incredible opportunity to build for social good
- Open source community for the amazing tools and libraries that made this project possible
- Beta testers who provided valuable feedback during development
"In an age of information overload, truth is our most valuable currency. This project is our contribution to preserving it."
Built with ❤️ for the Perplexity Hackathon 2025
Built With
- css
- framer
- next.js
- node.js
- perplexityapi
- radix
- tailwind
- tesseract.js
- typescript
- ui

Log in or sign up for Devpost to join the conversation.