Skip to content

docs: add .env.example documenting the API base variable#315

Open
shinzoxD wants to merge 2 commits into
StableRoute-Org:mainfrom
shinzoxD:docs/env-example-305
Open

docs: add .env.example documenting the API base variable#315
shinzoxD wants to merge 2 commits into
StableRoute-Org:mainfrom
shinzoxD:docs/env-example-305

Conversation

@shinzoxD

Copy link
Copy Markdown
Contributor

Summary

Adds a tracked .env.example at the repository root documenting the NEXT_PUBLIC_STABLEROUTE_API_BASE environment variable. The file is a safe template: it contains a localhost default, an explanation of the NEXT_PUBLIC_ prefix semantics, and a note pointing to the URL validator in src/lib/apiClient.ts (PR #184 — already merged).

Why

A fresh contributor running npm run dev for the first time gets a dashboard that immediately tries to fetch http://localhost:3001/api/v1/stats (or whatever the default is). There is no hint that this URL is configurable, and no template to copy. The README documents the variable in prose but does not give a starting point. An .env.example is the standard convention Next.js / Vercel projects use for this.

Changes

  • New file: .env.example (~11 lines) with the env var, a localhost default, the NEXT_PUBLIC_ semantics note, and a pointer to the URL validator.

Test Plan

  • cp .env.example .env.local && npm run dev — dashboard starts and fetches the configured API base.
  • grep -r NEXT_PUBLIC_STABLEROUTE_API_BASE src/ — every read site is documented.
  • No code change; tests untouched.

Linked issue

Closes #305

Payout wallet (Stellar): GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH
GrantFox OSS campaign — smart escrow payout on merge.

Copilot AI review requested due to automatic review settings July 15, 2026 18:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…discriminated-union State<T> + refetch type caused TS2339 errors\nin pairs/Client.tsx and stats/Client.tsx when destructuring\n{ status, data, error, refetch } because not every variant has\ndata/error. Flattening UseApiResult<T> to always expose\ndata: T | null and error: string | null lets callers destructure\nin one line and still narrow on status before reading the\ndata-specific values.\n\nAlso adds && data / && status.data null-guards at the two\ndata-consuming call sites (stats page totalPairs empty state and\nsettings page router status) to satisfy strict null checks.
@shinzoxD

Copy link
Copy Markdown
Contributor Author

@mikewheeleer — friendly ping on this fork PR (docs: add .env.example documenting the API base variable).\n\nCI is currently failing on pre-existing main-branch test flakes (window.matchMedia is not a function in ThemeToggle.test.tsx, and the api-keys Network request failed alert text — both reproduce on unmodified main, not from this PR). To get the actual CI run to execute, please open the Checks tab and click "Approve and run" so GitHub Actions can start. Payout wallet (Stellar): GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH. Thanks!

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 an .env.example and document the API base and theme storage key

2 participants