CrimeScope AI is a high-performance, real-time crime intelligence and geospatial analytics platform designed to serve as the central nervous system for smart city law enforcement and public safety authorities.
The platform transforms raw, heterogeneous data into actionable intelligence through a sophisticated pipeline of NLP classification, geospatial enrichment, and predictive analytics.
- Core Value Proposition
- Visual Experience
- System Architecture
- Deep Dive: How it Works
- Technical Stack
- Key Features
- Installation & Setup
- Design Philosophy
- Performance & Scalability
- Roadmap
| Stakeholder | Benefit |
|---|---|
| Patrol Officers | Real-time mobile alerts with geo-context for rapid response. |
| Crime Analysts | Temporal pattern analysis, drill-down investigation, and source traceability. |
| Command Staff | Strategic overview dashboards for predictive resource allocation. |
| City Officials | Data-driven policy insights and community safety transparency. |
The main dashboard features a full-bleed interactive heatmap with glassmorphism overlays.
Comprehensive data visualization showing temporal patterns and crime distributions.
Real-time hotspot detection using Kernel Density Estimation (KDE) algorithms.
Detailed incident analysis including source provenance and NLP classification confidence.
graph TD
subgraph "Data Ingestion"
A1[News RSS Feeds] --> B[Data Ingestor]
A2[Twitter/X Stream] --> B
A3[Gov Data Portals] --> B
end
subgraph "Intelligence Engine"
B --> C[NLP Pipeline]
C --> C1[Crime Classifier]
C --> C2[NER Entity Extraction]
C1 --> D[Data Enrichment]
C2 --> D
D --> D1[Geocoding Service]
D1 --> E[Deduplicator]
end
subgraph "Storage & API"
E --> F[(SQLite - better-sqlite3)]
F --> G[Express.js API]
F --> H[Socket.io Server]
end
subgraph "Frontend Interface"
G --> I[Next.js Dashboard]
H --> I
I --> J1[Heatmap Canvas]
I --> J2[Recharts Analytics]
I --> J3[Live Alert Feed]
end
The system uses a custom NLP engine (powered by compromise.js) to process raw text. It extracts:
- Crime Type: Categorization into 9+ types (Theft, Assault, Cybercrime, etc.).
- Severity: Real-time risk assessment (Critical, High, Medium, Low).
- Entities: Extraction of location names, person names, and organizations.
Extracted location names are passed through a geocoding service to resolve precise latitude/longitude coordinates, which are then projected onto the heatmap using a WebGL-accelerated rendering layer.
The system correlates reports from multiple sources (e.g., a news report and a tweet about the same incident) to reduce noise and provide a single "source of truth" with a provenance chain.
- Frontend: Next.js 15 (App Router), React 18, Zustand (State), Framer Motion (Animations).
- Maps: Leaflet.js with
leaflet.heatfor density visualization. - Charts: Recharts for responsive, animated temporal data.
- Backend: Node.js 20+, Express.js.
- Real-time: Socket.io for sub-500ms latency event broadcasting.
- Database: SQLite via
better-sqlite3for high-concurrency, zero-config storage. - Styling: CSS Modules with a custom Design Token system (Glassmorphism).
- Node.js (v20 or higher)
- npm or yarn
-
Clone the Project
git clone https://github.com/your-username/crimescope-ai.git cd crimescope-ai -
Install Workspace Dependencies
cd app_build npm install -
Development Mode
# Run both Backend and Frontend npm run start # Backend: http://localhost:3000 npm run dev # Frontend: http://localhost:3001
"Command Center Aesthetics" — The UI is inspired by a blend of Bloomberg Terminal's data density and Palantir Gotham's sophisticated dark mode.
- Glassmorphism: Layers use backdrop-blur and subtle borders to create depth.
- Micro-animations: Every interaction (hover, alert, map transition) is smoothed with Framer Motion.
- High Contrast: Critical alerts use vibrant severity colors against a deep navy background (
#0a0e1a).
- Sub-2s Page Load: Optimized Next.js hydration and dynamic imports for heavy map components.
- Real-time Latency: < 500ms from event ingestion to dashboard update via WebSocket.
- Data Volume: Capable of rendering 10,000+ incidents on the heatmap without frame drops using WebGL acceleration.
- Phase 1: Core NLP Pipeline & Real-time Heatmap.
- Phase 2: Advanced Predictive Modeling (Hotspot Forecasting).
- Phase 3: PostGIS integration for complex spatial queries.
- Phase 4: Multi-agency data sharing protocols (GDPR compliant).
Contributions are what make the open source community such an amazing place to learn, inspire, and create.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Built with ❤️ by Ashwin for a safer, smarter future.