Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt

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

This guide walks you through cloning the Ordervista repository, configuring environment variables, connecting a local MySQL database, and running both the backend API and the React frontend on your machine. By the end you will have a fully functional local instance ready for development or testing.
Start the backend before the frontend. The frontend’s Vite dev server expects the API to already be reachable at http://localhost:3000 when it boots, so bringing up Express first avoids connection errors on the initial page load.
1

Prerequisites

Ensure the following tools are installed on your system before continuing:
  • Node.js (LTS recommended) — nodejs.org
  • npm (bundled with Node.js)
  • MySQL — version 8.0 or later, running locally
  • Gitgit-scm.com
Verify your versions before proceeding:
node -v
npm -v
mysql --version
git --version
2

Clone the repository

Clone the Ordervista monorepo and move into the project root:
git clone https://github.com/ytabeloved/ordervista.git && cd ordervista
The repository contains two top-level directories — backend/ and frontend/ — that you will configure independently in the next steps.
3

Configure the backend

Navigate to the backend/ directory and install dependencies:
cd backend && npm install
Create a .env file in the backend/ directory with the following content, replacing the placeholder values with your local MySQL credentials and a secure JWT secret:
PORT=3000
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=ordervista
DB_SSL=false
DB_SSL_REJECT_UNAUTHORIZED=false
JWT_SECRET=your_secret_key
FRONTEND_URL=http://localhost:5173
Start the backend in development mode (uses nodemon for hot-reloading):
npm run dev
You should see Servidor corriendo en puerto 3000 in the terminal, confirming Express is listening.
4

Configure the frontend

Open a new terminal tab, navigate to the frontend/ directory from the project root, and install dependencies:
cd frontend && npm install
Create a .env file in the frontend/ directory pointing to the local API:
VITE_API_URL=http://localhost:3000/api
Start the Vite development server:
npm run dev
5

Verify the API health endpoint

With the backend running, confirm the API is healthy by sending a GET request to the health endpoint:
curl http://localhost:3000/api/health
Expected response:
{
  "status": "ok",
  "message": "OrderVista API running"
}
If you receive this response, the Express server is connected and ready to handle requests.
6

Log in to Ordervista

Authenticate against the API using a POST request to /api/auth/login. Substitute the credentials of a user already seeded in your database:
curl -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "admin@ordervista.com", "password": "your_password"}'
A successful login returns a JWT token and the authenticated user’s profile:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id_usuario": 1,
    "nombre": "Admin",
    "apellido": "User",
    "email": "admin@ordervista.com",
    "id_rol": 1
  }
}
Copy the token value — the frontend stores it in localStorage and sends it as a Bearer token on every subsequent protected request.
The React application runs at http://localhost:5173 by default. Open that URL in your browser after both servers are running to access the full Ordervista UI.

Build docs developers (and LLMs) love