How jimmynootnoot/crimeheat works
PPALMA is a web tool for exploring crime incidents, DBSCAN hotspots, and cross-year persistence across six municipalities. The main user workflow is to sign in, choose filters and a map mode, inspect analysis results, and optionally upload, validate, and (as an admin) commit incident data or download reports. The graph includes documented dashboard, records, and reporting capabilities as well. Unsampled route and map implementations limit some call-level links; those relationships are omitted rather than inferred.
Main entry points: endpoints.ts API endpoints · App.tsx App routes · models Domain records · auth.py Authentication routes
Components 25
Web interface
- App routes
frontend/src/App.tsx - Auth context
frontend/src/context/AuthContext.tsx - API client
frontend/src/api/client.ts - API endpoints
frontend/src/api/endpoints.ts - Dashboard page
frontend/src/pages/DashboardPage.tsx - Map page and layers
frontend/src/pages/MapPage.tsx - Incident records
frontend/src/pages/RecordsPage.tsx - Upload workflow
frontend/src/pages/UploadPage.tsx - Reports page
frontend/src/pages/ReportsPage.tsx
API and access
- Authentication routes
backend/app/api/routes/auth.py - Incident routes
backend/app/api/routes/incidents.py - Upload routes
backend/app/api/routes/upload.py - Analysis routes
backend/app/api/routes - Report routes
backend/app/api/routes/reports.py - Dashboard routes
backend/app/api/routes/dashboard.py - JWT and roles
backend/app/core/security.py
Analysis and imports
- Import validation
backend/app/services/import_service.py - DBSCAN clustering
backend/app/services/clustering.py - Persistence matching
backend/app/services/persistence_service.py - Crime taxonomy
backend/app/core/taxonomy.py
Data and audit
- Database sessions
backend/app/db/session.py - Domain records
backend/app/models - Audit logging
backend/app/services/audit_service.py
Other components
- Analyst or admin
- PostgreSQL / PostGIS
Connections 30
- Analyst or admin → App routes: uses
- App routes → Dashboard page: routes to
frontend/src/App.tsx - App routes → Map page and layers: routes to
frontend/src/App.tsx - App routes → Incident records: routes to
frontend/src/App.tsx - App routes → Upload workflow: routes to
frontend/src/App.tsx - App routes → Reports page: routes to
frontend/src/App.tsx - Auth context → API client: sends auth requests
frontend/src/context/AuthContext.tsx - API endpoints → API client: uses
frontend/src/api/endpoints.ts - Dashboard page → API endpoints: fetches summary
frontend/src/pages/DashboardPage.tsx - Incident records → API endpoints: fetches and deletes
frontend/src/pages/RecordsPage.tsx - Upload workflow → API endpoints: previews and commits
frontend/src/pages/UploadPage.tsx - Upload routes → Import validation: validates imports
backend/app/api/routes/upload.py - Import validation → Crime taxonomy: normalizes crimes
backend/app/services/import_service.py - Authentication routes → JWT and roles: creates and verifies tokens
backend/app/api/routes/auth.py - Authentication routes → Audit logging: records actions
backend/app/api/routes/auth.py - Authentication routes → Database sessions: uses session
backend/app/api/routes/auth.py - Incident routes → Audit logging: records deletions
backend/app/api/routes/incidents.py - Report routes → Database sessions: queries data
backend/app/api/routes/reports.py - Analysis routes → DBSCAN clustering: runs clustering
- Analysis routes → Persistence matching: runs matching
- DBSCAN clustering → Domain records: reads incidents
- Persistence matching → Domain records: reads and writes
backend/app/services/persistence_service.py - Import validation → Domain records: inserts incidents
backend/app/services/import_service.py - Database sessions → PostgreSQL / PostGIS: opens sessions
backend/app/db/session.py - Audit logging → Domain records: writes audit entries
backend/app/services/audit_service.py - API endpoints → Analysis routes: requests analysis
frontend/src/api/endpoints.ts - API endpoints → Incident routes: requests incidents
frontend/src/api/endpoints.ts - API endpoints → Upload routes: requests imports
frontend/src/api/endpoints.ts - API endpoints → Report routes: requests reports
frontend/src/api/endpoints.ts - API endpoints → Dashboard routes: requests summary
frontend/src/api/endpoints.ts