Skip to main content
TenderCheck AI uses two sets of environment variables: one for the backend Node.js server and one for the frontend Vite application. Backend variables are loaded at runtime via dotenv. Frontend variables are injected at build time by Vite and must be prefixed with VITE_ to be accessible in the browser bundle.

Backend Environment Variables

These variables are read by the Express server at startup. Copy backend/.env.example to backend/.env and fill in the values before running the server locally.

Frontend Environment Variables

These variables are embedded into the React bundle at build time by Vite. Set them in frontend/.env for local development, or as build-time environment variables in your hosting platform.
frontend/.env.example also includes GOOGLE_GENAI_API_KEY, GOOGLE_API_KEY, TURSO_DB_URL, and TURSO_AUTH_TOKEN as optional local development overrides. These keys belong in the backend in production. Do not set them as Vite build variables in any deployed environment, as they would be exposed in the browser bundle.

Security Notes

Never commit .env files to Git. Both backend/.env and frontend/.env are listed in .gitignore. Committing secrets exposes your database, AI quota, and user authentication to anyone with repository access.
  • JWT_SECRET must be at least 32 randomly-generated characters in any production or staging environment. A short or guessable secret allows token forgery and full account compromise.
  • TURSO_DB_URL on Vercel must use the https:// protocol, not libsql://. The libsql:// WebSocket protocol is blocked in Vercel’s serverless runtime. This requirement was enforced in ADR 029.
  • ALLOWED_ORIGINS must exactly match your frontend domain, including protocol (https://) and without a trailing slash. The server parses this variable as a comma-separated list and rejects any origin not present in that list when NODE_ENV=production.

Local Development

Create your local environment files by copying the provided examples:
Then open each file and replace the placeholder values with your real credentials before starting the development servers.
Generate a strong, production-grade JWT_SECRET with a single command:
Copy the output directly into your .env file or your hosting platform’s secret manager.