How ducvovn01/phishing_url_project works
This is a browser-based phishing URL detector: a user submits URL text, the React client sends it to FastAPI, and the service returns a phishing verdict, trust score, and explanatory signals. The client presents the result and can compare checks in tab-local session summaries. The backend validates and scores text offline with a verified char n-gram model, without fetching URLs or making reputation lookups. The README also documents an offline model-training pipeline. Backend internals and some UI wiring are supported by the excerpts and SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: model_service.py Model service · main.py FastAPI app · HomePage.jsx URL checker · client.js API client
Components 25
Web client
- App routes
frontend/src/App.jsx - URL checker
frontend/src/pages/HomePage.jsx - Analysis state
frontend/src/hooks/useAnalysis.js - API client
frontend/src/api/client.js - Mock API
frontend/src/api/mock.js - Result display
frontend/src/components/results/ResultView.jsx - Session summary
frontend/src/pages/SessionPage.jsx - Session state
frontend/src/session/useSession.js - Session charts
frontend/src/components/session/TrustScoreBars.jsx
Analysis API
- FastAPI app
backend/app/main.py - Analysis routes
backend/app/routes.py - Request schemas
backend/app/schemas.py - Request middleware
backend/app/middleware.py - Rate limiting
backend/app/rate_limit.py - Error handling
backend/app/errors.py
Scoring engine
- Model service
backend/app/services/model_service.py - URL normalization
backend/app/services/normalization.py - Rule signals
backend/app/services/rules.py - Score explanations
backend/app/services/explanations.py - A2 feature bridge
backend/app/a2.py - Brand reference
data/reference/brand_list.py - Verified model artifact
Model pipeline
- Feature extraction
scripts/extract_features.py - Model training
scripts/train_model.py
Other components
- Browser user
Connections 27
- Browser user → URL checker: submits URL
README.md - App routes → URL checker: routes to
frontend/src/App.jsx - App routes → Session summary: routes to
frontend/src/App.jsx - URL checker → Analysis state: runs analysis
frontend/src/pages/HomePage.jsx - Analysis state → API client: requests analysis
frontend/src/hooks/useAnalysis.js - API client → FastAPI app: POSTs URL
README.md - API client → Mock API: selects mock
frontend/src/api/index.js - URL checker → Result display: renders result
frontend/src/pages/HomePage.jsx - URL checker → Session state: records result
frontend/src/pages/HomePage.jsx - Session summary → Session state: reads checks
frontend/src/pages/SessionPage.jsx - Session summary → Session charts: renders charts
frontend/src/pages/SessionPage.jsx - FastAPI app → Analysis routes: registers routes
backend/app/main.py - FastAPI app → Request middleware: installs middleware
backend/app/main.py - FastAPI app → Rate limiting: configures limiter
backend/app/main.py - FastAPI app → Model service: loads service
backend/app/main.py - FastAPI app → Error handling: installs handlers
backend/app/main.py - Analysis routes → Request schemas: validates payload
backend/app/routes.py - Analysis routes → Model service: runs analysis
backend/app/routes.py - Model service → URL normalization: normalizes text
backend/app/services/model_service.py - Model service → Rule signals: gets rule signals
backend/app/services/model_service.py - Model service → Score explanations: gets n-gram signals
backend/app/services/model_service.py - Model service → A2 feature bridge: uses A2 features
backend/app/services/model_service.py - A2 feature bridge → Feature extraction: imports feature code
backend/app/a2.py - Feature extraction → Brand reference: uses brand reference
data/reference/brand_list.py - Model service → Verified model artifact: loads verified model
README.md - Model training → Feature extraction: uses feature pipeline
- Model training → Verified model artifact: trains model
README.md