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.

The Ordervista backend is a Node.js/Express application deployed to Render as a Web Service. Render builds and runs the service directly from the backend/ subdirectory of the GitHub repository, injecting all secrets as environment variables at runtime. The server exposes a /api/health endpoint you can use to confirm a successful deployment before opening the frontend.

Render Web Service Settings

When creating a new Render Web Service, apply the following configuration in the Render dashboard:
SettingValue
Root Directorybackend
Build Commandnpm install
Start Commandnpm start
Render will clone the repository, change into the backend/ directory, run npm install to install dependencies, and then start the server with npm start on every deployment.

Required Environment Variables

Set the following environment variables in the Render dashboard under Environment → Environment Variables. Never add these values to a committed .env file.
PORT=3000
DB_HOST=<aiven-host>
DB_PORT=<aiven-port>
DB_USER=<aiven-user>
DB_PASSWORD=<aiven-password>
DB_NAME=defaultdb
DB_SSL=true
DB_SSL_REJECT_UNAUTHORIZED=false
JWT_SECRET=<strong-random-secret>
FRONTEND_URL=<vercel-frontend-url>
Replace each <placeholder> with the real value from your Aiven and Vercel dashboards. Use a long, randomly generated string for JWT_SECRET — at least 32 characters is recommended.

Health Check

After a successful deployment, verify the service is running by calling the health endpoint:
GET https://ordervista-backend.onrender.com/api/health
Expected response:
{
  "status": "ok",
  "message": "OrderVista API running"
}
A 200 OK response with this body confirms that the Express server started correctly and connected to the database.

CORS Configuration

The FRONTEND_URL environment variable is used directly in server.js to build the list of allowed CORS origins. The server permits requests from http://localhost:5173 (local development) and the value of FRONTEND_URL at runtime. Set FRONTEND_URL to the exact URL Vercel assigned to your frontend — including the https:// scheme and without a trailing slash — for example https://ordervista.vercel.app. Any mismatch will cause the browser to block API requests with a CORS error.

Deployment Steps

1

Create a new Web Service on Render

In the Render dashboard, click New → Web Service and connect the ordervista GitHub repository. If the repository is private, authorise Render to access it through the GitHub integration settings.
2

Configure the service settings

Set Root Directory to backend, Build Command to npm install, and Start Command to npm start. Choose the Free instance type for development or a paid tier for production workloads.
3

Add all environment variables

Navigate to the Environment tab and add every variable listed in the section above. Double-check DB_SSL=true, FRONTEND_URL, and JWT_SECRET before saving — these are the most common sources of deployment failures.
4

Deploy and verify

Click Create Web Service. Render will build and start the service. Once the deploy log shows the server is listening, call GET /api/health to confirm everything is working correctly.
Ordervista uses Render’s free tier, which automatically spins down Web Services after 15 minutes of inactivity. The first request after a cold start may take 30–60 seconds while the container wakes up. This is expected behaviour on the free plan. If consistent response times are required, consider upgrading to a paid Render instance or using an external uptime monitor to send periodic pings to /api/health.

Build docs developers (and LLMs) love