How mohithbs-stack/ksp-crime-ai works
KSP Crime Intelligence AI is a role-based police operations and crime-intelligence web application. Officers sign in, enter protected workspaces, and use case management or intelligence tools to inspect records and receive grounded query results; the README also describes dashboards, relationship graphs, GIS hotspots, analytics, and decision support. The UI is a React feature-page layer with shared layout and state, backed by crime and intelligence services plus demo data and an optional Catalyst datastore. Several capabilities are documented but their implementation was not sampled, so those branches show documented scope without speculative service links.
Main entry points: index.tsx Protected routing · PageShell.tsx Shared page wrapper · CasesPage.tsx Case management · ChatbotPage.tsx Intelligence assistant
Components 22
Access and shell
- Application
src/App.tsx - Protected routing
src/router/index.tsx - Sign-in page
src/pages/AuthPage.tsx - Login
src/features/auth/Login.tsx - Session and roles
src/store/index.ts - Application shell
src/components/layout/AppShell.tsx - Shared page wrapper
src/components/ui/PageShell.tsx
Investigation tools
- Operations dashboard
src/features/dashboard/Dashboard.tsx - Case management
src/features/cases/CasesPage.tsx - Criminal relationship graph
src/features/suspects/RelationshipPage.tsx - Evidence vault
src/features/evidence/EvidencePage.tsx - Reports
src/features/reports/ReportsPage.tsx
Analysis and intelligence
- Crime analytics
src/features/analytics/AnalyticsPage.tsx - GIS hotspots
src/features/hotspots/HotspotsPage.tsx - Decision support
src/features/cases/DecisionSupportPage.tsx - Intelligence assistant
src/features/intelligence/ChatbotPage.tsx
Services and data
- Query and evidence engine
src/services/intelligenceEngine.ts - Crime service
src/services/crimeService.ts - Seeded crime records
src/services/mockDb.ts - Catalyst datastore
src/services/catalystDataStore.ts
Other components
- Police user
- Google Gemini API
Connections 27
- Police user → Application: uses
- Application → Protected routing: renders
src/App.tsx - Protected routing → Sign-in page: routes login
src/router/index.tsx - Sign-in page → Login: shows
src/pages/AuthPage.tsx - Login → Session and roles: authenticates
src/features/auth/Login.tsx - Protected routing → Application shell: wraps protected pages
src/router/index.tsx - Protected routing → Operations dashboard: routes
src/router/index.tsx - Protected routing → Case management: routes
src/router/index.tsx - Protected routing → Criminal relationship graph: routes
src/router/index.tsx - Protected routing → Crime analytics: routes
src/router/index.tsx - Protected routing → GIS hotspots: routes
src/router/index.tsx - Protected routing → Intelligence assistant: routes
src/router/index.tsx - Protected routing → Evidence vault: routes
src/router/index.tsx - Protected routing → Reports: routes
src/router/index.tsx - Case management → Crime service: queries cases
src/features/cases/CasesPage.tsx - Crime service → Catalyst datastore: queries datastore
src/services/crimeService.ts - Crime service → Seeded crime records: falls back to
src/services/crimeService.ts - Intelligence assistant → Query and evidence engine: submits query
src/features/intelligence/ChatbotPage.tsx - Query and evidence engine → Seeded crime records: executes grounded queries
src/services/intelligenceEngine.ts - Query and evidence engine → Google Gemini API: requests generation
src/services/intelligenceEngine.ts - Case management → Shared page wrapper: uses wrapper
src/features/cases/CasesPage.tsx - Operations dashboard → Shared page wrapper: uses wrapper
src/features/dashboard/Dashboard.tsx - Crime analytics → Shared page wrapper: uses wrapper
src/features/analytics/AnalyticsPage.tsx - GIS hotspots → Shared page wrapper: uses wrapper
src/features/hotspots/HotspotsPage.tsx - Intelligence assistant → Shared page wrapper: uses wrapper
src/features/intelligence/ChatbotPage.tsx - Criminal relationship graph → Shared page wrapper: uses wrapper
src/features/suspects/RelationshipPage.tsx - Decision support → Case management: supports investigation