Skip to content

docs(env): document NEXT_PUBLIC_APP_URL in .env.example, README and docs/ENVIRONMENT.md - #202

Open
Dev-dave01 wants to merge 1 commit into
StellarTickets:mainfrom
Dev-dave01:docs/36-document-next-public-app-url
Open

Dev-dave01 wants to merge 1 commit into
StellarTickets:mainfrom
Dev-dave01:docs/36-document-next-public-app-url

Conversation

@Dev-dave01

Copy link
Copy Markdown

Closes #36

Problem

src/app/layout.tsx (metadataBase) and src/app/sitemap.ts both read NEXT_PUBLIC_APP_URL, falling back to http://localhost:3001. The variable was absent from .env.example, the README Environment table, and docs/ENVIRONMENT.md, so a production deployment that never set it emitted localhost canonical/OG URLs, robots-adjacent metadata and sitemap.xml entries — silently, with nothing in the docs to catch it.

Changes

Documentation only, one variable added to the three places named in the acceptance criteria, each with a note that it must be the public origin in production:

  • .env.example — new NEXT_PUBLIC_APP_URL=http://localhost:3001 entry, with a comment naming metadataBase/sitemap.xml and warning that leaving it unset in production emits http://localhost:3001 URLs.
  • README.md — new row in the Environment table stating it is the public origin used for canonical/OG URLs and sitemap.xml, and that it must be the public origin in production.
  • docs/ENVIRONMENT.md — same row added to the variables table. The trailing sentence said "All three are NEXT_PUBLIC_*"; with a fourth variable documented that no longer holds, so it now reads "All of them".

Example production value used in the docs: https://stellartickets.app.

Scope

Deliberately limited to the acceptance criteria. I did not switch layout.tsx/sitemap.ts over to resolveEnv() (the production guard added for #37) — that is a behaviour change belonging to that issue, and touching it here would risk conflicting with other work in flight on the same two files.

Verification

npm test        # 17 files, 78 tests passed

npm run lint and npx tsc --noEmit currently fail on this branch, but not because of this change — src/app/my-tickets/page.tsx has a pre-existing unclosed <div> in a ticket.status === 'VALID' ternary (around line 326) that is broken on main (95c7603) and untouched here. Flagging it rather than fixing it, since it belongs to a different piece of work.

🤖 Generated with Claude Code

…ickets#36)

src/app/layout.tsx (metadataBase) and src/app/sitemap.ts both read
NEXT_PUBLIC_APP_URL and fall back to http://localhost:3001, but the
variable was undocumented, so production builds silently emitted
localhost canonical/OG URLs and sitemap entries.

Adds it to .env.example, the README Environment table, and
docs/ENVIRONMENT.md, each noting that it must be set to the public
origin in production.
@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

@Dev-dave01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for stellartickets failed.

Name Link
🔨 Latest commit 07d787c
🔍 Latest deploy log https://app.netlify.com/projects/stellartickets/deploys/6ab823087e221500082c3653

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.

NEXT_PUBLIC_APP_URL is used by the app but missing from .env.example, README and docs

2 participants