Skip to content

Implementation plan and research ​

Starting point: https://github.com/juftin/camply/blob/reserve-america/ReserveAmerica.ipynb at 0461a20cdf7ba839e289a9a5b118fb65adaba599. The notebook implements anonymous cookie/header bootstrap and state search pagination only.

Live research on 2026-11-07: www and api hosts returned 403. The public a1.reserveamerica.com host serves the frontend and same-origin /jaxrs-json/search and /jaxrs-json/products/{contract}/{facility} endpoints. Its shipped rabundle confirms gad/gal availability dates and rcp pagination. A live CO catalog and CO/50028 product response confirmed required schemas, daily status strings, overnight stayType, attribute IDs, and server-controlled page size (50 despite requesting 100). Raw responses and cookies remain outside the repository.

Implement an async BaseProvider using the shared retry/circuit breaker, per-instance request pacing and a lock around anonymous bootstrap/auth refresh. Bootstrap public search page; forward idToken/a1Data only when supplied, following the upstream notebook. On 401 refresh once, then propagate failure. Use contract_facility campground IDs and contract_facility_site campsite IDs. Bulk brand metadata drives US state coverage; catalog de-duplicates overlapping results, and keeps native verifiable overnight facilities. Facilities have no invented parent recreation area. Fetch and validate the complete catalog before opening a DB transaction; disable stale rows and rebuild search atomically.

Pydantic models explicitly translate API attributes to DTOs; only AVAILABLE dates on eligible nightly camping sites qualify; selected-stay snapshots do not gate daily grids. Preserve raw attributes, group, loop, and booking URL in metadata. Scan 14-night windows and validate page progress/counts. Seed stable provider ID 13 via a guarded migration. Existing registry consumers automatically include ingestion, CLI and worker support.

Constitution audit: async IO, base-only dependencies, explicit types, shared DTO and transport, atomic provider-scoped persistence, unit and mock HTTP integration tests satisfy the architecture. No server/worker imports or schema changes. Live network acceptance on other contracts remains an operational follow-up; minimum stays and cross-worker pacing remain shared limitations.

Session follow-up: use the HTTP client’s URL-scoped cookie header to derive optional token headers per API request, so domain/path/expiry rules and Set-Cookie rotation/deletion stay consistent. Remove the cached auth-header snapshot. Mark the session invalid after an unsuccessful refreshed request; preserve the existing one-refresh limit and 403/error propagation. Synthetic transport tests verify rotation, deletion, expired/path-scoped cookies, repeated-401 recovery, and concurrent callers.

Public URL correction: keep API and cookie bootstrap on the verified a1 host, and direct all public provider/campground/campsite navigation to www.reserveamerica.com. Update the provider identity and marketing card. A guarded forward data migration corrects existing seeded rows without rewriting the original migration or custom URLs. Verify rendered card links, generated booking URLs, API/session host isolation, SQLite upgrade/downgrade, and PostgreSQL smoke expectations.