docs: add end-to-end local development setup guide#591
Open
samjay8 wants to merge 1 commit into
Open
Conversation
New contributors previously had to piece together setup steps from the README, CONTRIBUTING.md, and several docs pages. This adds a single guide covering the full path from fresh clone to verified environment: - Prerequisites with versions (Node 20+, pnpm 10.x, Docker/Postgres 16) and Stellar testnet RPC access notes - Numbered setup steps: clone, install, env file (including the required-credential placeholders the server needs to boot), database, Prisma generate, migrations, and seeding - Separate sections for starting the API server and the indexer, clarifying that the polling worker is external and how to simulate its heartbeat locally - Verification section with expected health check and first creator list responses, plus a troubleshooting table for common failures README.md and CONTRIBUTING.md now link to the guide from their local setup sections. Closes accesslayerorg#588
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 #588)
Summary
New contributors previously had no single documented path from a fresh clone to a running server — setup steps were scattered across the README, CONTRIBUTING.md, and several docs pages. This PR adds
docs/local-development-setup.md, a complete walkthrough from clone to verified local environment, and links it from the README and CONTRIBUTING local setup sections.What the guide covers
1. Prerequisites (with versions)
10.6.5viapackageManager; the preinstall guard rejecting npm/yarn is called out), Docker with Compose v2, PostgreSQL 16 (via the shippeddocker-compose.yml).env.example, need no API key, and are consumed by the external indexer worker — the API server can be developed without ever touching the Stellar network2. Numbered, sequential setup steps
Clone →
pnpm install→cp .env.example .env→pnpm db:up→pnpm generate→pnpm migrate→ seed (pnpm exec ts-node prisma/seed.ts).The env-file step documents the biggest onboarding trap in this repo: the server hard-fails at startup with
MissingRequiredEnvErrorwhile any of the 11 required variables (Gmail, Google OAuth, Cloudinary, Paystack, …) is blank, and.env.exampleintentionally ships them blank. The guide provides safe non-empty placeholder values and explains exactly which features need real credentials.3. Starting the API server and the indexer separately
pnpm dev(nodemon watch mode) andpnpm build && pnpm start(compiled), with the expected startup log sequencedocs/indexer/ARCHITECTURE.md) that the Stellar polling loop runs as a separate external worker rather than inside this server, thatGET /api/v1/health/indexerreporting"unknown"is the expected fresh-clone state, and how to simulate a worker heartbeat locally withcurl -X POST /api/v1/health/indexer/heartbeatto exercise the indexer health path4. Verifying the setup
GET /api/v1/healthliveness response and the/health/readyreadiness probe for confirming database connectivityGET /api/v1/creatorsresponse with the three seeded creators and the offset pagination meta (limit: 20,total: 3,hasMore: false), including what an empty list meanspnpm lint,pnpm build,pnpm test)P1001database unreachable, port 5432 conflicts, stale Prisma client, migration drift) to their fixesDetails verified against the codebase
Every command, endpoint, response shape, default value, and error message in the guide was checked against the source:
package.jsonscripts,src/config.required.ts/src/config.schema.tsstartup validation,src/server.tsboot logs, the health module routes, the creator list serializers and pagination defaults,docker-compose.yml, and the CI workflow's Node version.Acceptance criteria
Related docs
The guide cross-links the existing deep dives it supersedes as an entry point:
docs/configuration.md,docs/contributor-seed.md,docs/database-migrations.md,docs/health-endpoints.md, anddocs/indexer/ARCHITECTURE.md.