Prerequisites
Vercel Account
Turso Database
Google AI Studio Key
Google OAuth Client ID
Frontend Deployment
Import the repository to Vercel
Set the root directory
frontend/. Vercel will scope its build to that subdirectory.Confirm framework and build settings
Add environment variables
Deploy and note your Vercel URL
https://tender-check-ai.vercel.app. Save this — you will need it for CORS and OAuth configuration.Add a custom domain
tendercheckai.elecodes.online). Vercel will display the DNS record to add:Verify SPA routing
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:Backend Deployment
Create a separate Vercel project for the backend
Set the root directory
backend/. This scopes all build and install commands to the backend subdirectory.Configure build and start commands
Add environment variables
Deploy and note the backend URL
https://tendercheck-backend.vercel.app).Update the frontend VITE_API_BASE_URL
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 aredirect_uri_mismatch error.
Open your OAuth credential
Add authorized JavaScript origins
Add authorized redirect URIs
Save and wait for propagation
Important Notes
- 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_ORIGINSmust include the exact frontend URL(s), includinghttps://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 theindex.html shell rather than a 404. The frontend/vercel.json file in the repository handles this automatically by rewriting every path to /index.html:
/dashboard/tenders would return a 404 from Vercel’s edge network instead of loading the React app.