Skip to content

fix(ENG-11821): env file#148

Merged
adefreitas merged 1 commit into
StackOneHQ:mainfrom
adefreitas:update-env-files
Apr 29, 2026
Merged

fix(ENG-11821): env file#148
adefreitas merged 1 commit into
StackOneHQ:mainfrom
adefreitas:update-env-files

Conversation

@adefreitas

@adefreitas adefreitas commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Updated .env examples for Next.js and Vite to default to StackOne dev endpoints. Added commented prod/local values and aligned keys to API_URL and DASHBOARD_URL (replacing NEXT_PUBLIC_* in Next.js).

  • Migration
    • In dev/nextjs/.env, rename NEXT_PUBLIC_API_URL → API_URL and NEXT_PUBLIC_APP_URL → DASHBOARD_URL.
    • If your app reads the old NEXT_PUBLIC_* vars, update references or re-expose the new values with NEXT_PUBLIC_ as needed.

Written for commit dd05ca5. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings April 29, 2026 09:16

@claude claude Bot 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@adefreitas adefreitas changed the title fix: env file fix(ENG-11821): env file Apr 29, 2026
@adefreitas adefreitas merged commit 6d3649e into StackOneHQ:main Apr 29, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the developer sandbox .env.example files for the Vite and Next.js dev apps, aiming to switch default endpoints and document prod/local alternatives.

Changes:

  • Switch default API/app URLs in the Vite sandbox .env.example.
  • Switch default API/app URLs in the Next.js sandbox .env.example.
  • Add commented “Prod” and “Local” endpoint blocks for reference.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
dev/vite/.env.example Changes default API/app URLs and adds commented prod/local variants.
dev/nextjs/.env.example Changes default API/app URLs and adds commented prod/local variants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dev/vite/.env.example
Comment on lines +5 to +6
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

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

These URLs are set to http://… even though the dev app sends the API key as an Authorization header when creating sessions. Using HTTP here would transmit credentials in plaintext; prefer https:// for non-local endpoints (or explicitly document why HTTP is required).

Suggested change
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com
API_URL=https://api.stackone-dev.com
DASHBOARD_URL=https://app.stackone-dev.com

Copilot uses AI. Check for mistakes.
Comment thread dev/nextjs/.env.example
Comment on lines +5 to +12
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com
# Prod
# API_URL=https://api.stackone.com
# DASHBOARD_URL=https://app.stackone.com
# Local
# API_URL=http://localhost:4000
# DASHBOARD_URL=http://localhost:3000

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

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

The Next.js sandbox reads process.env.NEXT_PUBLIC_API_URL and NEXT_PUBLIC_APP_URL, but this example file now defines API_URL and DASHBOARD_URL. Copying this .env.example won’t configure the app and will cause it to fall back to the production defaults (https://api.stackone.com / https://app.stackone.com). Update the variable names to match what Next.js code expects (including the NEXT_PUBLIC_ prefix).

Suggested change
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com
# Prod
# API_URL=https://api.stackone.com
# DASHBOARD_URL=https://app.stackone.com
# Local
# API_URL=http://localhost:4000
# DASHBOARD_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://api.stackone-dev.com
NEXT_PUBLIC_APP_URL=http://app.stackone-dev.com
# Prod
# NEXT_PUBLIC_API_URL=https://api.stackone.com
# NEXT_PUBLIC_APP_URL=https://app.stackone.com
# Local
# NEXT_PUBLIC_API_URL=http://localhost:4000
# NEXT_PUBLIC_APP_URL=http://localhost:3000

Copilot uses AI. Check for mistakes.
Comment thread dev/nextjs/.env.example
Comment on lines +5 to +6
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

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

The example uses http://api.stackone-dev.com, but the Next.js page explicitly refuses to send the API key unless NEXT_PUBLIC_API_URL is HTTPS or localhost. Even after renaming the env vars, keeping an HTTP dev URL here will make token creation fail (and/or encourage insecure configs). Switch these dev endpoints to https:// if they support it, or update the safety check/docs accordingly.

Suggested change
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com
API_URL=https://api.stackone-dev.com
DASHBOARD_URL=https://app.stackone-dev.com

Copilot uses AI. Check for mistakes.
Comment thread dev/vite/.env.example
Comment on lines +5 to +12
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com
# Prod
# API_URL=https://api.stackone.com
# DASHBOARD_URL=https://app.stackone.com
# Local
# API_URL=http://localhost:4000
# DASHBOARD_URL=http://localhost:3000

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

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

The Vite dev app reads URLs from import.meta.env.VITE_API_URL / VITE_APP_URL (and other vars are VITE_*), but this example file defines API_URL and DASHBOARD_URL. Copying this .env.example will therefore fall back to the production defaults in code instead of using the intended dev/local endpoints. Rename these keys to the VITE_* names used by the Vite app (and keep naming consistent with APP_URL, not DASHBOARD_URL).

Suggested change
API_URL=http://api.stackone-dev.com
DASHBOARD_URL=http://app.stackone-dev.com
# Prod
# API_URL=https://api.stackone.com
# DASHBOARD_URL=https://app.stackone.com
# Local
# API_URL=http://localhost:4000
# DASHBOARD_URL=http://localhost:3000
VITE_API_URL=http://api.stackone-dev.com
VITE_APP_URL=http://app.stackone-dev.com
# Prod
# VITE_API_URL=https://api.stackone.com
# VITE_APP_URL=https://app.stackone.com
# Local
# VITE_API_URL=http://localhost:4000
# VITE_APP_URL=http://localhost:3000

Copilot uses AI. Check for mistakes.
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.

2 participants