AI-powered phishing detection for URLs, SMS, and Emails
"Protecting users from phishing attacks using AI and Machine Learning."
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation
- API Reference
- Environment Variables
- Deployment
- Future Improvements
- Team
- ๐ URL Phishing Detection โ Identify malicious links in real-time
- ๐ฌ SMS Scam Detection โ Flag suspicious text messages
- ๐ง Email Phishing Detection โ Analyze email content for threats
- ๐ค ML-Based Detection โ Powered by trained Scikit-learn models
- ๐ Confidence Scoring โ Get prediction confidence percentages
- ๐ง Reason Explanation โ Understand why content was flagged
- โก Modern Stack โ React frontend + Node.js backend + Flask ML service
| Layer | Technology |
|---|---|
| Frontend | React.js, Vite, Tailwind CSS |
| Backend | Node.js, Express.js |
| ML Service | Python, Flask, Scikit-learn, NLTK, Pandas, NumPy |
| Database | MongoDB (optional) |
TrapShield/ # Main Project Folder
โ
โโโ frontend/ # React Frontend
โ โโโ public/ # Static files
โ โโโ src/ # Main React source code
โ โโโ assets/ # Images, icons, logos
โ โโโ components/ # Reusable UI components
โ โ โโโ Navbar.jsx
โ โ โโโ ResultCard.jsx
โ โ โโโ Loader.jsx
โ โโโ pages/ # Main pages
โ โ โโโ Home.jsx
โ โ โโโ UrlCheck.jsx
โ โ โโโ SmsCheck.jsx
โ โ โโโ EmailCheck.jsx
โ โโโ services/ # API calling functions
โ โ โโโ api.js
โ โโโ utils/ # Helper functions
โ โโโ App.jsx # Main App component
โ โโโ main.jsx # React entry point
โ โโโ .env # Frontend environment variables
โ โโโ package.json # Frontend dependencies
โ โโโ vite.config.js # Vite configuration
โ
โโโ backend/ # Node.js Backend
โ โโโ controllers/ # Request handling logic
โ โ โโโ urlController.js
โ โ โโโ smsController.js
โ โ โโโ emailController.js
โ โโโ routes/ # API routes
โ โ โโโ urlRoutes.js
โ โ โโโ smsRoutes.js
โ โ โโโ emailRoutes.js
โ โโโ services/ # External service communication
โ โ โโโ mlService.js # Calls ML Flask API
โ โโโ middlewares/ # Custom middleware
โ โโโ utils/ # Helper utilities
โ โโโ uploads/ # Uploaded files (if needed)
โ โโโ .env # Backend environment variables
โ โโโ app.js # Express app config
โ โโโ server.js # Backend entry point
โ โโโ package.json # Backend dependencies
โ
โโโ ml-service/ # Python ML Service
โ โโโ venv/ # Shared virtual environment
โ โโโ api/ # Flask API
โ โ โโโ app.py # Main Flask server
โ โโโ url-model/ # URL phishing model
โ โ โโโ features.py # URL feature extraction
โ โ โโโ train.py # Train URL model
โ โ โโโ predict.py # Prediction logic
โ โ โโโ model.pkl # Trained model
โ โ โโโ vectorizer.pkl # Saved vectorizer
โ โโโ sms-model/ # SMS phishing model
โ โ โโโ features.py
โ โ โโโ train.py
โ โ โโโ predict.py
โ โ โโโ model.pkl
โ โ โโโ vectorizer.pkl
โ โโโ email-model/ # Email phishing model
โ โ โโโ features.py
โ โ โโโ train.py
โ โ โโโ predict.py
โ โ โโโ model.pkl
โ โ โโโ vectorizer.pkl
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # ML environment variables
โ โโโ README.md # ML documentation
โ
โโโ datasets/ # Central datasets
โ โโโ url/ # URL datasets
โ โโโ sms/ # SMS datasets
โ โโโ email/ # Email datasets
โ
โโโ docs/ # Project documentation
โ โโโ architecture/ # Architecture diagrams
โ โโโ screenshots/ # UI screenshots
โ โโโ report/ # Project report
โ โโโ ppt/ # Presentation
โ
โโโ .gitignore # Ignore unnecessary files
โโโ README.md # Main project documentation
โโโ package.json # Optional root package file
Make sure the following are installed on your machine:
git clone <your-github-repo-link>
cd TrapShieldcd frontend
# Install dependencies
npm install
# Install Tailwind CSS
npm install tailwindcss @tailwindcss/vite
# Start development server
npm run devFrontend runs on http://localhost:5173
cd backend
# Install dependencies
npm install
# Install required packages
npm install express cors dotenv axios multer
# Install nodemon (dev only)
npm install -D nodemon
# Start development server
npm run dev
# OR
node server.jsBackend runs on http://localhost:5000
cd ml-serviceCreate a virtual environment:
# Windows
python -m venv venv
# Mac/Linux
python3 -m venv venvActivate the virtual environment:
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activateInstall Python dependencies:
pip install flask pandas numpy scikit-learn nltk joblib
# Save dependencies
pip freeze > requirements.txtStart the Flask server:
cd api
python app.pyML Service runs on http://localhost:8000
| Method | Endpoint | Description |
|---|---|---|
POST |
/predict/url |
Detect phishing in a URL |
POST |
/predict/sms |
Detect scam in an SMS message |
POST |
/predict/email |
Detect phishing in an email |
{
"text": "Congratulations! You won a free iPhone. Click here to claim."
}{
"prediction": "Phishing",
"confidence": 96.4,
"reasons": [
"Suspicious keywords detected",
"Urgent language found"
]
}Frontend โ frontend/.env
VITE_BACKEND_URL=http://localhost:5000Backend โ backend/.env
PORT=5000
ML_SERVICE_URL=http://localhost:8000ML Service โ ml-service/.env
PORT=8000| Service | Platform |
|---|---|
| Frontend | Vercel |
| Backend | Render |
| ML Service | Render / Railway |
Dataset
โ
Feature Extraction
โ
Model Training
โ
Save Model (.pkl)
โ
Prediction API
# Node
node_modules/
# Python
venv/
__pycache__/
*.pyc
# Environment
.env
# Build
dist/
build/
# OS
.DS_Store- Browser Extension for real-time detection
- Deep Learning models (BERT, LSTM)
- AI explanation system (explainable AI)
- User authentication & detection history
- Dashboard analytics & threat reports
- Real-time threat intelligence feeds
| Member |
|---|
| Veerendra Kumar |
| Nayan Kumar |
| Ujjwal Kumar Singh |
| Om Shankar Madhwan |
| Shreysi Bharati |
This project is for educational purposes only.
Made with โค๏ธ by the TrapShield Team