Skip to content

Repository files navigation

NYC Tree11

Pipeline status: The application now consumes validated assets generated by the installable package in pipeline/. Use python -m tree11_pipeline.cli build --fixture for a reproducible local build or build --full for the configured NYC Open Data analysis window. The weekly refresh workflow publishes only public/data artifacts; fetch_server/ is retained as deprecated historical reference.

Tree11 is a public-data dashboard that explains how tree-related NYC 311 service requests progress through NYC Parks inspections and work orders. It was created through a Cornell Tech and New York City Department of Parks and Recreation collaboration.

Lifecycle assets preserve source event time, source update time, and Tree11 observation time separately. They retain compact state deltas rather than raw source exports; see docs/architecture/lifecycle-history.md.

The research layer publishes compact, validated operational artifacts under public/data/research/ and public/data/quality/; the /analysis page exposes backlog, lifecycle, cohort coverage, geography, and data-quality disclosures. See docs/methodology/research-metrics.md.

Production: tree11.org

Tree11 dashboard

Current status

The Next.js 16 application is connected to a reproducible Python batch pipeline. Fixture builds support local work and PR CI, while a weekly workflow can refresh the configured NYC Open Data window and commit only validated serving assets.

Architecture

  • pages/: Next.js Pages Router pages and two API routes.
  • components/: Mapbox map, Chart.js visualizations, navigation, header, and footer.
  • pages/styles/ and component SCSS modules: visual styling.
  • pipeline/: installable ingestion, canonicalization, transformation, validation, and publication package.
  • public/data/: generated browser contracts: summary, chart JSON, minimal map GeoJSON, history, and manifest.
  • data/ and fetch_server/: retained historical snapshots and deprecated pipeline reference.
  • notebooks/: exploratory data preparation and analysis.

The homepage and primary metric/deep-dive views consume generated JSON. Browser CSV parsing and manually synchronized chart arrays are no longer part of these active paths.

Local setup

Prerequisites:

  • Node.js 22.14.0 (recorded in .nvmrc)
  • npm 11 or a compatible npm version

Install and run:

npm ci
npm run dev

Open http://localhost:3000.

Create .env.local from .env.example. Without a Mapbox token the map shows a useful configuration error and the rest of the application remains available.

Environment variables

Variable Scope Purpose
NEXT_PUBLIC_MAPBOX_TOKEN Browser/public Mapbox map access token. Restrict it to approved website origins.
NEXT_PUBLIC_MAPBOX_STYLE Browser/public Optional map style; defaults to Mapbox Streets.
SOCRATA_APP_TOKEN Pipeline only Optional token for higher NYC Open Data API limits.
TREE11_ANALYSIS_START Pipeline only Earliest source createddate; defaults to 2022-01-01.

Never commit .env.local or real credentials.

Scripts

Command Purpose
npm run dev Start the Next.js development server.
npm run build Create an optimized production build.
npm start Serve a completed production build.
npm run lint Run the Next.js ESLint rules.

Pipeline tests cover deterministic pagination, bounded retries, source identity, relationship quality, transformations, history, and atomic publication. CI also runs fixture build/validation plus frontend lint and production build.

Data sources

The research pipeline references these NYC Open Data datasets:

The data files in this repository are historical snapshots. Running fetch_server/fetch.py is not currently a supported update procedure: it has known state, pagination, validation, and publication defects documented in the audit.

Validation

Before opening a pull request, run:

npm ci
npm run lint
npm run build
npm audit

GitHub Actions repeats install, lint, optional tests, and build for pull requests and pushes to main.

Deployment

The repository is believed to be connected to Vercel, with main serving the production domain. Confirm the Git repository, production branch, Node.js version, environment variables, and www.tree11.org domain in the Vercel project before a production release.

Pushing a branch should create a preview deployment when the Git integration is active. Merging into the configured production branch may deploy automatically. This repository does not contain enough configuration to prove the current Vercel project settings.

Troubleshooting

  • If next is not recognized, run npm ci first.
  • If linting displays a setup prompt, confirm .eslintrc.json exists.
  • A build may warn when Google Fonts cannot be downloaded. The current code loads Six Caps remotely; self-hosting it is planned for a later phase.
  • Map loading depends on a valid Mapbox token, the external Mapbox style, and public/tree11_collection.geojson.
  • The production dependency audit currently reports zero known vulnerabilities. The complete development tree still has two high-severity transitive findings in the lint toolchain; keep the lockfile and framework patches current.

About

Web application of NYC OpenData collaborated with NYCDPR.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages