How wahib-elbessali/smartagency works
This repository implements a multi-agency operations platform with a browser console, a management/API backend, and a separately deployed computer-vision service. The main user workflow is to manage cameras and operational records in the console, send requests through the backend, and view attendance, alerts, and other AI results. AI capabilities include camera calibration and zoning, person tracking, face recognition and wanted-person alerts, emotion, fire, and weapon detection. The excerpts establish the AI service’s route mounting and the backend’s startup consumers; detailed persistence and most cross-service call sites were not sampled, so those links are omitted.
Main entry points: features/main.py AI API · app/main.py Backend API · Screen.tsx Operations screens · client.ts API client
Components 23
Browser console
- Operations screens
frontend/src/screens/Screen.tsx - API client
frontend/src/api/client.ts - App routing
frontend/src/App.tsx
Management backend
- Backend API
backend/app/main.py - Domain routes
backend/app/api - AI client
backend/app/integrations/ai_client.py - Domain services
backend/app/services - Application database
backend/app/database/connection.py - MQTT consumers
backend/app/mqtt - Attendance stream
backend/app/websocket/attendance.py
AI service
- AI API
ai/features/main.py - Calibration
ai/features/calibration/engine.py - Person tracking
ai/features/person_tracking/engine.py - Face recognition
ai/features/face_recognition/engine.py - Wanted detection
ai/features/wanted_detection/engine.py - Emotion detection
ai/features/emotion_detection/engine.py - Fire detection
ai/features/fire_detection/engine.py - Weapon detection
ai/features/weapon_detection/engine.py - Cloud AI option
ai/features/cloud/main.py
External systems
- Camera feeds
- MQTT broker
- Model bridge
ai/molab_bridge/bridge_server.py
Other components
- Operator
Connections 19
- Operator → App routing: uses
- App routing → Operations screens: routes to
- Operations screens → API client: requests data
- API client → Backend API: calls API
- Backend API → Domain routes: mounts routers
- Backend API → MQTT consumers: starts
- Backend API → Attendance stream: mounts stream
- MQTT broker → MQTT consumers: delivers messages
- Domain routes → AI client: AI requests
- AI client → AI API: calls service
- AI API → Calibration: routes calibration
- AI API → Person tracking: routes tracking
- AI API → Face recognition: routes face tasks
- AI API → Wanted detection: routes wanted tasks
- AI API → Emotion detection: routes emotion tasks
- AI API → Fire detection: routes fire tasks
- AI API → Weapon detection: routes weapon tasks
- Camera feeds → AI API: provides frames
- Cloud AI option → Model bridge: uses remote models