Lex Consultoría’s SPA communicates with a Node.js REST backend through the browser’s nativeDocumentation 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.
fetch API and through Axios — both pointing at the same base URL. Axios is registered during Quasar’s boot phase so it is available globally across all Vue components without any per-file import. The backend exposes two groups of endpoints: unauthenticated endpoints for public-facing forms and auth-gated endpoints for the admin dashboard.
The default base URL is
http://localhost:2101. When deploying to a staging or production environment, update the baseURL value in src/boot/axios.js (or inject it via an environment variable) and rebuild the app.Axios Boot File — src/boot/axios.js
Quasar’s boot files run before the root Vue application mounts. The axios boot file creates a pre-configured api instance with baseURL set, then exposes both the raw axios object and the configured api instance as Vue global properties.
"axios" in the boot array inside quasar.config.js:
$api vs $axios
$api
An Axios instance pre-configured with
baseURL. Use this for all requests to the Despacho backend — you only need to supply the path (e.g., /api/lawyer/user/login) rather than the full URL. Access it as this.$api (Options API) or import { api } from src/boot/axios.js (Composition API / script setup).$axios
The raw, unmodified Axios constructor. Useful when you need to call a third-party URL that does not share the app’s base URL, or when you want to create an additional custom Axios instance with different interceptors or headers.
Setting the Authorization Header
Authenticated endpoints require aBearer token. The dashboardPage.vue pattern builds a Headers object from the validated user session:
fetch, pass the token in the headers config option:
Endpoint Reference
Authentication
- POST /api/lawyer/user/login
Authenticates a user and returns a signed JWT token. No authorization header required.RequestSuccess ResponseThe frontend stores
The registered email address of the user. Must match the regex pattern validated on the frontend: at least 6 characters, valid
user@domain.tld structure.The user’s password. Minimum 8 characters enforced on the frontend before the request is sent.
data.token in localStorage.setItem("token", data.token) and redirects to /dashboard.Failure ResponseThe response will not contain a token field. The frontend shows the Quasar notification "Credenciales incorrectas".Reservations — Public
- POST /api/form/reserve/create
Creates a new reservation request submitted by a potential client through the public contact form. No authentication required.Request
Full legal name of the person requesting the consultation.
Contact email address. Used by staff to follow up on the reservation.
Contact phone number. Displayed in the dashboard reservation detail modal.
Description of the legal service the client is requesting (e.g.,
"Derecho familiar", "Consultoría laboral").Client’s preferred appointment date in
YYYY-MM-DD format.Client’s preferred appointment time in
HH:MM (24-hour) format.Optional free-text field for any extra context the client wants to provide. Displayed in the dashboard under “Mensaje”.
Reservations — Admin (Bearer Token Required)
All endpoints in this group require a valid JWT in theauthorization header:
{ code: 401 } or { code: 403 } when the token is missing, malformed, or expired. Always pass the response through ValidateSession(data, router) before reading data.data.
- List All
- List Accepted
- List Pending
- Accept / Modify
- Delete
Returns every reservation regardless of acceptance status.ResponseUsed by
dashboardPage.vue when the “Todas” filter button is clicked (cargarReservas('all')).Endpoint Summary
| Method | Path | Auth | Purpose |
|---|---|---|---|
POST | /api/lawyer/user/login | None | Authenticate and receive JWT |
POST | /api/form/reserve/create | None | Submit public reservation form |
POST | /api/form/reserve/list/reservation-all | Bearer | Fetch all reservations |
POST | /api/form/reserve/list/reservation-true | Bearer | Fetch accepted reservations |
POST | /api/form/reserve/list/reservation-false | Bearer | Fetch pending reservations |
POST | /api/form/reserve/accept/:id/reserve | Bearer | Confirm or modify a reservation |
POST | /api/form/reserve/remove/reservation/:id | Bearer | Delete a reservation |
