How piyush0108maurya/url-sms-detector works
PhishGuard Edge is a local web app for scanning URLs and SMS text, individually or via CSV, and returning phishing classifications, confidence, and URL indicators. The workflow runs from the React interface to the FastAPI endpoint, which normalizes input and invokes a locally loaded DistilBERT model; batch results return to the interface for review and CSV download. Separate data preparation, model training, and Snapdragon export/profiling support the product lifecycle. Runtime links are based on shown calls; README documents on-device privacy and the NPU optimization goal.
Main entry points: main.py REST API · export_and_compile.py ONNX export and compile · App.jsx Scan UI · train.py Model training
Components 16
Scanning interface
- Scan UI
frontend/src/App.jsx - React entry
frontend/src/main.jsx
Local inference API
- REST API
backend/main.py - Input normalization
backend/main.py - URL indicators
backend/main.py - DistilBERT classifier
model/phishing-distilbert - Model metrics
docs/model_metrics.json - Snapdragon benchmark
docs/snapdragon_performance.json
Model lifecycle
- Model training
model/train.py - Trained model
model/phishing-distilbert - ONNX export and compile
model/export_and_compile.py - ONNX model
model/phishing.onnx
Dataset preparation
- Dataset preparation
data/prepare_data.py - Shared URL normalization
common/normalize.py
Other components
- Scanner
- Qualcomm AI Hub
Connections 15
- Scanner → Scan UI: scans
README.md - React entry → Scan UI: renders
frontend/src/main.jsx - Scan UI → REST API: posts scans
frontend/src/App.jsx - REST API → DistilBERT classifier: loads model
backend/main.py - REST API → Input normalization: normalizes input
backend/main.py - REST API → URL indicators: extracts indicators
backend/main.py - REST API → DistilBERT classifier: runs inference
backend/main.py - REST API → Model metrics: reads metrics
backend/main.py - REST API → Snapdragon benchmark: reads benchmark
backend/main.py - Dataset preparation → Shared URL normalization: normalizes data
data/prepare_data.py - Model training → Trained model: saves model
model/train.py - ONNX export and compile → Trained model: loads model
model/export_and_compile.py - ONNX export and compile → ONNX model: exports model
model/export_and_compile.py - ONNX export and compile → Qualcomm AI Hub: submits compile and profile
model/export_and_compile.py - Model training → Dataset preparation: uses prepared splits