The Sistema de Gestión frontend uses a single environment variable to locate the backend API. Because Create React App embeds environment variables at build time — not runtime — you must provide the correct value before building the application or the Docker image.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebax85/frontend-prueba-fullstack/llms.txt
Use this file to discover all available pages before exploring further.
The REACT_APP_API_URL variable
REACT_APP_API_URL is the only environment variable consumed by this application. It is passed directly to axios as the baseURL for every HTTP request the frontend makes:
src/services/api.js
baseURL will be undefined and all API calls will fail silently.
Create React App build-time embedding
Create React App only exposes environment variables prefixed with
REACT_APP_ to the browser bundle. Variables without this prefix are ignored and will not be available in the compiled JavaScript.npm run build, Create React App reads .env files and replaces every reference to process.env.REACT_APP_* with the literal string value. The resulting build/ folder contains the substituted values baked into static JS files. There is no runtime environment injection mechanism unless you add one explicitly.
Setting the variable in .env
Create a .env file in the project root (next to package.json) with the following content:
.env
.env (default in repository)
Passing the value as a Docker build argument
The currentDockerfile does not declare a ARG for REACT_APP_API_URL, so the build reads the value from the .env file present in the build context. If you want to override it without modifying .env, extend the Dockerfile to accept a build argument:
Dockerfile (extended)
.env file loading order
Create React App reads .env files in the following order, with later files taking precedence:
| File | When it applies |
|---|---|
.env | All environments |
.env.local | All environments, ignored by git |
.env.development | npm start only |
.env.production | npm run build only |
.env or .env.production are the relevant files.
Related pages
Docker deployment
Build and run the full Docker image including build args.
Backend requirements
What the backend must expose at the configured URL.