How asadsoomr0/boston-311-pipeline works
Boston 311 Service Request Map combines a daily two-feed ingestion pipeline with a static, browser-side map. The workflow fetches both CKAN resources, normalizes and resolves cases, upserts them to PostgreSQL, then precomputes JSON for neighborhood rates, response times, metadata and recent-case drill-down. The frontend loads those artifacts and supports category/status filters, neighborhood exploration, response-time views and case pins. README documents automatic daily updates and an optional local Airflow wrapper; workflow orchestration details are not otherwise mapped. Frontend runtime connections are limited to the sampled excerpts.
Main entry points: run.py Pipeline runner · build.py Static data build · load.py Schema and upserts · app.js Map and case views
Components 18
Ingestion pipeline
- Fetch 311 feeds
pipeline/extract.py - Normalize cases
pipeline/transform.py - Resolve neighborhoods
pipeline/transform.py - Pipeline runner
pipeline/run.py - Pipeline settings
pipeline/config.py
Warehouse and build
- Topic categories
pipeline/topic_categories.csv - Schema and upserts
pipeline/load.py - Postgres warehouse
- Static data build
pipeline/build.py - Neighborhood population seed
pipeline/seed.py
Interactive map
- Map JSON data
- Map and case views
frontend/app.js - Neighborhood geometry
frontend/boston_neighborhoods.json - Map configuration
frontend/config.js
Scheduling
- Airflow DAG
dags/update_311_data.py
Other components
- Analyze Boston CKAN
- Map visitor
- Basemap tiles
Connections 23
- Pipeline runner → Fetch 311 feeds: fetches feeds
pipeline/run.py - Fetch 311 feeds → Analyze Boston CKAN: queries
pipeline/extract.py - Pipeline runner → Normalize cases: normalizes records
pipeline/run.py - Pipeline runner → Resolve neighborhoods: resolves neighborhoods
pipeline/run.py - Resolve neighborhoods → Neighborhood geometry: reads geometry
- Pipeline runner → Schema and upserts: upserts cases
pipeline/run.py - Schema and upserts → Postgres warehouse: writes cases
pipeline/load.py - Schema and upserts → Topic categories: reads mappings
pipeline/load.py - Schema and upserts → Postgres warehouse: syncs mappings
pipeline/load.py - Pipeline runner → Static data build: builds site data
pipeline/run.py - Static data build → Postgres warehouse: queries warehouse
pipeline/build.py - Static data build → Schema and upserts: reads topic mappings
pipeline/build.py - Static data build → Normalize cases: cleans topics
pipeline/build.py - Static data build → Map JSON data: writes JSON
pipeline/build.py - Map and case views → Map JSON data: loads data
- Map and case views → Neighborhood geometry: renders boundaries
- Map visitor → Map and case views: filters and explores
frontend/app.js - Map and case views → Basemap tiles: loads tiles
frontend/app.js - Map and case views → Map configuration: uses settings
- Airflow DAG → Pipeline runner: runs ingestion
dags/update_311_data.py - Airflow DAG → Static data build: runs build
dags/update_311_data.py - Airflow DAG → Schema and upserts: prepares warehouse
dags/update_311_data.py - Neighborhood population seed → Postgres warehouse: seeds populations
pipeline/seed.py