How shubhamg2004/crimedetectionsystem works
Crime Detection System supports camera-based AI detection through incident reporting and station alerts, alongside role-based operations, analytics, mapping, and case management. The main workflow is an operator or camera submitting an image; the backend validates camera access, calls the AI server, stores incident evidence and results, then emits live updates and may notify a nearby police station. The README describes predictive analytics and multi-channel notifications, but sampled code only confirms incident-driven alert delivery and does not expose the analytics implementation details.
Main entry points: app.js API application · firebase.js Firebase services · detect.routes.js Detection intake · incident.controller.js Incident creation
Components 30
Web application
- Role dashboards
frontend/src/app/dashboard - Camera setup
frontend/src/app/field-operator - Analytics view
frontend/src/app/analytics/page.js - Incident views
frontend/src/app/dashboard/operator/incidents/page.js - Image detection
frontend/src/app/detect-image/page.js
Backend API
- API application
backend/src/app.js - Camera management
backend/src/routes/camera.routes.js - Role administration
backend/src/routes/admin.routes.js - Detection intake
backend/src/routes/detect.routes.js - Incident endpoints
backend/src/routes/incident.routes.js - Analytics endpoints
backend/src/routes/analytics.routes.js - Support messaging
backend/src/routes/messages.routes.js
AI detection
- AI service
ai-server/detector.py - Image analysis
ai-server/image_detector.py - Pose analysis
ai-server/pose_detector.py - Detection reasoning
ai-server/reasoning_layer.py
Incident operations
- Incident creation
backend/src/controllers/incident.controller.js - Station lookup
backend/src/controllers/policeStation.controller.js - Alert dispatch
backend/src/services/alert.service.js - Alert management
backend/src/controllers/alert.controller.js
Data and integrations
- Firebase services
backend/src/config/firebase.js - Evidence storage
backend/src/config/cloudinary.js - Live event server
backend/src/server.js - Incident escalation
functions/index.js
Other components
- Operators
- Field operators
- Administrators
- Camera device
- Twilio messaging
- Email delivery
Connections 40
- Operators → Role dashboards: use
- Field operators → Camera setup: manage cameras
- Administrators → Role dashboards: administer
- Operators → Image detection: submit image
- Role dashboards → API application: request data
- Camera setup → API application: manage cameras
- Image detection → API application: submit detection
- Incident views → API application: request incidents
- Analytics view → API application: request analytics
- API application → Camera management: dispatch
- API application → Role administration: dispatch
- API application → Detection intake: dispatch
- API application → Incident endpoints: dispatch
- API application → Analytics endpoints: dispatch
- API application → Support messaging: dispatch
- Camera management → Firebase services: read and write
- Role administration → Firebase services: manage identities
- Support messaging → Firebase services: read and write messages
- Analytics endpoints → Firebase services: query data
- Detection intake → Firebase services: validate camera; store incident
- Camera device → Detection intake: send image
- Detection intake → AI service: forward image
- AI service → Image analysis: analyze image
- AI service → Pose analysis: analyze pose
- AI service → Detection reasoning: interpret detections
- Detection intake → Evidence storage: upload evidence
- Detection intake → Station lookup: find nearest station
- Station lookup → Firebase services: read stations
- Detection intake → Alert dispatch: trigger station alert
- Alert dispatch → Firebase services: save alert state
- Alert dispatch → Twilio messaging: send WhatsApp
- Alert dispatch → Email delivery: send email
- Detection intake → Live event server: emit incident event
- Incident endpoints → Incident creation: invoke
- Incident creation → Firebase services: save incident
- Incident creation → Evidence storage: upload evidence
- Incident creation → Alert dispatch: trigger station alert
- Incident creation → Station lookup: find nearest station
- Alert management → Firebase services: read and update alerts
- Incident escalation → Firebase services: escalate incident