How drsadivural/shoplifter works
RetailGuard is a loss-prevention platform with a Japanese/English web console, an iOS responder app, a regional API and worker, and a store-local camera appliance. The central workflow is camera-edge event/evidence delivery to the API, followed by human incident review and a reasoned outcome in the web or mobile client. The README documents the product boundaries and API role; source-index references and excerpts support selected internal links. Unsampled router and edge details are represented at subsystem level, so their unverified internal flows are not expanded.
Main entry points: app.py API application · AppState.swift iOS responder app · incidents.tsx Web console · db.py Tenant database
Components 28
Responder clients
- Web console
apps/web/src/pages/incidents.tsx - Web route map
apps/web/src/routes.tsx - Web API client
apps/web/src/api/client.ts - iOS responder app
apps/ios/RetailGuard/App/AppState.swift - iOS destinations
apps/ios/RetailGuard/App/Routes.swift - iOS API client
apps/ios/RetailGuardCore/Sources/RetailGuardCore/Networking/APIClient.swift - App preferences
apps/ios/RetailGuard/Services/AppPreferences.swift - Push registration
apps/ios/RetailGuard/Services/PushManager.swift
Regional backend
- API application
services/api/src/retailguard_api/app.py - Authentication
services/api/src/retailguard_api/routers/auth.py - Access control
services/api/src/retailguard_api/authz.py - Request dependencies
services/api/src/retailguard_api/deps.py - Session security
services/api/src/retailguard_api/security.py - Runtime settings
services/api/src/retailguard_api/settings.py - Tenant database
services/api/src/retailguard_api/db.py - Evidence media
services/api/src/retailguard_api/media.py
Store edge
- Edge appliance
services/edge/src/retailguard_edge/agent.py - Camera event pipeline
services/edge/src/retailguard_edge/pipeline.py - Edge API client
services/edge/src/retailguard_edge/client.py - Store cameras
Review and operations
- Incident endpoints
services/api/src/retailguard_api/routers/incidents.py - Profile endpoints
services/api/src/retailguard_api/routers/profiles.py - Edge endpoints
services/api/src/retailguard_api/routers/edge.py - Organization operations
services/api/src/retailguard_api/routers/org.py - Background worker
services/api/src/retailguard_api/worker.py
Other components
- Retail responder
- PostgreSQL
- Apple Push service
Connections 32
- Retail responder → Web console: reviews incidents
README.md - Retail responder → iOS responder app: reviews incidents
README.md - Web console → Web route map: navigates
apps/web/src/routes.tsx - Web route map → Web console: loads pages
apps/web/src/routes.tsx - Web console → Web API client: requests data
- Web API client → API application: calls API
README.md - iOS responder app → iOS destinations: navigates
apps/ios/RetailGuard/App/Routes.swift - iOS responder app → iOS API client: calls API
apps/ios/RetailGuard/App/AppState.swift - iOS responder app → App preferences: reads settings
apps/ios/RetailGuard/App/AppState.swift - iOS responder app → Push registration: manages alerts
apps/ios/RetailGuard/App/AppState.swift - Push registration → iOS API client: registers device
apps/ios/RetailGuard/Services/PushManager.swift - iOS API client → API application: calls API
README.md - API application → Authentication: mounts router
services/api/src/retailguard_api/app.py - API application → Incident endpoints: mounts router
services/api/src/retailguard_api/app.py - API application → Profile endpoints: mounts router
services/api/src/retailguard_api/app.py - API application → Edge endpoints: mounts router
services/api/src/retailguard_api/app.py - API application → Organization operations: mounts router
services/api/src/retailguard_api/app.py - Authentication → Access control: checks access
services/api/src/retailguard_api/routers/auth.py - Authentication → Session security: uses security
services/api/src/retailguard_api/routers/auth.py - Access control → Tenant database: audits actions
services/api/src/retailguard_api/authz.py - Tenant database → Runtime settings: loads database URL
services/api/src/retailguard_api/db.py - Tenant database → PostgreSQL: queries
services/api/src/retailguard_api/db.py - API application → Runtime settings: loads configuration
services/api/src/retailguard_api/app.py - Edge endpoints → Edge appliance: receives edge events
README.md - Edge appliance → Camera event pipeline: runs pipeline
- Edge appliance → Edge API client: uses client
- Camera event pipeline → Store cameras: processes camera input
README.md - Edge API client → Edge endpoints: sends events
README.md - Incident endpoints → Evidence media: handles evidence
services/api/src/retailguard_api/routers/incidents.py - Background worker → Tenant database: processes queued work
services/api/src/retailguard_api/worker.py - Background worker → Evidence media: handles media tasks
services/api/src/retailguard_api/worker.py - Background worker → Apple Push service: sends notifications
README.md