Skip to content

fix(docs): add working ingest:example script, correct quickstart#1137

Merged
matthewhanson merged 2 commits into
mainfrom
fix/ingest-example-1084
Jul 1, 2026
Merged

fix(docs): add working ingest:example script, correct quickstart#1137
matthewhanson merged 2 commits into
mainfrom
fix/ingest-example-1084

Conversation

@matthewhanson

Copy link
Copy Markdown
Member

Summary

Fixes #1084 — the documented sample-data flow didn't work:

  1. README referenced npm run ingest:example, which didn't exist.
  2. README + quickstart claimed docker compose up starts the API on :3000 — it only starts OpenSearch + LocalStack, so curl localhost:3000 connection-refused.

Changes

  • bin/ingest-example.mjs + npm run ingest:example — posts examples/sample-collection.json and examples/sample-item.json to the local API via the Transaction extension. Honors STAC_API_URL (default http://localhost:3000), prints a clear hint if the API isn't reachable, tolerates 409 (re-runnable), and retries the item create while the new collection becomes searchable (OpenSearch's ~1s refresh).
  • README quick start and quickstart Step 1 now show npm install + npm run serve, and clarify that docker compose starts OpenSearch/LocalStack while npm run serve runs the API.
  • The sample data matches the collection/item used throughout the quickstart, so the existing search examples work against it.

Verification

Ran locally end-to-end: docker compose up -dnpm run servenpm run ingest:examplecurl '/search?collections=sample-collection' returns sample-item.

Closes #1084

🤖 Generated with Claude Code

The README and quickstart referenced `npm run ingest:example` (which did
not exist) and stated that `docker compose up` starts the API — it only
starts OpenSearch and LocalStack, so `curl localhost:3000` failed (#1084).

- Add `examples/sample-collection.json` + `examples/sample-item.json` and a
  `bin/ingest-example.mjs` script (wired to `npm run ingest:example`) that
  posts them to the local API via the Transaction extension. It gives a clear
  hint if the API isn't running and retries the item create while the new
  collection becomes searchable.
- Correct the README quick start and quickstart Step 1 to `npm install` +
  `npm run serve` (the API), and clarify what `docker compose` actually starts.

Closes #1084.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the “sample ingest” and “quickstart” documentation flow by adding a working npm run ingest:example script and updating the docs to accurately reflect that docker compose starts dependencies (OpenSearch/LocalStack) while npm run serve runs the STAC API locally.

Changes:

  • Adds bin/ingest-example.mjs and wires it up as npm run ingest:example to ingest sample collection/item via Transactions.
  • Updates README + getting-started quickstart to include npm install, run the API with npm run serve, and clarify what Compose does/doesn’t start.
  • Adds example STAC JSON payloads used by the ingest script and manual quickstart steps.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updates quickstart commands to include install + npm run serve and then ingest/query.
package.json Adds ingest:example script (and should also ensure eslint covers .mjs).
examples/sample-collection.json Adds ready-made sample collection used by docs + ingest script.
examples/sample-item.json Adds ready-made sample item used by docs + ingest script.
docs/getting-started/quickstart.md Fixes Step 1 to start dependencies with Compose and run API via npm run serve; adds an ingest tip.
bin/ingest-example.mjs New CLI script to post the example collection/item to a local API with retries and re-run tolerance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
"build-api-docs": "npx @redocly/cli build-docs src/lambdas/api/openapi.yaml -o ./docs/api-spec.html",
"prepare": "husky"
"prepare": "husky",
"ingest:example": "node bin/ingest-example.mjs"
Comment on lines +29 to +31
`docker compose` starts OpenSearch and LocalStack; `npm run serve` runs the STAC API
on `http://localhost:3000` with the Transaction extension enabled (so the steps below
can create collections and items).
Per review:
- Rename bin/ingest-example.mjs -> .js so it's covered by `npm run lint`
  (the repo is ESM, and the eslint script only globs .js/.ts).
- Correct the quickstart "Transaction extension errors" section, which
  still toggled transactions via `docker compose` even though the API now
  runs via `npm run serve`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@matthewhanson matthewhanson mentioned this pull request Jun 20, 2026
7 tasks
@matthewhanson matthewhanson added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 1a132ad Jul 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ingest sample data not working

3 participants