A full-stack news platform with live news feeds, a role-based editorial system, and a multi-layer AI fact-checking engine that verifies the authenticity of any news article or text.
- Register with OTP email verification
- Login with email & password
- Google OAuth login
- Forgot password / reset password via email
- Role-based access β Reader, Editor, Admin
- Live breaking news ticker
- Hero section with featured article
- Editor's Picks section
- Latest news grid
- Category navbar β National, Global, Technology, Education, Sports, Business, Entertainment, Health, Science, Politics
- Single article pages with comments
- Dark / Light theme toggle
- AI Fact Check button in navbar
- Mobile responsive with hamburger menu
- Edit personal info (name, email, role)
- Change password
- Notification preferences β breaking news, digest, recommendations, newsletter
- Editor profile β handle, bio, avatar URL
- Article stats overview
- Write new articles with draft / submit workflow
- Edit draft and rejected articles
- Comments on own articles
- Delete request system (request admin approval)
- Dashboard with platform-wide stats
- Full article management β approve, reject (with note), delete, toggle breaking/featured flags
- User management β activate/deactivate, change roles, delete
- Editor profiles with stats
- Comment moderation β hide, unflag, delete
- Delete request management β approve or deny
- OTP log viewer with clear-expired option
- Paste text or enter a URL to analyze
- Multi-layer AI chain with fallback:
- Google Gemini 2.5 β Gemini 1.5 β Groq β Cohere β HuggingFace β Local ML model
- Confidence score with animated ring
- Credibility score & red flag detection
- Credibility signals breakdown
- Claims to verify with Google search links
- Text statistics β word count, caps ratio, exclamation density
- AI-verified source suggestions
- Related articles from NewsAPI, GNews, NewsData, MediaStack, Wikipedia, RSS
- Analysis history per session
- Feedback system that incrementally trains the local ML model
- Rate limiting β 20 requests per 15 minutes
- HashingVectorizer + PassiveAggressiveClassifier
predict.pyβ inferencehashing_train.pyβ incremental learning from user feedbackauto_updater.pyβ fetches live headlines, generates fake variants, retrains on schedule- Training data across all news categories
| Layer | Technology |
|---|---|
| Backend | Node.js, Express.js |
| Templating | EJS, express-ejs-layouts |
| Styling | CSS |
| Database | PostgreSQL |
| Auth | Passport.js (Local + Google OAuth), express-sessions |
| Nodemailer SMTP | |
| AI Services | Google Gemini 2.5/1.5, Groq, Cohere, HuggingFace |
| Local ML | Python (scikit-learn) |
| News APIs | NewsAPI, GNews, NewsData, MediaStack |
| Push Notifications | VAPID Web Push |
| Caching | node-cache |
newshub-ai-truthlens/
βββ routes/ # Express route handlers
βββ views/ # EJS templates (auth, news, admin layouts)
βββ public/ # Static assets (CSS, JS, images)
βββ ml/
β βββ predict.py # ML inference
β βββ hashing_train.py # Incremental training
β βββ auto_updater.py # Scheduled retraining
βββ .env.example # Environment variable template
βββ app.js # Main app entry point
βββ README.md
- Node.js v18+
- PostgreSQL
- Python 3.x with scikit-learn (
pip install scikit-learn)
git clone https://github.com/your-username/newshub-ai-truthlens.git
cd newshub-ai-truthlensnpm installpip install scikit-learn requestscp .env.example .envOpen .env and fill in all your API keys and config values.
- Create a database in PostgreSQL
- Update
DATABASE_URLin your.env - Run any SQL migration files if included
node app.jsOr with auto-reload:
npx nodemon app.jsVisit http://localhost:3000
See .env.example for all required variables. Never commit your .env file.
| Service | Purpose |
|---|---|
| NewsAPI | Main news feed |
| GNews | Additional news source |
| NewsData.io | News data |
| MediaStack | Live news stream |
| Google Gemini | Primary AI fact checking |
| Groq | AI fallback |
| Cohere | AI fallback |
| HuggingFace | AI fallback |
| Google OAuth | Social login |
Pull requests are welcome! Please open an issue first to discuss major changes.