Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CKoldo/Vacaciones-front/llms.txt

Use this file to discover all available pages before exploring further.

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

VariableRequiredDefaultDescription
VITE_API_URLIn productionhttp://localhost:5175Base URL of the backend API server. Trailing slashes are stripped automatically.

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:
const API_BASE = (import.meta.env.VITE_API_URL || 'http://localhost:5175').replace(/\/$/, '');
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:
server: {
  port: 5173,
  proxy: {
    '/api': {
      target: 'http://localhost:5175',
      changeOrigin: true,
      secure: false,
    },
  },
},
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.
VITE_API_URL=https://api.yourapp.com npm run build
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.
# .env
VITE_API_URL=http://localhost:5175
For environment-specific overrides, use Vite’s layered env files:
FileWhen it is loaded
.envAlways
.env.localAlways, ignored by git
.env.productionOnly when running vite build
.env.developmentOnly when running vite (dev server)
Add .env.local to your .gitignore to avoid committing secrets to version control.

Build docs developers (and LLMs) love