Skip to content

gennitdev/phx_data_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phoenix Missing Persons Data Backend

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.

Setup

  1. Install dependencies:

    npm install
  2. 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
    
  3. Ensure your database has the required tables:

    • missing_persons (raw data)
    • missing_persons_parsed (processed data with date parsing)

Development

Start the development server:

npm run dev

The server will run on http://localhost:3001

API Endpoints

  • GET /api/analytics/kpi - Key performance indicators
  • GET /api/analytics/monthly-reports - Monthly reports with rolling averages
  • GET /api/analytics/monthly-reports-with-anomaly - Monthly reports with anomaly detection
  • GET /api/analytics/time-to-located-histogram - Time to located distribution
  • GET /api/analytics/demographics/misstype - Demographics by missing type (adult or juvenile)
  • GET /api/analytics/demographics/sex - Demographics by sex
  • GET /api/analytics/demographics/race - Demographics by race
  • GET /health - Health check endpoint

Production

Build and start:

npm run build
npm start

About

A backend to serve some data published by the Phoenix government. Data source: https://www.phoenixopendata.com/dataset/missing-persons

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •