How trideep091/scamshield works
ScamShield India is a mobile-first scam-checking PWA with a FastAPI backend. Users submit message text or decoded QR content, screenshots, or APKs; backend analysis produces risk and reasons, selects response actions, stores incident metadata, and returns a verdict for the frontend checklist. Separate branches cover account-linked history and aggregate statistics, accessibility/languages, and APK inspection. Evidence is limited to the provided README and excerpts/SOURCE INDEX; several frontend integrations and backend service internals are unsampled.
Main entry points: analyze.py Analysis routes · HomeScanner.tsx Multi-input scanner · database.py Database sessions · detector.py Signal detector
Components 23
Scanner experience
- Scanner page
frontend/src/app/page.tsx - Multi-input scanner
frontend/src/components/HomeScanner.tsx - QR capture
frontend/src/components/QRScannerModal.tsx - Verdict display
frontend/src/components/VerdictBanner.tsx - APK verdict
frontend/src/components/ApkVerdictCard.tsx - Language and accessibility
frontend/src/i18n/context.tsx
Threat analysis
- FastAPI application
backend/app/main.py - Analysis routes
backend/app/api/analyze.py - Signal detector
backend/app/services/detector.py - Text baseline
backend/app/services/text_baseline.py - URL heuristics
backend/app/services/url_analyzer.py - ONNX classifier
backend/app/services/onnx_classifier.py - APK inspection
backend/app/services/apk_analyzer.py
Response guidance
- Action engine
backend/app/services/action_engine.py - Safety checklist
frontend/src/components/ActionChecklist.tsx - Action state selector
frontend/src/components/ActionStateSelector.tsx
Accounts and telemetry
- Authentication routes
backend/app/api/auth.py - Identity and tokens
backend/app/core/security.py - User records
backend/app/models/user.py - Statistics route
backend/app/api/stats.py - Incident records
backend/app/models/incident.py - Database sessions
backend/app/core/database.py
Other components
- Digital user
Connections 28
- Digital user → Scanner page: opens
frontend/src/app/page.tsx - Scanner page → Multi-input scanner: renders
frontend/src/app/page.tsx - Multi-input scanner → QR capture: opens
frontend/src/components/HomeScanner.tsx - Multi-input scanner → Analysis routes: submits checks
- Analysis routes → Signal detector: evaluates text
backend/app/api/analyze.py - Signal detector → Text baseline: scores text
backend/app/services/detector.py - Signal detector → URL heuristics: checks links
backend/app/services/detector.py - Signal detector → ONNX classifier: tries model
backend/app/services/detector.py - Analysis routes → APK inspection: inspects APK
backend/app/api/analyze.py - Signal detector → Action engine: maps risk
backend/app/services/detector.py - Analysis routes → Action engine: selects actions
backend/app/api/analyze.py - Analysis routes → Incident records: stores metadata
backend/app/api/analyze.py - Analysis routes → Database sessions: uses session
backend/app/api/analyze.py - FastAPI application → Analysis routes: registers routes
backend/app/main.py - FastAPI application → Database sessions: initializes
backend/app/main.py - Multi-input scanner → Verdict display: renders
frontend/src/components/HomeScanner.tsx - Multi-input scanner → APK verdict: renders
frontend/src/components/HomeScanner.tsx - Multi-input scanner → Safety checklist: renders
frontend/src/components/HomeScanner.tsx - Safety checklist → Action state selector: renders
frontend/src/components/ActionChecklist.tsx - Scanner page → Language and accessibility: uses translations
frontend/src/app/page.tsx - Authentication routes → Identity and tokens: verifies identity
backend/app/api/auth.py - Authentication routes → User records: reads and writes
backend/app/api/auth.py - Authentication routes → Incident records: reads and deletes history
backend/app/api/auth.py - Authentication routes → Database sessions: uses session
backend/app/api/auth.py - Statistics route → Incident records: aggregates
backend/app/api/stats.py - Statistics route → Database sessions: uses session
backend/app/api/stats.py - Database sessions → User records: registers model
backend/app/core/database.py - Database sessions → Incident records: registers model
backend/app/core/database.py