Skip to content

anuragrajpoott/fake_news_detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📰 Fake News Detector (MERN + AI/ML)

GitHub last commit GitHub repo size License Made with

React Node Python MongoDB Vercel Render


🚀 Overview

Fake News Detector is a full-stack web app that detects whether a news article or statement is real or fake using a trained Machine Learning model.

This project integrates:

  • Frontend: React (Vite)
  • Backend: Node.js + Express
  • ML Service: Python (Flask/FastAPI)
  • Database: MongoDB Atlas

and supports authentication, history tracking, and AI-powered fake news detection — deployed fully on Vercel and Render.


🧩 Tech Stack

Frontend

  • ⚛️ React + Vite
  • 🌈 Tailwind / Material UI (if used)
  • 🔗 Axios for API requests
  • ☁️ Deployed on Vercel

Backend

  • 🧠 Node.js + Express.js
  • 🔒 JWT Authentication
  • 🗄️ MongoDB Atlas (Mongoose ORM)
  • ☁️ Deployed on Render

ML Service

  • 🐍 Python (Flask / FastAPI)
  • 🤖 Scikit-learn / TensorFlow model
  • 🧮 NLP-based classification
  • ☁️ Deployed on Render

⚙️ System Architecture

[Frontend - React (Vercel)]
        │
        ▼
[Backend - Node/Express (Render)]
        │
        ▼
[ML Service - Python (Render)]
        │
        ▼
[ML Model Prediction]

🧠 How It Works

1️⃣ User enters or pastes a news headline or text.
2️⃣ Frontend sends a POST request to the Backend API.
3️⃣ Backend forwards the request to the Python ML microservice.
4️⃣ ML service predicts whether the news is Real or Fake.
5️⃣ Backend sends the response back to the frontend.
6️⃣ If logged in, the prediction is stored in the user’s history.


🔑 Features

Feature Description
🔐 User Authentication Login / Signup using JWT
🧾 News History Stores all checked articles per user
Delete History Option to clear saved results
🧠 AI/ML Detection Detects Fake vs Real news
Quick Check Check without logging in
🌐 Cloud Deployment Fully hosted on Vercel & Render

🧰 Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/anuragrajpoott/fake_news_detector.git
cd fake_news_detector

2️⃣ Frontend Setup

cd frontend
npm install
npm run dev

Create a .env file in /frontend:

VITE_BACKEND_URL=https://your-backend.onrender.com

3️⃣ Backend Setup

cd backend
npm install
npm run dev

Create a .env file in /backend:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
ML_API_URL=https://your-mlservice.onrender.com/predict

4️⃣ ML Service Setup

cd mlservice
python -m venv venv
venv\Scripts\activate   # For Windows
# or
source venv/bin/activate   # For macOS/Linux
pip install -r requirements.txt
python pythonapp.py

The ML service runs locally at:

http://localhost:5002

🌐 Deployment Links

Service URL
🖥️ Frontend Vercel Deployment
⚙️ Backend Render Backend
🤖 ML API Render ML Service

🧪 Example Prediction

Input:

“The government has announced a new scheme to provide free Wi-Fi across rural areas.”

Output:

✅ Real News (Confidence: 0.82)


📸 Screenshots

  • Login Page
  • News Check Page
  • History Page

(Replace these placeholders with your actual screenshots)


📚 Future Improvements

  • 🧩 Deep Learning model (BERT / LSTM)
  • 🌍 Multi-language fake news detection
  • 📱 Mobile responsive UI
  • 🔊 Voice input support
  • 📊 Advanced analytics dashboard

👩‍💻 Team Members

Name Role
Anurag Rajpoot Full Stack Developer
Nandini ML Engineer
Khushi Frontend Developer
Shubhanshu Backend Developer

🏁 Conclusion

This project demonstrates the fusion of AI and Web Technologies to combat misinformation online.
By combining Machine Learning with the MERN Stack, we deliver a fast, intelligent, and user-friendly platform for detecting fake news in real time.


📄 License

This project is licensed under the MIT License — feel free to use and modify it.

If you like this project, don’t forget to star the repo!
👉 https://github.com/anuragrajpoott/fake_news_detector

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •