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.

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
VariableRequiredDefaultDescription
PORTYes3000Port the Express server listens on
DB_HOSTYeslocalhostMySQL host (e.g. localhost or an Aiven hostname)
DB_PORTYes3306MySQL port
DB_USERYesMySQL username
DB_PASSWORDYesMySQL password
DB_NAMEYesMySQL database name (e.g. ordervista locally, defaultdb on Aiven)
DB_SSLYesfalseSet to true to enable SSL for the MySQL connection
DB_SSL_REJECT_UNAUTHORIZEDNofalseSet to true to reject self-signed or unauthorised SSL certificates
DB_SSL_CANoInline CA certificate string (newlines encoded as \n). When set, rejectUnauthorized is forced to true
JWT_SECRETYesSecret key used to sign and verify JWT tokens
FRONTEND_URLYeshttp://localhost:5173Allowed 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.
VariableRequiredDefaultDescription
DATABASE_URLNoFull MySQL connection string (e.g. mysql://user:pass@host:port/db). Checked first
MYSQL_URLNoAlternative connection string variable. Checked if DATABASE_URL is absent
MYSQL_PUBLIC_URLNoPublic-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.
VariableRequiredDefaultDescription
MYSQLHOSTNoMySQL host (Railway-injected equivalent of DB_HOST)
MYSQLPORTNoMySQL port (Railway-injected equivalent of DB_PORT)
MYSQLUSERNoMySQL username (Railway-injected equivalent of DB_USER)
MYSQLPASSWORDNoMySQL password (Railway-injected equivalent of DB_PASSWORD)
MYSQLDATABASENoMySQL database name (Railway-injected equivalent of DB_NAME)
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.

Build docs developers (and LLMs) love