Skip to content

ahamedfo/citypulse

Repository files navigation

CityPulse — NYC Housing Policy Impact Map

Live Demo: citypulse-one.vercel.app

CityPulse is an interactive map that shows how housing policy affects every neighborhood in New York City. It covers all 59 community districts with real data on rent burden, displacement risk, median rent, and housing vulnerability.

Users can simulate policy changes — like federal funding cuts or new construction — and watch the map update in real time. An AI chat lets you paste any news headline and see how it would ripple across the city.

Why We Built It

New York City is in its worst housing crisis since 1968, with a vacancy rate of just 1.4%. Policy decisions at the federal, state, and city level directly affect millions of renters — but it's hard to see how those decisions play out across different neighborhoods.

CityPulse makes that connection visible. Instead of reading about policy in the abstract, you can see exactly which communities get hit hardest when HUD funding gets cut, or which neighborhoods benefit most from new construction.

We also wanted to show how AI can make complex data accessible. Claude analyzes each district's housing situation and explains it in plain language. The "What's Happening Now" feature uses LinkUp to pull real-time news and automatically maps it to policy impacts.

How to Use It

  1. Pick a metric — Choose what to visualize: income spent on rent, displacement risk, monthly rent levels, or overall housing vulnerability. The map colors each of NYC's 59 districts accordingly.

  2. Run a scenario — Click one of the preset cards (like "Federal Housing Cut" or "More Housing") to see how that policy change would affect every neighborhood. Or drag the three sliders yourself: Rental Assistance, Rent Protections, and New Construction.

  3. Read the live news — Hit "What's Happening Now" to pull current housing news via LinkUp. CityPulse reads the articles, figures out which policy levers are affected, and updates the map automatically.

  4. Click a district — Select any district on the map to see its detailed stats: rent burden, median rent, income levels, and more. Click "Analyze with Claude" for an AI-written summary of that neighborhood's housing situation.

  5. Chat with it — Open the AI chat and paste any headline, policy proposal, or question. CityPulse will reason about how it affects NYC housing and update the map to match.

  6. Get resources — After the map updates from a policy change, click "Get help" for links to NYC housing resources like the Tenant Hotline, Housing Connect lotteries, and Right to Counsel.

Tech Stack

Layer Technology
Framework Next.js 16 (App Router, TypeScript, Turbopack)
Map Mapbox GL JS with GeoJSON choropleth layers
Styling Tailwind CSS + inline styles
AI Analysis Claude Sonnet 4.6 (streaming chat + district analysis)
AI Summaries Claude Haiku 4.5 (severity scores + preset descriptions)
Real-Time News LinkUp API (web search for current housing news)
Data NYU Furman Center, NYC Open Data, HUD, NYCHA
Hosting Vercel

Architecture

All state lives in app/page.tsx. No external state libraries — just React hooks.

  • 3 policy sliders map to real-world levers: federal rental assistance (Section 8/HUD vouchers), rent stabilization protections, and new housing construction/rezoning
  • Simulation model applies additive heuristics to each district's real data based on slider positions
  • Chat-to-map pipeline: Claude reads any input, reasons about housing impact, outputs a hidden <<POLICY:...>> command that adjusts the sliders automatically
  • LinkUp integration: searches for current NYC housing news, feeds articles to Claude, which maps them to the three policy levers

Running Locally

# Clone the repo
git clone https://github.com/ahamedfo/citypulse.git
cd citypulse

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local

Add your API keys to .env.local:

ANTHROPIC_API_KEY=your-anthropic-api-key
NEXT_PUBLIC_MAPBOX_TOKEN=your-mapbox-public-token
LINKUP_API_KEY=your-linkup-api-key
  • Mapbox token — Get a free one at mapbox.com. Use a public token (starts with pk.).
  • Anthropic API key — Get one at console.anthropic.com.
  • LinkUp API key — Get one at app.linkup.so. The "What's Happening Now" feature won't work without this, but everything else will.
# Start the dev server
npm run dev

Open http://localhost:3000.

Data Sources

  • NYU Furman Center — Rent burden, median rent, median income by community district
  • NYC Open Data — Community district boundaries (GeoJSON), housing unit counts, vacancy rates
  • HUD — Section 8 voucher coverage, public housing locations
  • NYCHA — Public housing presence by district

All district data covers NYC's 59 community districts across Manhattan, Brooklyn, Queens, the Bronx, and Staten Island.

Team

Built for the hackathon by the CityPulse team. AI-assisted development with Claude.

About

NYC Housing Policy Impact Map — Interactive choropleth with AI-powered analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors