Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elecodes/TenderCheck-AI/llms.txt

Use this file to discover all available pages before exploring further.

Vercel is the recommended deployment platform for TenderCheck AI. The frontend is deployed as a static Vite site served from Vercel’s global CDN, while the backend runs as serverless Node.js functions. The live demo is hosted at https://tendercheckai.elecodes.online.

Prerequisites

Vercel Account

A free Vercel account connected to your GitHub repository.

Turso Database

A Turso database with its URL and auth token ready.

Google AI Studio Key

A Gemini API key from Google AI Studio.

Google OAuth Client ID

Optional. Required only if you want Google Sign-In enabled in production.

Frontend Deployment

1

Import the repository to Vercel

Go to the Vercel Dashboard, click Add New → Project, and connect your GitHub repository.
2

Set the root directory

In the project configuration screen, set Root Directory to frontend/. Vercel will scope its build to that subdirectory.
3

Confirm framework and build settings

Vercel auto-detects Vite as the framework preset. Verify the following are set:
SettingValue
Framework PresetVite
Build Commandnpm run build
Output Directorydist
4

Add environment variables

In the Environment Variables section, add:
VariableValue
VITE_API_BASE_URLYour backend URL (add this after backend is deployed)
VITE_GOOGLE_CLIENT_IDYour OAuth Client ID (optional)
VITE_ENABLE_GOOGLE_AUTHtrue (optional, shows Google login button)
See Environment Variables for the full reference.
5

Deploy and note your Vercel URL

Click Deploy. Once the build completes, Vercel assigns a URL such as https://tender-check-ai.vercel.app. Save this — you will need it for CORS and OAuth configuration.
6

Add a custom domain

Go to Settings → Domains in your Vercel project and enter your custom subdomain (e.g. tendercheckai.elecodes.online). Vercel will display the DNS record to add:
TypeNameValue
CNAMEtendercheckaicname.vercel-dns.com
Add this record in your DNS provider (Namecheap, Cloudflare, etc.) and wait for propagation.
7

Verify SPA routing

The frontend/vercel.json file at the root of the frontend directory rewrites all paths to index.html, which is required for React Router to work on direct URL loads and page refreshes:
{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}
This file is already committed to the repository. No additional configuration is needed.

Backend Deployment

1

Create a separate Vercel project for the backend

From the Vercel Dashboard, click Add New → Project and import the same GitHub repository again. Vercel supports multiple projects from one monorepo.
2

Set the root directory

Set Root Directory to backend/. This scopes all build and install commands to the backend subdirectory.
3

Configure build and start commands

SettingValue
Build Commandnpm run build
Start Commandnpm start
4

Add environment variables

Add the following in the Environment Variables section:
VariableNotes
TURSO_DB_URLMust use https://, not libsql:// (see Important Notes below)
TURSO_AUTH_TOKENFrom turso db tokens create
GOOGLE_GENAI_API_KEYGemini key from Google AI Studio
GOOGLE_API_KEYSame Gemini key (required by Genkit 1.28.0+)
JWT_SECRETGenerate with openssl rand -base64 32
NODE_ENVproduction
ALLOWED_ORIGINSYour frontend Vercel URL and custom domain, comma-separated
5

Deploy and note the backend URL

Click Deploy. Once complete, copy the backend URL (e.g. https://tendercheck-backend.vercel.app).
6

Update the frontend VITE_API_BASE_URL

Go back to your frontend Vercel project → Settings → Environment Variables and set VITE_API_BASE_URL to the backend URL from the previous step. Trigger a new frontend deployment to apply the change.

Google OAuth Configuration

If you are using Google Sign-In, you must register your Vercel domain as an authorized origin in Google Cloud Console, otherwise the OAuth flow will fail with a redirect_uri_mismatch error.
1

Open your OAuth credential

Go to Google Cloud Console → Credentials and click Edit on your OAuth 2.0 Client ID.
2

Add authorized JavaScript origins

Under Authorized JavaScript origins, add both your Vercel URL and your custom domain:
https://tender-check-ai.vercel.app
https://tendercheckai.elecodes.online
3

Add authorized redirect URIs

Under Authorized redirect URIs, add the same two URLs.
4

Save and wait for propagation

Click Save. Google OAuth changes take up to 5 minutes to take effect globally.
If users see a redirect_uri_mismatch error after deploying, the most common cause is a missing or mismatched entry in Authorized JavaScript Origins. Double-check that both your Vercel-assigned URL and any custom domain are listed exactly, including the https:// protocol and no trailing slash.

Important Notes

TURSO_DB_URL must use https:// on Vercel, not libsql://. The libsql:// WebSocket protocol is not supported in Vercel’s serverless runtime. Using libsql:// will cause the backend to fail to connect to the database at startup. This enforcement was added in ADR 029. Convert your URL like this:
# ❌ Does not work on Vercel
libsql://your-db-name.turso.io

# ✅ Use this on Vercel
https://your-db-name.turso.io
  • Cold starts: Vercel serverless functions spin down when idle. The first request after a period of inactivity may take a few extra seconds while the Node.js runtime initializes.
  • ALLOWED_ORIGINS must include the exact frontend URL(s), including https:// and no trailing slash. The backend reads this as a comma-separated list and rejects any unlisted origin in production mode.

SPA Routing

React Router requires that all client-side routes return the index.html shell rather than a 404. The frontend/vercel.json file in the repository handles this automatically by rewriting every path to /index.html:
{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}
Without this file, navigating directly to a route such as /dashboard/tenders would return a 404 from Vercel’s edge network instead of loading the React app.

Build docs developers (and LLMs) love