Skip to content

Environment Configuration

Stadium 8 stores environment-specific settings — like your backend API address — in a local configuration file. This page explains the file, its variables, and what to watch out for.

The app reads from web/.env.local. This file is created automatically when dependencies are installed. It is never committed to GitHub — the repository’s .gitignore already excludes it.

A template called web/.env.example comes with the repository. It lists every variable the application needs with placeholder values. You can open it at any time to see what variables are available.

NEXT_PUBLIC_USE_MOCK_API — controls whether the app uses the mock backend or calls your real API. During development this is true. Set it to false when you are ready to connect to your real backend. Use the /api-go-live command to handle this switch — it updates the file for you.

NEXT_PUBLIC_API_BASE_URL — the URL of your backend API. The default points to http://localhost:8042. You do not need to change this while the mock is active.

Any variable whose name starts with NEXT_PUBLIC_ is baked into the browser bundle at build time. That means it is visible to anyone who inspects the shipped application — in the JavaScript bundle, in network requests, or in browser developer tools.

Do not put sensitive values in NEXT_PUBLIC_* variables. API keys, tokens, passwords, or any value that should remain private must use server-side environment variables (without the NEXT_PUBLIC_ prefix).

The majority of environment setup happens automatically:

  • web/.env.local is created when you first install dependencies
  • The Intake phase configures the authentication approach and sets API connection defaults
  • /api-go-live switches the app from mock to your real backend
  • /api-mock-refresh updates mocks when your API changes
  • /api-status shows the current connection state

You will typically only need to edit web/.env.local directly when setting up a cloned copy of the repository on a new machine, or when overriding a specific value that was not set during Intake.

  • Never share web/.env.local in a chat, email, or document. Use your team’s password manager.
  • Never commit it to GitHub. Once something is committed to a repository, it stays in the history permanently even if deleted later.