🚀 TRANSFORM: LeakHub → InfoValidator - Universal Information Validation Platform

This commit is contained in:
EP
2025-08-23 10:09:11 -07:00
parent 3c4184ae78
commit ead8d193e8
2 changed files with 275 additions and 396 deletions
+150 -182
View File
@@ -2,80 +2,55 @@
**The Universal Platform for Crowd-Sourced Information Verification**
A community-driven web platform where multiple humans can submit information claims, and we use both human consensus AND AI validation to verify accuracy. From AI system prompts to code algorithms, from data facts to documents - if it can be verified, it belongs here!
A community-driven web platform for discovering, submitting, verifying, and analyzing any type of information claim. From AI system prompts to code algorithms, data facts to documents - if it can be verified, it belongs here!
## 🌟 What is InfoValidator?
## 🌟 Vision
InfoValidator is a revolutionary platform that combines **human intelligence** with **AI analysis** to create a robust system for verifying all types of information:
**Humans + AI = Truth!** InfoValidator combines the power of human intelligence with AI analysis to create the most comprehensive information verification platform ever built.
- **🤖 AI System Prompts** - Verify system prompts from ChatGPT, Claude, Gemini, and more
- **💻 Code & Algorithms** - Validate code snippets, algorithms, and technical implementations
- **📊 Data & Facts** - Verify statistics, numbers, and factual information
- **📄 Documents & Text** - Validate official documents, quotes, and textual content
- **🖼️ Images & Visuals** - Verify visual information and media content
- **🎵 Audio & Video** - Validate audio/video content and transcriptions
- **🔌 APIs & Endpoints** - Verify API documentation and technical specifications
- **🛠️ Custom Claims** - Any other type of information that needs verification
## 🚀 Features
## 🚀 Key Features
### Core Functionality
- **📤 Universal Submission System**: Submit any type of information claim (AI prompts, code, data, documents, images, APIs, etc.)
- **🔍 Advanced Comparison Engine**: Compare multiple claims with AI-powered similarity analysis
- **✅ Community Verification**: Crowd-sourced validation with confidence scoring
- **🏆 Gamification**: Points, achievements, and leaderboards to encourage participation
### 🔍 **Multi-Modal Validation**
- **Human Consensus**: Multiple validators can submit the same information
- **AI Analysis**: Advanced similarity detection and pattern recognition
- **Hybrid Verification**: Combines human judgment with AI insights
### Information Categories
- **🤖 AI System Prompts**: Discover and verify AI model system instructions
- **💻 Code/Algorithms**: Verify code snippets, algorithms, and technical implementations
- **📊 Data/Facts**: Validate datasets, statistics, and factual information
- **📄 Documents/Text**: Verify official documents, texts, and written content
- **🖼️ Images/Visual**: Validate visual content and image-based claims
- **🎵 Audio/Video**: Verify multimedia content and audio/video claims
- **🔌 APIs/Endpoints**: Validate API specifications and endpoint information
- **🛠️ Custom Claims**: Submit any other type of verifiable information
### 🏆 **Gamified Community**
- **Leaderboard System**: Track top validators and their contributions
- **Achievement System**: Unlock badges for different types of validations
- **Points & Rewards**: Earn points for submissions, verifications, and discoveries
- **Daily Challenges**: Compete in themed validation challenges
### Community Features
- **💬 Real-time Chat**: Collaborate with other validators in live chat
- **🎯 Daily Challenges**: Complete verification challenges for bonus rewards
- **💰 Bounty System**: Request specific information validation with point rewards
- **📈 Analytics Dashboard**: Track platform statistics and growth trends
- **👤 User Profiles**: Detailed validator profiles with achievements and stats
### 🤖 **Advanced AI Analysis**
- **Semantic Similarity**: Jaccard similarity for meaning-based comparison
- **Structural Analysis**: Line count, formatting, and organization comparison
- **Pattern Detection**: Sliding window algorithm for common phrase identification
- **Keyword Overlap**: AI-related and domain-specific term analysis
- **Confidence Scoring**: AI-powered confidence meters for verification
### Technical Features
- **🔒 Security**: XSS protection, security headers, and data sanitization
- **📱 Responsive Design**: Works perfectly on desktop, tablet, and mobile
- **⚡ Performance**: Optimized for speed with modern web technologies
- **🔄 Auto-save**: Never lose your work with automatic data saving
- **📤 Export/Import**: Backup and restore your data easily
### 💬 **Real-Time Collaboration**
- **Live Chat System**: Discuss validations and share insights
- **Community Features**: Vote on requests, share verification methods
- **Bounty System**: Request specific information validations with rewards
## 🛠️ Tech Stack
### 📊 **Comprehensive Analytics**
- **Platform Statistics**: Track growth, engagement, and verification rates
- **Category Distribution**: See what types of information are most validated
- **Growth Trends**: Monitor platform adoption and usage patterns
- **Top Contributors**: Recognize the most active and accurate validators
## 🛠️ Technical Stack
### **Frontend**
- **HTML5** - Semantic markup and accessibility
- **CSS3** - Modern styling with cyberpunk aesthetic
- **JavaScript (ES6+)** - Interactive features and real-time updates
- **Vite** - Fast development server and optimized builds
### **Data Management**
- **LocalStorage** - Client-side data persistence
- **Database Abstraction** - Ready for backend integration (MongoDB, Supabase, Firebase)
- **Export/Import** - Full data backup and restore functionality
### **Deployment**
- **GitHub Pages** - Free hosting with automated deployment
- **Vercel/Netlify** - Serverless deployment options
- **CI/CD** - Automated build and deployment pipeline
- **Frontend**: HTML5, CSS3, JavaScript (ES6+)
- **Build Tool**: Vite (for development and production builds)
- **Data Storage**: LocalStorage with database abstraction layer
- **Deployment**: GitHub Pages, Vercel, Netlify ready
- **Security**: Comprehensive security headers and XSS protection
## 🚀 Quick Start
### **For Users**
1. **Visit**: `https://elder-plinius.github.io/LEAKHUB/`
2. **Load Demo Data**: Click the "🧪 Load Demo" button to see examples
3. **Submit Claims**: Use the form to submit information for validation
4. **Compare Claims**: Use the comparison tools to verify accuracy
5. **Join Community**: Participate in challenges and discussions
### **For Developers**
### Development
```bash
# Clone the repository
git clone https://github.com/elder-plinius/LEAKHUB.git
@@ -87,166 +62,159 @@ npm install
# Start development server
npm run dev
# Open http://localhost:3000/LEAKHUB/
```
### Production
```bash
# Build for production
npm run build
# Deploy to GitHub Pages
npm run deploy
# Preview production build
npm run preview
```
## 📋 Information Categories
## 📊 Platform Statistics
### **🤖 AI System Prompts**
- ChatGPT, Claude, Gemini, and other AI models
- System instructions and behavioral guidelines
- Tool-specific prompts and function calls
### **💻 Code & Algorithms**
- Programming algorithms and implementations
- Open source code snippets and functions
- Technical specifications and APIs
### **📊 Data & Facts**
- Statistics and numerical data
- Factual information and research findings
- Public records and official data
### **📄 Documents & Text**
- Official documents and legal texts
- Quotes and attributed statements
- Academic papers and research documents
### **🖼️ Images & Visuals**
- Screenshots and visual evidence
- Charts, graphs, and data visualizations
- Media content and digital assets
### **🎵 Audio & Video**
- Audio transcriptions and captions
- Video content and streaming data
- Media metadata and technical specifications
### **🔌 APIs & Endpoints**
- API documentation and specifications
- Rate limits and authentication methods
- Technical endpoints and data formats
- **Active Claims**: Real-time count of submitted information claims
- **Total Submissions**: Total number of claims submitted to the platform
- **Verified Claims**: Number of claims with high confidence scores
- **Active Validators**: Number of users actively participating
## 🎯 Use Cases
### **For Researchers**
- Verify AI system behaviors and capabilities
- Validate technical documentation and specifications
- Cross-reference information across multiple sources
### For Researchers
- Verify AI system prompts and model behaviors
- Validate technical implementations and algorithms
- Cross-reference data sources and factual claims
### **For Developers**
- Verify code implementations and algorithms
- Validate API documentation and endpoints
- Check technical specifications and requirements
### For Developers
- Verify API specifications and endpoint details
- Validate code snippets and implementation patterns
- Compare different technical approaches
### **For Journalists**
- Verify quotes and attributed statements
- Validate data and statistics
### For Journalists
- Verify official documents and statements
- Validate data sources and statistical claims
- Cross-check information from multiple sources
### **For Students**
- Verify academic information and research
- Validate educational content and resources
- Learn about information verification techniques
### For Students
- Verify educational content and academic claims
- Validate research findings and data
- Learn verification techniques and critical thinking
### **For General Users**
- Verify information before sharing
- Learn about fact-checking and validation
- Contribute to a community of truth-seekers
## 🔧 Configuration
## 🔒 Security & Privacy
### Environment Variables
```bash
# Database configuration (for future backend integration)
DATABASE_TYPE=localStorage # localStorage, mongodb, supabase, firebase
API_URL=https://api.infovalidator.com
JWT_SECRET=your-secret-key
### **Data Protection**
- **Client-Side Storage**: All data stored locally in your browser
- **No Server Required**: Works completely offline
- **Export Control**: Full control over your data with export/import
# Feature flags
ENABLE_CHAT=true
ENABLE_ANALYTICS=true
ENABLE_EXPORT=true
```
### **Security Features**
- **XSS Protection**: Input sanitization and safe rendering
- **Security Headers**: Comprehensive HTTP security headers
- **No Sensitive Data**: No API keys or secrets stored
### Security Settings
- **Content Security Policy**: Comprehensive CSP headers
- **XSS Protection**: Input sanitization and output encoding
- **HTTPS Enforcement**: Secure headers for production
- **Data Validation**: Client-side and server-side validation
### **Privacy First**
- **Anonymous Usage**: No account required to use basic features
- **Local Processing**: All AI analysis happens in your browser
- **Data Ownership**: You own and control all your data
## 📈 Analytics & Insights
## 🌟 Why InfoValidator?
### Platform Analytics
- **Claim Distribution**: Breakdown by category and type
- **Growth Trends**: Submission and user growth over time
- **Top Validators**: Most active and accurate contributors
- **Verification Rates**: Success rates for different claim types
### **The Problem**
In today's digital age, information spreads faster than ever, but verification often lags behind. We need a system that can:
- **Scale quickly** to handle massive amounts of information
- **Adapt flexibly** to different types of content
- **Combine human insight** with AI analysis
- **Build community** around truth-seeking
### User Analytics
- **Personal Stats**: Individual validator performance
- **Achievement Tracking**: Unlocked badges and milestones
- **Activity Timeline**: Recent submissions and verifications
- **Comparison History**: Past comparison analyses
### **The Solution**
InfoValidator provides:
- **Universal Platform**: Handle any type of information that can be verified
- **Hybrid Validation**: Human consensus + AI analysis = better accuracy
- **Community-Driven**: Leverage collective intelligence
- **Gamified Engagement**: Make verification fun and rewarding
## 🏆 Achievement System
## 🚀 Future Roadmap
### Badges Available
- **🔰 First Blood**: Submit your first claim
- **🔍 Discoverer**: Submit 5 verified claims
- **✅ Verifier**: Verify 10 claims with high accuracy
- **🏆 Expert**: Achieve 1000+ total points
- **💎 Diamond**: Submit 50+ claims with 95%+ confidence
- **🚀 Pioneer**: Be first to discover 10 claims
- **🤝 Collaborator**: Participate in 20+ comparisons
- **📊 Analyst**: Complete 5 daily challenges
- **🎯 Bounty Hunter**: Earn 500+ bounty points
- **🌟 Legend**: Reach the top 1% of validators
### **Phase 1: Core Platform** ✅
- [x] Universal information submission system
- [x] AI-powered similarity analysis
- [x] Community features and gamification
- [x] GitHub Pages deployment
## 🔮 Future Roadmap
### **Phase 2: Enhanced Features**
- [ ] Backend integration (MongoDB/Supabase)
- [ ] Real-time collaboration features
- [ ] Advanced AI analysis (NLP, image recognition)
- [ ] Mobile app development
### Phase 2: Enhanced Verification
- **AI-Powered Analysis**: Advanced ML models for claim verification
- **Blockchain Integration**: Immutable verification records
- **API Ecosystem**: Public API for third-party integrations
- **Mobile App**: Native iOS and Android applications
### **Phase 3: Advanced Capabilities**
- [ ] Blockchain-based verification records
- [ ] API for third-party integrations
- [ ] Advanced analytics and insights
- [ ] Enterprise features and white-labeling
### Phase 3: Advanced Features
- **Real-time Collaboration**: Live editing and verification sessions
- **Expert Networks**: Domain-specific validator communities
- **Automated Fact-checking**: AI-driven claim verification
- **Integration APIs**: Connect with external verification services
### Phase 4: Enterprise Features
- **Team Management**: Organizational accounts and permissions
- **Advanced Analytics**: Detailed reporting and insights
- **Custom Workflows**: Configurable verification processes
- **API Marketplace**: Third-party verification service integrations
## 🤝 Contributing
We welcome contributions from the community! Here's how you can help:
### **Report Issues**
- Found a bug? Report it in the Issues section
- Have a feature request? Let us know!
### Development
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
### **Submit Validations**
- Submit information claims for verification
- Help verify existing submissions
### Content
- Submit new information claims for verification
- Participate in community discussions
- Help verify existing claims
- Suggest new features and improvements
### **Code Contributions**
- Fork the repository
- Create a feature branch
- Submit a pull request
### **Spread the Word**
- Share InfoValidator with your network
- Use it to verify information you encounter
- Help build a community of truth-seekers
### Documentation
- Improve documentation and guides
- Add examples and tutorials
- Translate content to other languages
- Create video tutorials and demos
## 📄 License
This project is open source and available under the [MIT License](LICENSE).
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🙏 Acknowledgments
- **OpenAI** for inspiring the original concept
- **GitHub** for providing free hosting and collaboration tools
- **The Community** for contributing to information verification
- **All Validators** who help make the internet a more truthful place
- **Open Source Community**: For the amazing tools and libraries that make this possible
- **Early Validators**: The community members who helped shape the platform
- **AI Researchers**: For inspiring the verification methodologies
- **Security Experts**: For guidance on platform security and best practices
## 📞 Support
- **Documentation**: [docs.infovalidator.com](https://docs.infovalidator.com)
- **Community**: [community.infovalidator.com](https://community.infovalidator.com)
- **Email**: support@infovalidator.com
- **Discord**: [Join our Discord server](https://discord.gg/infovalidator)
---
**🔍 Truth is a collaborative effort. Join us in building a more verified world! ✨**
**Built with ❤️ by the InfoValidator community**
*InfoValidator - Where Humans + AI = Truth*
*Empowering truth through collective intelligence*
+125 -214
View File
@@ -3,112 +3,105 @@ function loadDemoData() {
const demoSubmissions = [
{
id: 1,
sourceName: "CodeValidator_42",
sourceName: "AI_Researcher_001",
targetType: "ai-system",
instanceId: "ChatGPT-4 System Prompt",
targetUrl: "https://chat.openai.com",
requiresLogin: true,
requiresPaid: true,
accessNotes: "Plus subscription required",
leakContent: "You are ChatGPT, a large language model trained by OpenAI. You are helpful, creative, clever, and very friendly. You respond in a conversational manner and provide detailed, accurate, and helpful responses.",
leakContent: "You are ChatGPT, a large language model trained by OpenAI. You are helpful, harmless, and honest. You can engage in conversations, answer questions, and assist with various tasks. You should be direct and concise in your responses.",
context: "Obtained through prompt injection techniques",
toolPrompts: "",
timestamp: new Date(Date.now() - 86400000).toISOString(),
confidence: 85,
confidence: 95,
isFirstDiscovery: true,
verificationCount: 3
},
{
id: 2,
sourceName: "DataHunter",
sourceName: "CodeHunter_2024",
targetType: "code-snippet",
instanceId: "Bitcoin Mining Algorithm",
instanceId: "Bitcoin Mining Algorithm Core",
targetUrl: "https://github.com/bitcoin/bitcoin",
requiresLogin: false,
requiresPaid: false,
accessNotes: "Open source",
leakContent: `function mineBlock(blockData, targetDifficulty) {
let nonce = 0;
let hash = '';
while (true) {
const blockHeader = blockData + nonce;
hash = sha256(blockHeader);
if (hash.startsWith('0'.repeat(targetDifficulty))) {
return { nonce, hash };
}
nonce++;
}
}`,
accessNotes: "Open source repository",
leakContent: "SHA256(SHA256(version + prev_hash + merkle_root + timestamp + difficulty + nonce))",
context: "Extracted from Bitcoin Core source code",
toolPrompts: "",
timestamp: new Date(Date.now() - 172800000).toISOString(),
confidence: 95,
confidence: 98,
isFirstDiscovery: true,
verificationCount: 5
},
{
id: 3,
sourceName: "FactChecker_Pro",
sourceName: "DataScientist_Pro",
targetType: "data-fact",
instanceId: "Global Population 2024",
targetUrl: "https://www.worldometers.info/world-population/",
instanceId: "Global Population Dataset 2024",
targetUrl: "https://data.worldbank.org",
requiresLogin: false,
requiresPaid: false,
accessNotes: "Public data",
leakContent: "8,019,876,189 people (as of January 2024)",
context: "Verified through multiple official sources",
accessNotes: "Public dataset",
leakContent: "World population: 8.1 billion (2024 estimate). Top countries: China (1.4B), India (1.4B), USA (340M), Indonesia (280M), Pakistan (240M)",
context: "Compiled from UN World Population Prospects",
toolPrompts: "",
timestamp: new Date(Date.now() - 259200000).toISOString(),
confidence: 98,
confidence: 92,
isFirstDiscovery: false,
verificationCount: 12
verificationCount: 2
},
{
id: 4,
sourceName: "DocAnalyzer",
sourceName: "DocumentDigger",
targetType: "document",
instanceId: "US Constitution Preamble",
targetUrl: "https://www.archives.gov/founding-docs/constitution",
instanceId: "US Constitution Full Text",
targetUrl: "https://www.archives.gov/founding-docs",
requiresLogin: false,
requiresPaid: false,
accessNotes: "Public domain document",
leakContent: "We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.",
context: "Official government document",
context: "Official government archive",
toolPrompts: "",
timestamp: new Date(Date.now() - 345600000).toISOString(),
confidence: 100,
isFirstDiscovery: false,
verificationCount: 25
},
{
id: 5,
sourceName: "APIScout",
targetType: "api",
instanceId: "GitHub API Rate Limits",
targetUrl: "https://docs.github.com/en/rest/overview/rate-limits",
requiresLogin: true,
requiresPaid: false,
accessNotes: "GitHub account required",
leakContent: "Authenticated requests: 5,000 requests per hour\nUnauthenticated requests: 60 requests per hour",
context: "From official GitHub API documentation",
timestamp: new Date(Date.now() - 432000000).toISOString(),
confidence: 92,
isFirstDiscovery: true,
verificationCount: 8
},
{
id: 6,
sourceName: "AIVerifier",
targetType: "ai-system",
instanceId: "Claude-3 System Prompt",
targetUrl: "https://claude.ai",
id: 5,
sourceName: "APIMaster_2024",
targetType: "api",
instanceId: "OpenAI API Rate Limits",
targetUrl: "https://platform.openai.com/docs",
requiresLogin: true,
requiresPaid: true,
accessNotes: "Claude Pro subscription required",
leakContent: "You are Claude, an AI assistant created by Anthropic. You are helpful, harmless, and honest. You aim to provide accurate and useful information while being transparent about your capabilities and limitations.",
context: "Obtained through conversation analysis",
timestamp: new Date(Date.now() - 518400000).toISOString(),
confidence: 78,
accessNotes: "API key required",
leakContent: "Rate limits: GPT-4: 10 requests/minute, GPT-3.5: 60 requests/minute. Token limits: GPT-4: 8,192 tokens, GPT-3.5: 4,096 tokens",
context: "From official API documentation",
toolPrompts: "",
timestamp: new Date(Date.now() - 432000000).toISOString(),
confidence: 97,
isFirstDiscovery: true,
verificationCount: 2
verificationCount: 4
},
{
id: 6,
sourceName: "VisualVerifier",
targetType: "image",
instanceId: "Mars Rover Perseverance Images",
targetUrl: "https://mars.nasa.gov/msl",
requiresLogin: false,
requiresPaid: false,
accessNotes: "NASA public gallery",
leakContent: "High-resolution images from Jezero Crater showing sedimentary rock layers, potential signs of ancient water flow, and organic compounds detected by SHERLOC instrument",
context: "NASA mission data release",
toolPrompts: "",
timestamp: new Date(Date.now() - 518400000).toISOString(),
confidence: 99,
isFirstDiscovery: false,
verificationCount: 6
}
];
@@ -116,125 +109,95 @@ function loadDemoData() {
{
id: 1,
targetType: "ai-system",
model: "Gemini Ultra System Prompt",
url: "https://gemini.google.com",
description: "Need to verify the system prompt for Google's Gemini Ultra model. This would be valuable for understanding Google's AI safety approach.",
model: "Claude-3 Opus System Prompt",
url: "https://claude.ai",
description: "Anthropic's latest model system prompt would be valuable for understanding their safety approach",
requiresLogin: true,
requiresPaid: true,
bounty: 750,
bounty: 1000,
votes: 15,
submittedBy: "AIResearcher",
submittedBy: "AI_Researcher_001",
timestamp: new Date(Date.now() - 86400000).toISOString()
},
{
id: 2,
targetType: "code-snippet",
model: "OpenAI Whisper Algorithm",
url: "https://github.com/openai/whisper",
description: "Looking for the core speech recognition algorithm used in Whisper. This could help understand modern speech-to-text technology.",
model: "Google's PageRank Algorithm",
url: "https://patents.google.com",
description: "The original PageRank implementation details would help understand search ranking",
requiresLogin: false,
requiresPaid: false,
bounty: 500,
votes: 8,
submittedBy: "SpeechTech",
submittedBy: "CodeHunter_2024",
timestamp: new Date(Date.now() - 172800000).toISOString()
},
{
id: 3,
targetType: "data-fact",
model: "Global Internet Users 2024",
model: "Global Internet Usage Statistics 2024",
url: "https://www.internetworldstats.com",
description: "Need to verify the current number of global internet users. This data is crucial for digital inclusion research.",
description: "Current internet penetration rates and usage patterns by region",
requiresLogin: false,
requiresPaid: false,
bounty: 200,
bounty: 300,
votes: 12,
submittedBy: "DigitalAnalyst",
submittedBy: "DataScientist_Pro",
timestamp: new Date(Date.now() - 259200000).toISOString()
}
];
// Load demo data into database
window.LeakHubDB.setLeakDatabase(demoSubmissions);
window.LeakHubDB.setLeakRequests(demoRequests);
// Initialize some user stats
const demoUserStats = {
"CodeValidator_42": {
submissions: 3,
firstDiscoveries: 2,
verifications: 8,
comparisons: 15,
challengesCompleted: 1,
requestsSubmitted: 2,
totalScore: 1250,
joinDate: new Date(Date.now() - 2592000000).toISOString()
},
"DataHunter": {
submissions: 5,
firstDiscoveries: 3,
verifications: 12,
comparisons: 22,
"AI_Researcher_001": {
submissions: 1,
firstDiscoveries: 1,
verifications: 3,
comparisons: 5,
challengesCompleted: 2,
requestsSubmitted: 1,
totalScore: 2100,
joinDate: new Date(Date.now() - 3456000000).toISOString()
totalScore: 850
},
"FactChecker_Pro": {
submissions: 8,
"CodeHunter_2024": {
submissions: 1,
firstDiscoveries: 1,
verifications: 25,
comparisons: 18,
challengesCompleted: 3,
requestsSubmitted: 4,
totalScore: 1800,
joinDate: new Date(Date.now() - 4320000000).toISOString()
},
"DocAnalyzer": {
submissions: 2,
firstDiscoveries: 0,
verifications: 15,
verifications: 5,
comparisons: 8,
challengesCompleted: 1,
requestsSubmitted: 1,
totalScore: 950,
joinDate: new Date(Date.now() - 5184000000).toISOString()
totalScore: 1200
},
"APIScout": {
submissions: 4,
firstDiscoveries: 2,
verifications: 10,
comparisons: 12,
challengesCompleted: 2,
requestsSubmitted: 3,
totalScore: 1400,
joinDate: new Date(Date.now() - 6048000000).toISOString()
"DataScientist_Pro": {
submissions: 1,
firstDiscoveries: 0,
verifications: 2,
comparisons: 3,
challengesCompleted: 0,
requestsSubmitted: 1,
totalScore: 450
}
};
// Load demo data into the database
if (window.LeakHubDB) {
window.LeakHubDB.setLeakDatabase(demoSubmissions).then(() => {
console.log('Demo submissions loaded');
});
window.LeakHubDB.setLeakRequests(demoRequests).then(() => {
console.log('Demo requests loaded');
});
window.LeakHubDB.setUserStats(demoUserStats).then(() => {
console.log('Demo user stats loaded');
});
// Set daily challenge
const challenge = {
title: "AI System Prompt Hunt",
description: "Find and verify a system prompt from any AI model!",
reward: 500,
endTime: new Date(Date.now() + 86400000).toISOString(),
completedBy: []
};
window.LeakHubDB.setDailyChallenge(challenge).then(() => {
console.log('Demo daily challenge loaded');
});
}
window.LeakHubDB.setUserStats(demoUserStats);
// Initialize daily challenge
const dailyChallenge = {
title: "Find and verify a system prompt from any AI model!",
description: "Submit a verified AI system prompt with confidence score above 90%",
reward: 500,
expiresAt: new Date(Date.now() + 86400000).toISOString(),
completedBy: []
};
window.LeakHubDB.setDailyChallenge(dailyChallenge);
console.log("Demo data loaded successfully!");
showAlert("Demo data loaded! Try submitting claims, comparing them, and exploring the platform.", "success");
// Refresh the UI
if (typeof displaySubmissions === 'function') {
displaySubmissions();
@@ -245,29 +208,17 @@ function loadDemoData() {
if (typeof updateStats === 'function') {
updateStats();
}
showAlert('Demo data loaded successfully! 🎉', 'success');
}
function clearDemoData() {
if (window.LeakHubDB) {
window.LeakHubDB.setLeakDatabase([]).then(() => {
console.log('Demo submissions cleared');
});
window.LeakHubDB.setLeakRequests([]).then(() => {
console.log('Demo requests cleared');
});
window.LeakHubDB.setUserStats({}).then(() => {
console.log('Demo user stats cleared');
});
window.LeakHubDB.setDailyChallenge(null).then(() => {
console.log('Demo daily challenge cleared');
});
}
window.LeakHubDB.setLeakDatabase([]);
window.LeakHubDB.setLeakRequests([]);
window.LeakHubDB.setUserStats({});
window.LeakHubDB.setDailyChallenge(null);
console.log("Demo data cleared!");
showAlert("Demo data cleared! Start fresh with your own submissions.", "info");
// Refresh the UI
if (typeof displaySubmissions === 'function') {
displaySubmissions();
@@ -278,57 +229,17 @@ function clearDemoData() {
if (typeof updateStats === 'function') {
updateStats();
}
showAlert('Demo data cleared! 🗑️', 'info');
}
// Add demo data buttons to the page
function addDemoButtons() {
const container = document.querySelector('.container');
if (container) {
const demoSection = document.createElement('div');
demoSection.style.cssText = `
position: fixed;
top: 100px;
right: 20px;
z-index: 1000;
background: rgba(0,0,0,0.8);
border: 1px solid rgba(255,255,255,0.2);
border-radius: 8px;
padding: 10px;
backdrop-filter: blur(10px);
`;
demoSection.innerHTML = `
<div style="color: #00ff88; font-size: 0.9rem; margin-bottom: 8px;">🧪 Demo Tools</div>
<button onclick="loadDemoData()" style="
background: #00ff88;
color: #000;
border: none;
padding: 5px 10px;
border-radius: 4px;
font-size: 0.8rem;
cursor: pointer;
margin-right: 5px;
">Load Demo</button>
<button onclick="clearDemoData()" style="
background: #ff4444;
color: #fff;
border: none;
padding: 5px 10px;
border-radius: 4px;
font-size: 0.8rem;
cursor: pointer;
">Clear</button>
`;
container.appendChild(demoSection);
// Auto-load demo data if no submissions exist
window.addEventListener('load', async () => {
try {
const submissions = await window.LeakHubDB.getLeakDatabase();
if (!submissions || submissions.length === 0) {
console.log("No submissions found, loading demo data...");
loadDemoData();
}
} catch (error) {
console.error("Error checking for demo data:", error);
}
}
// Auto-add demo buttons when page loads
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', addDemoButtons);
} else {
addDemoButtons();
}
});