A comprehensive fullstack application that empowers users to identify misinformation and build digital immunity through AI-powered content analysis, educational insights, and real-time verification.
- Node.js 18+ and npm
- Python 3.11+
- Modern web browser
git clone https://github.com/smirk-dev/TrustNet.git
cd TrustNetcd services/api-python
pip install fastapi uvicorn pydantic
python basic_server.pyBackend will run on: http://localhost:8000
cd mind-guard-toolkit-main
npm install
npm run devFrontend will run on: http://localhost:8080
Navigate to http://localhost:8080 in your browser and start analyzing content!
Fullstack Application Structure:
TrustNet/
βββ mind-guard-toolkit-main/ # React Frontend
β βββ src/
β β βββ components/ # UI Components
β β βββ hooks/ # React Hooks & API Integration
β β βββ lib/ # API Client & Configuration
β β βββ pages/ # Application Pages
β βββ package.json # Frontend Dependencies
βββ services/
β βββ api-python/ # FastAPI Backend
β β βββ app/ # Application Logic
β β βββ basic_server.py # Simplified API Server
β β βββ requirements.txt # Backend Dependencies
β βββ workers/ # Background Processing
βββ infra/ # Infrastructure as Code
βββ docs/ # Documentation
Technology Stack:
- Frontend: React 18.3.1, TypeScript, Vite, TanStack Query, shadcn/ui
- Backend: Python FastAPI, Pydantic, Uvicorn
- Styling: Tailwind CSS with animations and dark mode
- State Management: TanStack Query for server state
- Build Tool: Vite for fast development and optimized builds
See ARCHITECTURE.md for detailed system design and deployment instructions.
- Instant Trust Scoring: Get immediate credibility assessment (0-100% scale)
- Manipulation Detection: Identifies emotional appeals, urgency tactics, and bias
- Educational Insights: Learn why content is flagged with detailed explanations
- Source Verification: Automatic checking of URLs and domain reputation
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Dark/Light Mode: Automatic theme switching with user preference
- Real-time Feedback: Live analysis with progress indicators
- File Upload Support: Analyze documents, images, and text files
- Pattern Recognition: Learn to identify manipulation techniques
- Educational Tips: Context-aware guidance for each analysis
- Progressive Learning: Build critical thinking skills over time
- Safe Testing Environment: Practice with various content types
- RESTful API: Easy integration with external applications
- Real-time Processing: Immediate results with streaming updates
- Cross-platform: Works on all modern browsers and devices
- No Registration Required: Start analyzing content immediately
GET http://localhost:8000/health
# Response: {"status": "healthy"}POST http://localhost:8000/v1/analysis
Content-Type: application/json
{
"content": "Your content to analyze here",
"content_type": "text",
"user_id": "anonymous"
}{
"analysis_id": "test_1234567890",
"trust_score": {
"overall_score": 0.75,
"credibility": 0.78,
"bias_score": 0.5,
"emotional_manipulation": 0.25,
"source_reliability": 0.75
},
"analysis_summary": "Content analysis results...",
"manipulation_techniques": [],
"educational_content": "Educational insights...",
"metadata": {
"word_count": 10,
"sources": ["Source 1"]
},
"timestamp": 1234567890.123
}The frontend uses TanStack Query for efficient API state management:
import { useAnalysis } from '@/hooks/useApi';
const { analyzeContent, isAnalyzing, data, error } = useAnalysis();
// Analyze content
analyzeContent({
content: "Text to analyze",
content_type: "text",
user_id: "user123"
});cd mind-guard-toolkit-main
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run linting
npm run lintcd services/api-python
# Install dependencies
pip install fastapi uvicorn pydantic pydantic-settings
# Start development server
python basic_server.py
# Run with auto-reload
python -m uvicorn basic_server:app --reload --port 8000Create environment files for different environments:
VITE_API_BASE_URL=http://localhost:8000
VITE_NODE_ENV=development
VITE_ENABLE_DEBUG=trueThe backend uses pydantic-settings for configuration management. Key settings include CORS origins, API endpoints, and feature flags.
# Frontend tests
cd mind-guard-toolkit-main
npm test
# Backend tests
cd services/api-python
python -m pytest
# API testing
curl http://localhost:8000/health# Build frontend
npm run build
# Serve static files or deploy to CDNVITE_API_BASE_URL: Backend API URLVITE_ENABLE_ANALYTICS: Enable/disable analyticsVITE_ENABLE_DEBUG: Debug mode toggle
We welcome contributions to TrustNet! Here's how you can help:
-
Fork the repository
git clone https://github.com/your-username/TrustNet.git cd TrustNet -
Create a feature branch
git checkout -b feature/amazing-feature
-
Set up development environment
# Install frontend dependencies cd mind-guard-toolkit-main npm install # Install backend dependencies cd ../services/api-python pip install -r requirements.txt
-
Make your changes
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
-
Test your changes
# Test frontend npm run build npm test # Test backend python basic_server.py
-
Commit and push
git add . git commit -m 'Add amazing feature' git push origin feature/amazing-feature
-
Open a Pull Request
- Describe your changes clearly
- Reference any related issues
- Wait for review and feedback
- Code Style: Follow TypeScript/Python best practices
- Testing: Add tests for new functionality
- Documentation: Update README and code comments
- Performance: Consider impact on load times and user experience
- Accessibility: Ensure UI components are accessible
- π¨ UI/UX Improvements: Better animations, responsive design
- π Analysis Features: New detection algorithms, better scoring
- π± Mobile Experience: PWA features, offline capability
- π Internationalization: Multi-language support
- π§ͺ Testing: Unit tests, integration tests, E2E tests
- π Documentation: Tutorials, API documentation, examples
MIT License - see LICENSE file for details.
- React and FastAPI communities for excellent frameworks
- shadcn/ui for beautiful component library
- TanStack Query for efficient state management
- All contributors and users of TrustNet
Built with β€οΈ for digital literacy and misinformation resistance