Police Dashboard - Tourist Safety System

rushi

rushi kesh

Police Dashboard - Tourist Safety System

A comprehensive real-time police dashboard for monitoring and managing tourist safety across India, built with modern web technologies and AI-powered threat detection.

šŸ—ļø System Architecture

Frontend (React.js)

Dashboard Interface: Real-time command center with live maps and alerts
MapBox Integration: Interactive maps with tourist markers and heatmaps
Material-UI Components: Professional, responsive UI components
Redux State Management: Centralized state for real-time data
Socket.IO Client: Real-time communication with backend

Backend (Node.js + Express)

REST API: Comprehensive API for all dashboard operations
WebSocket Server: Real-time alert broadcasting
PostgreSQL + PostGIS: Geospatial database for location data
Authentication & Authorization: JWT-based security
Rate Limiting & Security: Production-ready security measures

AI Service (Python)

Anomaly Detection: ML algorithms for behavioral analysis
Group Monitoring: DBSCAN clustering for group cohesion
Risk Assessment: Predictive analytics for threat detection

Blockchain Integration

Polygon Network: Smart contracts for digital identity
NFT-based IDs: Secure, verifiable tourist identification
Ethers.js: Blockchain communication layer

šŸ“ Project Structure

police-dashboard/
ā”œā”€ā”€ frontend/ # React.js Dashboard Application
│ ā”œā”€ā”€ public/ # Static assets
│ ā”œā”€ā”€ src/
│ │ ā”œā”€ā”€ components/ # React components
│ │ │ ā”œā”€ā”€ Dashboard/ # Main dashboard layout
│ │ │ ā”œā”€ā”€ MapView/ # Interactive map component
│ │ │ ā”œā”€ā”€ AlertsPanel/ # Real-time alerts sidebar
│ │ │ ā”œā”€ā”€ TouristDetails/ # Tourist information modal
│ │ │ └── IncidentManagement/ # Incident reporting
│ │ ā”œā”€ā”€ redux/ # State management
│ │ ā”œā”€ā”€ services/ # API and Socket.IO services
│ │ └── utils/ # Utility functions
│ └── package.json
│
ā”œā”€ā”€ backend/ # Node.js API Server
│ ā”œā”€ā”€ src/
│ │ ā”œā”€ā”€ controllers/ # API endpoint handlers
│ │ ā”œā”€ā”€ models/ # Database models (Sequelize)
│ │ ā”œā”€ā”€ routes/ # API route definitions
│ │ ā”œā”€ā”€ services/ # Business logic services
│ │ ā”œā”€ā”€ middleware/ # Express middleware
│ │ └── utils/ # Backend utilities
│ ā”œā”€ā”€ server.js # Main server file
│ └── package.json
│
ā”œā”€ā”€ ai-service/ # Python AI/ML Service
│ ā”œā”€ā”€ src/
│ │ ā”œā”€ā”€ anomaly_detection/ # ML algorithms
│ │ ā”œā”€ā”€ models/ # Trained ML models
│ │ └── utils/ # Data processing utilities
│ ā”œā”€ā”€ main.py # FastAPI application
│ └── requirements.txt
│
ā”œā”€ā”€ blockchain/ # Smart Contracts
│ ā”œā”€ā”€ contracts/ # Solidity contracts
│ ā”œā”€ā”€ scripts/ # Deployment scripts
│ └── hardhat.config.js
│
ā”œā”€ā”€ database/ # Database Setup
│ ā”œā”€ā”€ migrations/ # SQL migration files
│ └── seeds/ # Sample data
│
ā”œā”€ā”€ docker/ # Container Configuration
│ ā”œā”€ā”€ docker-compose.yml # Multi-service orchestration
│ └── Dockerfile.* # Service-specific containers
│
└── docs/ # Documentation
ā”œā”€ā”€ api.md # API documentation
ā”œā”€ā”€ setup.md # Setup instructions
└── architecture.md # System architecture

šŸš€ Quick Start

Prerequisites

Node.js 18+ and npm
PostgreSQL 15+ with PostGIS extension
Python 3.9+ for AI service
Redis for caching
Mapbox account for maps

Environment Setup

Clone the repository
git clone <repository-url>
cd police-dashboard
Backend Setup
cd backend
npm install
cp .env.example .env
# Configure your environment variables
npm run dev
Frontend Setup
cd frontend
npm install
cp .env.example .env
# Configure your environment variables
npm start
Database Setup
# Create PostgreSQL database
createdb tourist_safety_db

# Run migrations
psql -d tourist_safety_db -f database/migrations/001_initial_schema.sql
Docker Setup (Alternative)
docker-compose up -d

šŸ”§ Core Features

Real-Time Dashboard

Live Map Visualization: Interactive map showing all active tourists with color-coded status indicators
Alert Management: Real-time alert feed with priority-based sorting and acknowledgment system
Tourist Tracking: Detailed tourist profiles with location history and emergency contacts
Incident Reporting: Streamlined incident creation and E-FIR generation

AI-Powered Safety

Anomaly Detection: Machine learning algorithms detect unusual behavior patterns
Geo-fence Monitoring: Automatic alerts when tourists enter high-risk zones
Group Cohesion Analysis: Monitor travel groups and detect when members become separated
Predictive Risk Assessment: AI-driven risk level calculations

Real-Time Communication

WebSocket Integration: Instant alert broadcasting to all connected dashboards
Mobile App Integration: Real-time location updates from tourist mobile apps
Emergency Response: Immediate notification system for panic button activations
Multi-User Support: Multiple officers can monitor and respond simultaneously

Security & Privacy

Blockchain Identity: NFT-based digital IDs on Polygon network
End-to-End Encryption: Secure data transmission and storage
Role-Based Access: Granular permissions for different user types
Audit Trail: Complete logging of all system activities

šŸ“Š Key Technologies

Frontend Stack

React 18: Modern component-based UI framework
Material-UI v5: Professional component library
Redux Toolkit: Predictable state management
MapBox GL JS: Advanced mapping and visualization
Socket.IO Client: Real-time communication
Axios: HTTP client for API calls

Backend Stack

Node.js + Express: High-performance server framework
PostgreSQL + PostGIS: Geospatial database
Sequelize ORM: Database abstraction layer
Socket.IO: Real-time WebSocket server
JWT: Secure authentication
Helmet + CORS: Security middleware

AI/ML Stack

Python + FastAPI: ML service framework
Scikit-learn: Machine learning algorithms
TensorFlow/PyTorch: Deep learning capabilities
DBSCAN: Clustering algorithm for group analysis
Pandas + NumPy: Data processing

Blockchain Stack

Solidity: Smart contract development
Hardhat: Development environment
Ethers.js: Blockchain interaction library
Polygon: Layer 2 scaling solution

🌟 Advanced Features

Heatmap Generation

Real-time density maps showing tourist concentration and risk zones using Kernel Density Estimation algorithms.

Route Optimization

AI-powered safe route suggestions using A* pathfinding algorithm with real-time safety data integration.

Multi-language Support

React-i18next integration supporting 10+ Indian languages with voice command capabilities.

Emergency Response Integration

Direct integration with emergency services, automatic SMS alerts via Twilio, and escalation protocols.

šŸ“± Mobile App Integration

The dashboard integrates with a companion mobile app that provides:
GPS tracking with configurable update intervals
Panic button with 10-second confirmation
Geo-fence boundary notifications
Digital passport and NFT stamp collection
Multi-language voice commands

šŸ”’ Security Measures

TLS 1.3 Encryption: All data in transit
AES-256 Encryption: Sensitive data at rest
Rate Limiting: API protection against abuse
Input Validation: Comprehensive data sanitization
RBAC: Role-based access control
Audit Logging: Complete activity tracking

šŸƒā€ā™‚ļø Getting Started

Follow the environment setup instructions above
Configure your Mapbox API token
Set up PostgreSQL with PostGIS extension
Run database migrations
Start the backend server
Launch the frontend application
Access the dashboard at http://localhost:3000

šŸ“– API Documentation

The system provides comprehensive REST API endpoints:
Tourist Management: CRUD operations for tourist data
Alert System: Real-time alert creation and management
Incident Reporting: Incident lifecycle management
Authentication: JWT-based user authentication
Geospatial Queries: Location-based data retrieval
For detailed API documentation, see /docs/api.md

šŸ¤ Contributing

Fork the repository
Create a feature branch
Commit your changes
Push to the branch
Create a Pull Request

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

šŸ“ž Support

For support and questions, please contact the development team or create an issue in the repository.
Built with ā¤ļø for Tourist Safety in India
Like this project

Posted Oct 24, 2025

Developed a real-time police dashboard for tourist safety in India using modern web technologies and AI.