How sudo-anu/ai-scam-detector works
This repository is a web-based scam detector: users submit a URL, email, text, or image through a React interface, the backend dispatches the input to a specialized scanner, and results are displayed in a dashboard. The backend also contains evidence normalization, risk scoring, threat-intelligence and Gemini integrations, and report generation. Several important modules are listed in the source index but were not excerpted; their connections are omitted or marked unverified rather than inferred.
Main entry points: App.jsx Scan app · input_router.py Input router · risk_engine.py Risk engine · evidence.py Evidence collector
Components 21
Web interface
- Scan app
frontend/src/App.jsx - URL input
frontend/src/components/Inputs/UrlScanner.jsx - Email input
frontend/src/components/Inputs/EmailScanner.jsx - Text input
frontend/src/components/Inputs/TextScanner.jsx - Image input
frontend/src/components/Inputs/ImageScanner.jsx - Results dashboard
frontend/src/components/Dashboard/ResultsDashboard.jsx
API orchestration
- Scan API
backend/main.py - Scan endpoints
backend/api/endpoints.py - Input router
backend/core/input_router.py - Data schemas
backend/models/schemas.py
Scanning and assessment
- URL scanner
backend/scanners/url_scanner.py - Email scanner
backend/scanners/email_scanner.py - Text scanner
backend/scanners/text_scanner.py - Image scanner
backend/scanners/image_scanner.py - Evidence collector
backend/core/evidence.py - Risk engine
backend/core/risk_engine.py
Integrations and reports
- Threat APIs
backend/integrations/threat_apis.py - Gemini client
backend/integrations/gemini_client.py - Report generator
backend/reporting/generator.py - Saved reports
backend/storage/reports
Other components
- User
Connections 20
- User → Scan app: uses
- Scan app → URL input: renders
frontend/src/App.jsx - Scan app → Email input: renders
frontend/src/App.jsx - Scan app → Text input: renders
frontend/src/App.jsx - Scan app → Image input: renders
frontend/src/App.jsx - Scan app → Scan endpoints: posts scans
frontend/src/App.jsx - Scan app → Results dashboard: renders results
frontend/src/App.jsx - Scan API → Scan endpoints: registers router
backend/main.py - Scan endpoints → Input router: dispatches scans
- Input router → URL scanner: dispatches
backend/core/input_router.py - Input router → Email scanner: dispatches
backend/core/input_router.py - Input router → Text scanner: dispatches
backend/core/input_router.py - Input router → Image scanner: dispatches
backend/core/input_router.py - Evidence collector → Data schemas: builds evidence
backend/core/evidence.py - Risk engine → Data schemas: returns evaluation
backend/core/risk_engine.py - Input router → Evidence collector: normalizes output
- Evidence collector → Risk engine: scores evidence
- Risk engine → Threat APIs: enriches assessment
- Risk engine → Gemini client: requests analysis
- Report generator → Saved reports: saves reports