Repository navigation
docs: add local Couchbase Server setup and verification steps - #262
Open
dex-the-ai wants to merge 1 commit into
Open
dex-the-ai wants to merge 1 commit into
dex-the-ai wants to merge 1 commit into
Conversation
Closes #261 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #261
Problem
The README only described Capella. A new user who wanted to run the quickstart against a local Couchbase Server got one appendix paragraph. It had no commands, didn't list the bucket, scope, and collections the app expects, and gave no way to confirm the app could actually reach Couchbase. Because the app connects lazily, the
API startedlog line appears even when the database is unreachable.Change (README only)
Scope follows @ejscribner's comment on the issue: local setup, required env vars, expected bucket/scope/collection setup, and a verification check.
docker runCouchbase Server.couchbase-cli cluster-initwith the Data, Query, and Index services, with the reason each one is needed.travel-samplethrough the REST API, with the web console as an alternative.inventoryscope exists, plus a table of the keyspaces the app uses (travel-sample/inventory/airline,airport,route).dev.envandtest.envvalues for local use, including thecouchbase://vscouchbases://pitfall.npm start.DB_*andAPP_PORTvariable, with its purpose and the local value, plus which filenpm startandnpm testread.curl -i http://localhost:3000/api/v1/airline/airline_10with the exact expected200body, a SQL++ list check, and troubleshooting for the failure modes I reproduced (hang/timeout,authentication failure,document not found).localhostisn't the host (usehost.docker.internal).routes; the code usesroute(db/connection.js).No code, dependency, or CI changes.
Validation evidence
I followed the README against a fresh Couchbase Server 7.6.4 container (
couchbase:enterprise-7.6.4, unpublished ports; the app ran innode:24with--network container:<cb>, socouchbase://localhostresolves exactly as in the docs).couchbase-cli cluster-init -c localhost ... --services data,index,query --cluster-ramsize 1024 --cluster-index-ramsize 256 --index-storage-setting defaultSUCCESS: Cluster initializedcurl -u Administrator:password -X POST http://localhost:8091/sampleBuckets/install -d '["travel-sample"]'{"tasks":[{"taskId":"…","sample":"travel-sample","bucket":"travel-sample"}]}; itemCount reached 63288curl -s -u … /pools/default/buckets/travel-sample/scopes | grep -o '"name":"inventory"'"name":"inventory"(collections:route, landmark, hotel, airport, airline)npm ci && npm startwith the documenteddev.envAPI started at http://localhost:3000curl -i http://localhost:3000/api/v1/airline/airline_10HTTP 200{"id":10,"type":"airline","name":"40-Mile Air","iata":"Q5","icao":"MLA","callsign":"MILE-AIR","country":"United States"}curl "http://localhost:3000/api/v1/airport/list?country=United%20Kingdom&limit=2"HTTP 200, 2 airports (LON,HLY)curl http://localhost:3000/swagger-ui/HTTP 200npm test(readsconfig/test.envwith the same local values)Test Suites: 20 passed, 20 total/Tests: 20 passed, 20 totalTroubleshooting entries were reproduced, not guessed:
DB_USERNAMEunset: startup throwsPlease define the DB_USERNAME environment variable inside dev.env.DB_PASSWORD=wrong: the app still logsAPI started, then the request returnsHTTP 500AuthenticationFailureError: authentication failure.DB_CONN_STR=couchbase://10.255.255.1(unreachable): the app still logsAPI started, then the request hangs (curl -m 30exits 28).GET /api/v1/airline/does_not_exist:HTTP 404{"message":"document not found"}.docker manifest inspect couchbase/server:enterprise: the image tag used in step 1 exists.Screenshots (Playwright, captured against the running app; they're on the
evidence/issue-261branch, which can be deleted after review):/: https://github.com/couchbase-examples/nodejs-quickstart/blob/evidence/issue-261/swagger-ui.pngGET /api/v1/airline/airline_10: https://github.com/couchbase-examples/nodejs-quickstart/blob/evidence/issue-261/airline_10.pngNot validated live:
docker run -p … couchbase/server:enterpriseport mapping, because host port 11210 is held by another container on this machine. The same image and steps were exercised through container networking instead.host.docker.internalnote for the Dockerized app.CI: see checks on this PR (
Node JS Testsruns against the repo's Capella vars and isn't affected by a README-only change).Risk
Docs only. The credentials are labeled as local-development-only.
🤖 Generated with Claude Code