Express.js TypeScript backend for serving Phoenix Police Department missing persons data analytics.
Disclaimer: This project is for technical demonstration and civic awareness purposes. It is not intended to replace official reporting or investigative work.
-
Install dependencies:
npm install
-
Configure environment:
cp .env.example .env
Edit
.env
and add your Neon PostgreSQL connection string:DATABASE_URL=postgresql://username:[email protected]/dbname?sslmode=require PORT=3001
-
Ensure your database has the required tables:
missing_persons
(raw data)missing_persons_parsed
(processed data with date parsing)
Start the development server:
npm run dev
The server will run on http://localhost:3001
GET /api/analytics/kpi
- Key performance indicatorsGET /api/analytics/monthly-reports
- Monthly reports with rolling averagesGET /api/analytics/monthly-reports-with-anomaly
- Monthly reports with anomaly detectionGET /api/analytics/time-to-located-histogram
- Time to located distributionGET /api/analytics/demographics/misstype
- Demographics by missing type (adult or juvenile)GET /api/analytics/demographics/sex
- Demographics by sexGET /api/analytics/demographics/race
- Demographics by raceGET /health
- Health check endpoint
Build and start:
npm run build
npm start