How keormel/safecall works
SafeCall combines a mobile caller-protection client, a FastAPI service that turns user reports into risk scores and scam campaigns, and a separate administration console. The principal loop is incoming-number screening from the local database, refreshed by server delta sync; reports feed the server’s scoring and campaign analysis, which informs later checks and updates. The README documents product capabilities beyond the sampled code, so those links are cited to it; implementation details for unsampled Flutter and admin subsystems are represented only at supported directory level.
Main entry points: report_service.py Report processing · main.py API routing · sync.py Delta sync · SafeCallScreeningService.kt Call screening
Components 24
Mobile protection
- Mobile app
mobile - Call screening
mobile/android/app/src/main/kotlin/com/safecall/safecall/SafeCallScreeningService.kt - Local number DB
mobile/android/app/src/main/kotlin/com/safecall/safecall/CallStore.kt - Call notices
mobile/android/app/src/main/kotlin/com/safecall/safecall/NotificationHelper.kt - iOS call directory
mobile/ios/CallDirectory/CallDirectoryHandler.swift
Risk intelligence API
- API routing
backend/app/main.py - Device auth
backend/app/routers/auth.py - Number checks
backend/app/routers/numbers.py - Report intake
backend/app/routers/reports.py - Report processing
backend/app/services/report_service.py - Fingerprinting
backend/app/services/fingerprint.py - Risk scoring
backend/app/services/risk_engine.py - Campaign analysis
backend/app/services/campaign_engine.py - Delta sync
backend/app/routers/sync.py - In-app assistant
backend/app/services/assistant.py - Gemini service
backend/app/services/gemini.py - Scheduled jobs
backend/app/jobs.py - Domain records
backend/app/models.py - PostgreSQL
backend/app/db.py
Administration
- Admin console
admin-morda-sasha/frontend/src/App.tsx - Admin API client
admin-morda-sasha/frontend/src/api/client.ts - Admin API
admin-morda-sasha/app/main.py - Admin data access
admin-morda-sasha/app/db_client.py
Other components
- Caller
Connections 28
- Caller → Call screening: incoming call
- Call screening → Local number DB: checks number
mobile/android/app/src/main/kotlin/com/safecall/safecall/SafeCallScreeningService.kt - Call screening → Call notices: shows notice
mobile/android/app/src/main/kotlin/com/safecall/safecall/SafeCallScreeningService.kt - Mobile app → Delta sync: fetches deltas
- Delta sync → Local number DB: updates local DB
- Mobile app → API routing: checks and reports
- iOS call directory → Local number DB: uses local data
- API routing → Device auth: routes requests
backend/app/main.py - API routing → Number checks: routes requests
backend/app/main.py - API routing → Report intake: routes requests
backend/app/main.py - API routing → Delta sync: routes requests
backend/app/main.py - Number checks → Report processing: checks number
backend/app/routers/numbers.py - Report intake → Report processing: records report
- Report processing → Fingerprinting: builds fingerprint
backend/app/services/report_service.py - Report processing → Risk scoring: recalculates risk
backend/app/services/report_service.py - Report processing → Campaign analysis: refreshes campaign
backend/app/services/report_service.py - Risk scoring → Domain records: reads and updates
backend/app/services/risk_engine.py - Campaign analysis → Domain records: assigns numbers
backend/app/services/campaign_engine.py - Report processing → PostgreSQL: persists report
- Delta sync → PostgreSQL: reads changed numbers
backend/app/routers/sync.py - Scheduled jobs → Risk scoring: recalculates scores
backend/app/jobs.py - Scheduled jobs → Campaign analysis: maintains campaigns
backend/app/jobs.py - In-app assistant → Gemini service: answers questions
- Fingerprinting → Gemini service: classifies complaints
backend/app/services/fingerprint.py - Admin console → Admin API client: uses API client
admin-morda-sasha/frontend/src/App.tsx - Admin API client → Admin API: sends requests
- Admin API → Admin data access: loads admin data
- Admin data access → PostgreSQL: reads shared records