How darksoul36/fake-news-detection works
This is a full-stack fake-news classification application. A user types or dictates an article, selects a model, and submits it through the web interface; the API classifies it and generates an explanation before returning label and confidence for display. Users can also submit feedback. The graph includes the documented speech, theme, and accessibility capabilities, plus API health and feedback storage. Source excerpts establish most backend calls; frontend/API and some UI wiring are documented in the README, so those links use that evidence.
Main entry points: PREDICTION_ROUTER.py Prediction endpoint · MAIN.py FastAPI application · EXPLANATION_AREA.js Results and explanation UI · SETTINGS.py Model configuration
Components 22
Web experience
- Web interface
FRONTEND/INDEX.html - Voice input
FRONTEND/JS/VOICE_INPUT.js - Analysis request UI
FRONTEND/JS/ANALYSIS_HANDLER.js - Results and explanation UI
FRONTEND/JS/EXPLANATION_AREA.js - Speech synthesis
FRONTEND/JS/SPEECH_SYNTHESIS.js - Feedback dialog
FRONTEND/JS/FEEDBACK_MODAL.js - Theme preference
FRONTEND/JS/THEME_MANAGER.js
API orchestration
- FastAPI application
API/MAIN.py - Prediction endpoint
API/ROUTER/PREDICTION_ROUTER.py - Health endpoint
API/ROUTER/HEALTH_ROUTER.py
Classification and explanation
- Model loader
API/MODELS/MODEL_LOADER.py - Model configuration
API/UTILS/SETTINGS.py - Trained models
MODEL/MODELS - TF-IDF vectorizer
MODEL/VECTORIZER - News classifier
API/MODELS/PREDICTION.py - LLM explainer
API/SERVICES/LLM_EXPLAINER.py
Feedback and status
- Feedback endpoint
API/ROUTER/FEEDBACK_ROUTER.py - Feedback service
API/SERVICES/FEEDBACK_SERVICE.py - Supabase
Other components
- Article submitter
- Web Speech API
- Health monitor
Connections 27
- Article submitter → Web interface: enters article
README.md - Article submitter → Voice input: dictates article
README.md - Web Speech API → Voice input: recognizes speech
- Voice input → Analysis request UI: supplies text
- Web interface → Analysis request UI: hosts analysis
- Analysis request UI → Prediction endpoint: posts article
README.md - FastAPI application → Prediction endpoint: mounts route
API/MAIN.py - FastAPI application → Health endpoint: mounts route
API/MAIN.py - FastAPI application → Feedback endpoint: mounts route
API/MAIN.py - Prediction endpoint → Model loader: loads models
API/ROUTER/PREDICTION_ROUTER.py - Model loader → Model configuration: reads paths
API/MODELS/MODEL_LOADER.py - Model configuration → Trained models: names model files
API/UTILS/SETTINGS.py - Model configuration → TF-IDF vectorizer: names vectorizer
API/UTILS/SETTINGS.py - Prediction endpoint → News classifier: classifies article
API/ROUTER/PREDICTION_ROUTER.py - News classifier → Trained models: predicts with model
- News classifier → TF-IDF vectorizer: transforms text
- Prediction endpoint → LLM explainer: requests explanation
API/ROUTER/PREDICTION_ROUTER.py - Prediction endpoint → Results and explanation UI: returns prediction
README.md - Results and explanation UI → Article submitter: shows result
README.md - Results and explanation UI → Speech synthesis: offers spoken result
README.md - Speech synthesis → Web Speech API: speaks result
- Article submitter → Feedback dialog: rates result
README.md - Feedback dialog → Feedback endpoint: submits feedback
README.md - Feedback endpoint → Feedback service: submits feedback
API/ROUTER/FEEDBACK_ROUTER.py - Feedback service → Supabase: inserts feedback
API/SERVICES/FEEDBACK_SERVICE.py - Health monitor → Health endpoint: checks status
- Article submitter → Theme preference: toggles theme