Skip to main content
The app uses Vite’s built-in environment variable system. Variables are read at build time and embedded in the client bundle.
All environment variables exposed to the browser must be prefixed with VITE_. Variables without this prefix are stripped from the build output and will be undefined at runtime.

Available variables

VITE_API_URL

VITE_API_URL sets the base URL that the frontend uses when making API requests. It is read in src/app/api.ts:
If the variable is not set, the app falls back to http://localhost:5175.

Local development

During local development you do not need to set VITE_API_URL. Vite’s dev server proxies all requests that start with /api to http://localhost:5175, so the frontend and backend communicate through the proxy without cross-origin issues. This proxy is configured in vite.config.ts:
The Vite dev server runs on port 5173 and the backend is expected on port 5175.

Production

In production there is no Vite dev server, so the proxy is not available. You must set VITE_API_URL to the public URL of your deployed backend before building.
Or set it as a persistent environment variable on your hosting platform before triggering a build.

Setting variables in a .env file

Create a .env file in the project root for local overrides. Vite loads this file automatically.
For environment-specific overrides, use Vite’s layered env files:
Add .env.local to your .gitignore to avoid committing secrets to version control.