Skip to content

docs: add end-to-end local development setup guide#591

Open
samjay8 wants to merge 1 commit into
accesslayerorg:mainfrom
samjay8:docs/588-local-development-setup-guide
Open

docs: add end-to-end local development setup guide#591
samjay8 wants to merge 1 commit into
accesslayerorg:mainfrom
samjay8:docs/588-local-development-setup-guide

Conversation

@samjay8

@samjay8 samjay8 commented Jul 20, 2026

Copy link
Copy Markdown

(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)

  • Node.js 20+ (matches CI), pnpm 10.x (repo pins 10.6.5 via packageManager; the preinstall guard rejecting npm/yarn is called out), Docker with Compose v2, PostgreSQL 16 (via the shipped docker-compose.yml)
  • Stellar testnet RPC access: documents that the public Horizon/Soroban testnet endpoints are preconfigured in .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 network

2. Numbered, sequential setup steps

Clone → pnpm installcp .env.example .envpnpm db:uppnpm generatepnpm 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 MissingRequiredEnvError while any of the 11 required variables (Gmail, Google OAuth, Cloudinary, Paystack, …) is blank, and .env.example intentionally 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

  • API server: pnpm dev (nodemon watch mode) and pnpm build && pnpm start (compiled), with the expected startup log sequence
  • Indexer: documents accurately (per docs/indexer/ARCHITECTURE.md) that the Stellar polling loop runs as a separate external worker rather than inside this server, that GET /api/v1/health/indexer reporting "unknown" is the expected fresh-clone state, and how to simulate a worker heartbeat locally with curl -X POST /api/v1/health/indexer/heartbeat to exercise the indexer health path

4. Verifying the setup

  • Expected GET /api/v1/health liveness response and the /health/ready readiness probe for confirming database connectivity
  • Expected first GET /api/v1/creators response with the three seeded creators and the offset pagination meta (limit: 20, total: 3, hasMore: false), including what an empty list means
  • Repo checks (pnpm lint, pnpm build, pnpm test)
  • A troubleshooting table mapping the common first-run failures (missing env vars, npm instead of pnpm, P1001 database unreachable, port 5432 conflicts, stale Prisma client, migration drift) to their fixes

Details verified against the codebase

Every command, endpoint, response shape, default value, and error message in the guide was checked against the source: package.json scripts, src/config.required.ts / src/config.schema.ts startup validation, src/server.ts boot logs, the health module routes, the creator list serializers and pagination defaults, docker-compose.yml, and the CI workflow's Node version.

Acceptance criteria

  • Prerequisites listed with versions where relevant
  • Setup steps are numbered and sequential
  • API and indexer start commands are both documented
  • Verification steps confirm a working local environment

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, and docs/indexer/ARCHITECTURE.md.

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
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.

Add docs for local development setup from scratch including database and indexer startup

1 participant