Ordervista uses a relational MySQL database to store all application data, including users, products, orders, and operational records. In production the database is hosted on Aiven MySQL, a managed cloud database service that enforces SSL on every connection. Before the application can run — locally or in production — the schema must be created and the required lookup data must be seeded into the database.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.
Schema Overview
The Ordervista database consists of 10 tables that model the full restaurant order-management domain:| Table | Description |
|---|---|
ROLES | User role definitions (Administrador, Operador, Cliente) |
USUARIOS | Registered application users |
CATEGORIAS | Product menu categories |
PRODUCTOS | Menu items including price, stock, and image |
PEDIDOS | Customer and operator orders |
DETALLE_PEDIDO | Line items belonging to each order |
ESTADOS_PEDIDO | Lookup table of order status values |
TIPOS_PEDIDO | Lookup table of order type values (Delivery, Retiro, Consumo Local) |
DIRECCIONES | Delivery addresses linked to users |
COMANDAS | Kitchen command records linked to orders |
backend/src/config/schema.sql.
Initializing the Schema
Run the schema SQL file against your target database using the MySQL CLI. Replace the placeholders with the connection details from your Aiven (or local) service:defaultdb as the database name unless you created a custom one.
Seeding Initial Data
Several tables must be populated with required lookup data before the application can function correctly. The seed filebackend/src/config/seed.sql inserts the initial rows for:
ROLES— the three application roles:Administrador,Operador, andClienteESTADOS_PEDIDO— the four order status values:Pendiente,En preparación,Listo, andEntregadoTIPOS_PEDIDO— the three order type values:Delivery,Retiro, andConsumo Local
Aiven MySQL Connection
Aiven MySQL requires SSL for all connections. The backend’s connection pool inbackend/src/config/db.js reads the following environment variables to configure SSL:
DB_SSL=true activates the SSL configuration path in getSslConfig(). Setting DB_SSL_REJECT_UNAUTHORIZED=false tells the MySQL2 client to accept Aiven’s managed certificate without needing a local CA bundle. All other connection parameters (DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME) should be copied directly from the Connection Information panel in the Aiven console.
Aiven also provides a
DATABASE_URL connection string on the service overview page. If you prefer a single-variable approach, set DATABASE_URL in the backend environment and omit the individual DB_* variables — the connection pool will parse the URL automatically.Local MySQL
For local development, SSL is not required. Use the following settings inbackend/.env: