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.
Ordervista uses a two-file environment variable strategy: a .env file for local development and a separate .env.production file for production values. The backend reads variables for database connectivity, JWT signing, and CORS configuration, while the frontend requires only a single variable pointing to the backend API. Neither file should ever be committed to version control — use your hosting provider’s dashboard (Render for the backend, Vercel for the frontend) to inject secrets at build and runtime.
The backend environment variables configure the Express server, MySQL connection pool, SSL behaviour, JWT signing, and allowed CORS origins. Copy backend/.env.example to backend/.env and fill in each value before running the server locally.Core server and database variables| Variable | Required | Default | Description |
|---|
PORT | Yes | 3000 | Port the Express server listens on |
DB_HOST | Yes | localhost | MySQL host (e.g. localhost or an Aiven hostname) |
DB_PORT | Yes | 3306 | MySQL port |
DB_USER | Yes | — | MySQL username |
DB_PASSWORD | Yes | — | MySQL password |
DB_NAME | Yes | — | MySQL database name (e.g. ordervista locally, defaultdb on Aiven) |
DB_SSL | Yes | false | Set to true to enable SSL for the MySQL connection |
DB_SSL_REJECT_UNAUTHORIZED | No | false | Set to true to reject self-signed or unauthorised SSL certificates |
DB_SSL_CA | No | — | Inline CA certificate string (newlines encoded as \n). When set, rejectUnauthorized is forced to true |
JWT_SECRET | Yes | — | Secret key used to sign and verify JWT tokens |
FRONTEND_URL | Yes | http://localhost:5173 | Allowed CORS origin — must match the exact URL of the frontend |
Connection-string variables (production / managed platforms)The connection pool in backend/src/config/db.js checks DATABASE_URL, MYSQL_URL, and MYSQL_PUBLIC_URL in that order. When any one of these is present it takes precedence over the individual DB_* host variables, though DB_SSL and DB_SSL_REJECT_UNAUTHORIZED are still applied.| Variable | Required | Default | Description |
|---|
DATABASE_URL | No | — | Full MySQL connection string (e.g. mysql://user:pass@host:port/db). Checked first |
MYSQL_URL | No | — | Alternative connection string variable. Checked if DATABASE_URL is absent |
MYSQL_PUBLIC_URL | No | — | Public-facing connection string. Checked if both of the above are absent |
Railway-compatible variables (optional)Railway and similar platforms inject database credentials as MYSQL* variables. The connection pool falls back to these when neither a connection-string variable nor the DB_* variables are set.| Variable | Required | Default | Description |
|---|
MYSQLHOST | No | — | MySQL host (Railway-injected equivalent of DB_HOST) |
MYSQLPORT | No | — | MySQL port (Railway-injected equivalent of DB_PORT) |
MYSQLUSER | No | — | MySQL username (Railway-injected equivalent of DB_USER) |
MYSQLPASSWORD | No | — | MySQL password (Railway-injected equivalent of DB_PASSWORD) |
MYSQLDATABASE | No | — | MySQL database name (Railway-injected equivalent of DB_NAME) |
The frontend is built with Vite, which exposes environment variables to the browser bundle only when they are prefixed with VITE_. Copy frontend/.env.example to frontend/.env and set the variable below before running the dev server.| Variable | Required | Default | Description |
|---|
VITE_API_URL | Yes | http://localhost:3000/api | Base URL of the backend API including the /api path segment |
Never commit .env files to your repository. In particular, JWT_SECRET and DB_PASSWORD must be kept out of version control at all times. Use your hosting provider’s secret management UI — Render’s Environment tab for the backend and Vercel’s Environment Variables settings for the frontend — to inject these values securely at runtime.
When connecting to Aiven MySQL in production, you must set DB_SSL=true. Aiven enforces SSL on all incoming connections. Setting DB_SSL_REJECT_UNAUTHORIZED=false allows the connection to succeed with Aiven’s managed certificate without requiring a local CA bundle.