The Despacho Frontend communicates with its backend through Axios, which is initialized once at startup by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/despacho-frontend/llms.txt
Use this file to discover all available pages before exploring further.
src/boot/axios.js boot file. Understanding where the API base URL lives — and how to change it per environment — is essential before deploying to staging or production. This page explains the current setup, its known inconsistency, and two patterns for proper environment-based configuration.
How the Axios boot file works
Quasar executessrc/boot/axios.js before the Vue app mounts. The file creates a single shared Axios instance and registers it on Vue’s global properties so every component can use this.$api (Options API) or import { api } directly (Composition API).
api instance is the recommended way to make requests in Composition API components:
Current base URL mismatch
Changing the base URL
Option 1 — Edit the boot file directly
The simplest approach for a single-environment setup is to update thebaseURL string in src/boot/axios.js, and replace the hardcoded fetch('http://localhost:2101/...') calls in components with api.get('...'):
Option 2 — Quasar build.env injection (recommended)
Quasar can inject environment variables at build time using the build.env key in quasar.config.js. Combined with dotenv (already a runtime dependency), this gives you a clean, per-environment configuration without touching source files.
Step 1 — Add build.env to quasar.config.js:
src/boot/axios.js to consume the variable:
fetch calls in components:
Any component that currently calls fetch('http://localhost:2101/...') directly should be updated to use the shared api instance instead:
.env file in the project root:
build.env are statically replaced by Vite at bundle time (similar to define in vite.config.js), so process.env.API_URL becomes an inline string in the production bundle.
No .env file exists yet
The project does not currently include a
.env or .env.example file. There are no pre-defined environment variables in the repository. The build.env pattern described above is how you create environment variable support from scratch — the only requirement is that dotenv is imported in quasar.config.js and a .env file is added to the project root. The dotenv package is already installed as a production dependency ("dotenv": "^17.2.0" in package.json), so no additional installation is needed.Environment files per deployment target
Create one.env file per environment and load the right one in your CI/CD pipeline by setting the API_URL variable in the environment before running quasar build.
- Local development (.env)
- Staging (.env.staging)
- Production (.env.production)
The dotenv dependency
dotenv is already listed as a production dependency in package.json ("dotenv": "^17.2.0"). To activate it inside quasar.config.js, import it at the top of the file before reading process.env:
dotenv only reads from .env in the project root by default. Use dotenv.config({ path: '.env.staging' }) if you need to load a non-default file programmatically inside quasar.config.js.Node version requirements
The project’spackage.json declares the following engine constraints:
| Runtime | Required version |
|---|---|
| Node.js | ^28 || ^26 || ^24 || ^22 || ^20 || ^18 |
| npm | >= 6.13.4 |
| Yarn | >= 1.21.1 |
Summary of environment configuration touchpoints
| File | Purpose |
|---|---|
src/boot/axios.js | Creates the shared Axios instance; set baseURL here |
quasar.config.js → build.env | Injects env variables as build-time constants |
.env | Local variable overrides; create this file — never commit secrets |
package.json → engines | Enforces Node/npm/Yarn version constraints |
Related pages
Quasar Config
Full reference for
quasar.config.js including boot, build, and dev server settings.API Integration
How components call the backend, authentication headers, and response handling patterns.
Theming
SCSS design tokens, color palette, and Line Awesome icon usage.
