How athifu/ai-based-phishing-detection-system works
This is a browser-based phishing detection application for URLs and email text. A user submits content through the frontend; the API validates and dispatches it to URL machine-learning prediction or heuristic email analysis, then returns a risk result for display. A separate documented training workflow generates synthetic URL examples, extracts features, evaluates a Random Forest, and saves its model artifact. Email detection is heuristic, not a separate trained model. Source excerpts support the main code relationships; the README documents the browser-to-API workflow and UI capabilities.
Main entry points: model.py URL Prediction · app.js Analysis Interface · main.py FastAPI Endpoint · train_model.py Model Training
Components 9
User Interface
- Analysis Interface
frontend/app.js
Analysis Service
- FastAPI Endpoint
backend/main.py
Detection and Training
- URL Prediction
backend/ml/model.py - URL Features
backend/ml/feature_extractor.py - Email Features
backend/ml/feature_extractor.py - Email Heuristic
backend/ml/model.py - Model Training
backend/ml/train_model.py - Trained Model
Other components
- User
Connections 11
- User → Analysis Interface: enters content
README.md - Analysis Interface → FastAPI Endpoint: submits analysis
frontend/app.js - FastAPI Endpoint → URL Prediction: requests prediction
backend/main.py - URL Prediction → URL Features: extracts URL features
backend/ml/model.py - URL Prediction → Email Features: extracts email features
backend/ml/model.py - URL Prediction → Email Heuristic: scores email
backend/ml/model.py - URL Prediction → Trained Model: loads model
backend/ml/model.py - Model Training → URL Features: extracts training features
backend/ml/train_model.py - Model Training → Trained Model: saves model
backend/ml/train_model.py - FastAPI Endpoint → Analysis Interface: returns result
frontend/app.js - Analysis Interface → User: displays risk
frontend/app.js