How sandeepkudupudi07/trapcheck works
TrapCheck is a multilingual scam-analysis application. A user submits a message through the React interface; the FastAPI backend validates and sanitizes it, retrieves related scam patterns, and uses an Ollama-hosted model to produce an assessment. Authenticated users can review scan history and submit reports; admins review reports separately from adding approved patterns to retrieval. The README documents these flows and security capabilities; some source details were not sampled, so unsourced internal links are omitted.
Main entry points: main.py FastAPI application · rag_engine.py RAG analysis · database.py Account data models · routes.py Account endpoints
Components 25
User interface
- Browser UI
frontend/trapcheck-frontend/src/App.jsx - Analysis interface
frontend/trapcheck-frontend/src/TrapCheck.jsx - History dashboard
frontend/trapcheck-frontend/src/History.jsx - API client
frontend/trapcheck-frontend/src/http.js
API and security
- FastAPI application
backend/main.py - Rate limits
backend/rate_limit.py - Safe logging
backend/security/zero_log.py - Message sanitizer
backend/security/sanitizer.py - Ephemeral processing
backend/security/ephemeral.py
Scam analysis
- RAG analysis
backend/rag_engine.py - Scam patterns
data/scam_patterns.py - Vector knowledge base
backend/rag_engine.py - Ollama model
- Threat-feed refresh
backend/scheduler/refresh.py - SMS and WhatsApp
backend/channels/twilio_handler.py
Accounts and community
- Account endpoints
backend/auth/routes.py - JWT and passwords
backend/auth/auth.py - Reset email
backend/auth/email_service.py - Account data models
backend/auth/database.py - Scam reporting
backend/security/anonymous_report.py - Admin review
backend/auth/admin_routes.py - Persistent records
backend/auth/database.py
Other components
- User
- Twilio
- PhishTank feed
Connections 28
- User → Browser UI: uses
README.md - Browser UI → Analysis interface: renders
frontend/trapcheck-frontend/src/App.jsx - Analysis interface → API client: submits requests
frontend/trapcheck-frontend/src/TrapCheck.jsx - History dashboard → API client: requests history
frontend/trapcheck-frontend/src/History.jsx - API client → FastAPI application: calls API
README.md - FastAPI application → Rate limits: applies limits
backend/main.py - FastAPI application → Safe logging: installs middleware
backend/main.py - FastAPI application → Message sanitizer: sanitizes messages
backend/main.py - FastAPI application → RAG analysis: analyzes message
README.md - FastAPI application → Account data models: persists history
README.md - FastAPI application → Scam reporting: accepts reports
backend/main.py - FastAPI application → Threat-feed refresh: starts refresh
backend/main.py - RAG analysis → Scam patterns: loads patterns
backend/rag_engine.py - RAG analysis → Vector knowledge base: retrieves patterns
README.md - RAG analysis → Ollama model: invokes model
backend/rag_engine.py - FastAPI application → Ephemeral processing: processes transiently
README.md - Account endpoints → JWT and passwords: authenticates users
backend/auth/routes.py - JWT and passwords → Account data models: reads and writes
backend/auth/auth.py - Account endpoints → Reset email: sends reset email
backend/auth/routes.py - Account endpoints → Account data models: reads and writes
backend/auth/routes.py - Account data models → Persistent records: stores records
backend/auth/database.py - Admin review → Account data models: reviews reports
backend/auth/admin_routes.py - Admin review → Vector knowledge base: adds approved patterns
README.md - Twilio → SMS and WhatsApp: posts webhooks
README.md - SMS and WhatsApp → Message sanitizer: sanitizes input
backend/channels/twilio_handler.py - SMS and WhatsApp → RAG analysis: analyzes messages
backend/channels/twilio_handler.py - Threat-feed refresh → PhishTank feed: fetches threat feed
README.md - Threat-feed refresh → Vector knowledge base: refreshes patterns
README.md