How ke1ruuu/securetanza works
SecureTanza is a crime-incident mapping, analytics, and administration application. The main user flow is viewing incidents on the public map or dashboard, requesting filtered crime data, and exploring geographic and time-based patterns; authorized staff can upload spreadsheets, where records are mapped, deduplicated, stored, and evaluated for notifications. Separate administration capabilities cover users, audit logs, backups, notifications, and performance. The tree and excerpts support these subsystem boundaries, but many UI-to-API links and unsampled service internals are not shown, so those connections are omitted.
Main entry points: prisma.ts Database access · upload/route.ts Spreadsheet upload · performance/route.ts Performance API · page.tsx Crime map
Components 20
User experience
- Crime map
app/map/page.tsx - Dashboard views
app/dashboard/page.tsx - Map layers and controls
components/map/tanza-map-root.tsx - Analytics and reports
components/dashboard/analytics-tab.tsx
Crime data
- Crime API
backend/api/crimes/route.ts - Spreadsheet upload
backend/api/crimes/upload/route.ts - Crime services
backend/services/crime.service.ts - Barangay mapping
backend/lib/barangay-mapper.ts - Crime deduplication
backend/lib/crime-deduplication.ts - Notification analysis
backend/lib/notification-engine.ts
Administration
- Notification management API
app/api/notifications/route.ts - User administration API
app/api/users/route.ts - Audit log API
app/api/audit-logs/route.ts - Backup API
app/api/backups/route.ts - Performance API
app/api/system/performance/route.ts - Backup service
backend/services/backup.service.ts
Runtime infrastructure
- Read-through cache
backend/cache/cache.service.ts - Database access
backend/lib/prisma.ts - PostgreSQL
backend/config/database.ts
Other components
- Public and staff users
Connections 17
- Public and staff users → Crime map: opens map
- Public and staff users → Dashboard views: opens dashboard
- Crime map → Map layers and controls: renders map
- Dashboard views → Analytics and reports: shows analysis
- Crime API → Crime services: requests crime data
- Spreadsheet upload → Barangay mapping: maps names
- Spreadsheet upload → Crime deduplication: checks duplicates
- Spreadsheet upload → Database access: writes incidents
- Spreadsheet upload → Notification analysis: evaluates batch
- Notification analysis → Database access: persists notifications
- Notification management API → Database access: reads and updates
- User administration API → Database access: manages accounts
- Audit log API → Database access: reads and writes logs
- Backup API → Backup service: requests backups
- Performance API → Database access: measures database
- Performance API → Read-through cache: reads and clears
- Database access → PostgreSQL: accesses