How jojofunjourney/safecityweb works
Crime Tracker is a Next.js application for selecting a location and time range, then fetching and displaying local crime statistics. The main flow runs from the home page through location controls and the app’s fetch action to its crime API, which queries city open-data services and returns aggregate results for dashboard panels. Separate routes support historical crime, total-crime, safety-score and map operations. The README describes maps as a placeholder; sampled code confirms address lookup and a map component, but does not establish map rendering or all unsampled route behavior.
Components 24
Application UI
- Home Page
src/app/page.tsx - Tracker Workflow
src/components/layout/CrimeTrackerApp.tsx - Location Controls
src/components/containers/LocationContainer.tsx - Address Input
src/components/inputs/AddressInput.tsx - Time Range
src/components/inputs/TimeRangeSelector.tsx - Crime Map
src/components/crime/CrimeMap.tsx - Summary Panels
src/components/panels - History Page
src/app/crime-history/page.tsx - Total Crimes Page
src/app/total-crimes/page.tsx - Safety Page
src/app/safety-score/page.tsx
Crime Analysis
- Crime History
src/components/crime/CrimeHistory.tsx - Total Crime View
src/components/crime/TotalCrime.tsx - Safety Score View
src/components/safety/SafetyScore.tsx - Crime Data Types
src/types/crimeData.ts
API and Services
- Crime API
src/app/api/crime/route.ts - Home API
src/app/api/home/route.ts - Coordinates API
src/app/api/map/coordinates/route.ts - Map Route API
src/app/api/map/route/route.ts - Crime Data Service
src/services/crimeService.ts - Geocoding Service
src/services/mapService.ts - Client API
src/lib/api.ts
External Data
- City Open Data
- Google Geocoding
Other components
- User
Connections 20
- User → Home Page: opens
README.md - Home Page → Tracker Workflow: renders
src/app/page.tsx - Tracker Workflow → Location Controls: renders
src/components/layout/CrimeTrackerApp.tsx - Location Controls → Address Input: renders
src/components/containers/LocationContainer.tsx - Location Controls → Time Range: renders
src/components/containers/LocationContainer.tsx - Location Controls → Crime Map: renders
src/components/containers/LocationContainer.tsx - Address Input → Tracker Workflow: selects location
src/components/layout/CrimeTrackerApp.tsx - Tracker Workflow → Client API: requests data
src/components/layout/CrimeTrackerApp.tsx - Client API → Crime API: HTTP request
src/lib/api.ts - Crime API → Crime Data Service: fetches crime data
src/app/api/crime/route.ts - Crime Data Service → City Open Data: queries
src/services/crimeService.ts - Crime API → Crime Data Types: uses response types
src/app/api/crime/route.ts - Tracker Workflow → Summary Panels: renders results
src/components/layout/CrimeTrackerApp.tsx - History Page → Crime History: renders
src/app/crime-history/page.tsx - Total Crimes Page → Total Crime View: renders
src/app/total-crimes/page.tsx - Safety Page → Safety Score View: renders
src/app/safety-score/page.tsx - Address Input → Client API: requests coordinates lookup
src/components/inputs/AddressInput.tsx - Client API → Coordinates API: HTTP request
src/lib/api.ts - Coordinates API → Geocoding Service: geocodes coordinates
src/app/api/map/coordinates/route.ts - Geocoding Service → Google Geocoding: geocoding request
src/services/mapService.ts