Campgrounds & Campsites: a first-class, multi-agency pillar (data, availability, Camp Watch, trip + ranger + viz)#27
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns campgrounds from a campground-level detail hiding inside park pages into a first-class
TrailGraph pillar — site-level data, live availability + cancellation alerting, multi-agency
coverage, and deep Map / Plan / ranger / data-viz integration — built entirely on open,
attributable data (RIDB · USFS · OSM/Overpass). Extends the existing
:Campgroundspine; thealready-parsed
ridbIdis the federation key, so the federal import unifies with NPS campgroundsin place instead of duplicating.
82 files, +5,501 / −17. 956 unit tests · 18 campground integration tests · 8 campgrounds +
15 hydration e2e ·
eve info0 errors · cleanpnpm build. Each phase was driven live in thebrowser before merge (live testing caught two real bugs — see below).
Phase 1 — Federal data foundation + Campgrounds tab
:Campsite(HAS_SITE),:Agency(MANAGED_BY),:RecArea(IN_RECAREA),(:Campground)-[:NEAR {miles}]->(:Park)+NEAR_TRAILHEAD→:Trail(migrations 026/027).lib/datasources/ridb.ts+sync-campgrounds-ridb/sync-campsites-ridb): unifiesNPS↔RIDB by
ridbId(no duplicates,source='nps+ridb'), checkpointed/resumable, ~100k sites.lib/campgrounds.tsquery layer (searchCampgrounds/campgroundDetail/campgroundFacets),/campgroundsfaceted finder +CampgroundCard+/campgrounds/[id]site-level detail, nav + search.Phase 2 — Availability + Camp Watch (built, gated OFF)
lib/datasources/campAvailability.ts(the rec.gov endpoint is unofficial → hard-gated byCAMP_AVAILABILITY_ENABLED, ships OFF; every surface degrades to a recreation.gov deep link, withbackoff + a clear UA). On-demand
/api/campgrounds/availability(rate-limited) + finder chips.:CampWatchmodel +/api/camp-watchpoller cron(
*/15, snapshot-diff + 30-min throttle) + Resend alert email, reusing the existingwatch/digest/email substrate. Gated
derive-booking-difficulty.Phase 3 — Plan + ranger + memory
(:Stop)-[:STAYS_AT]->(:Campground)nested trip lodging (TripBuilder "Sleeping here", GPX waypoint,offline field sheet, pure
suggestLodging).:CampPrefs+ amenityREQUIRES+SAVED→:Campground) injected into theranger's per-turn memory block.
find_campgrounds,check_campsite_availability,set/list/clear_camp_watch,add_campground_to_trip,campground_booking_window,set_camp_preferences,save_campground)sets a watch.
/campgrounds/compare?ids=…).Phase 4 — Reach (open-data scope)
osm-camp.tsOverpasscamp_site/caravan_site/camp_pitch, ODbL) forstate/private/dispersed coverage.
resolve-campgrounds): dedups OSM vs the federal canon byname-Jaccard + <250 m geodistance, merges
sourceIdsand raisesdataConfidence.Honest caveats / scope
"Use Our Data" terms before enabling in prod. No code path hard-depends on live data.
SYNC_CAMPGROUNDS,ENRICH_OSM_CAMP,RESOLVE_CAMPGROUNDS,DERIVE_BOOKING_DIFFICULTY) and needsRIDB_API_KEY(free).(ReserveAmerica/UseDirect/Aspira), private/affiliate (Hipcamp/The Dyrt), community reviews,
Camp-Watch monetization tiers, and the availability-calendar/occupancy/constellation charts (data-gated).
Bugs caught by live browser testing
<Icon>500'd the detail page.Verification
pnpm typecheck·pnpm test:unit(956) ·RUN_INTEGRATION=1 pnpm test:integration(campgrounds +camp-watches) ·
pnpm test:e2e(campgrounds + compare; no regressions in plan/hydration) ·pnpm exec eve info·pnpm build. Setup: addRIDB_API_KEY, runpnpm db:migrate(026/027), thenpnpm campgrounds:sync(orSYNC_CAMPGROUNDS=1).