This app is configured for Vercel deployment with serverless API routes so sensitive keys stay server-side.
- Install dependencies:
npm install - Copy env template:
cp .env.example .env - Fill in
.envvalues. - Start dev server:
npm run dev
VITE_GOOGLE_MAPS_API_KEY
Use this only for Google Maps JS SDK, and lock it down with:
- HTTP referrer restrictions (
https://your-domain/*, preview domain, localhost) - API restrictions (only APIs the UI needs)
GEMINI_API_KEYRAPIDAPI_KEYGOOGLE_MAPS_SERVER_API_KEYMAPCN_API_KEY(optional)
These are used by:
/api/gemini/api/listings/api/geocode/api/route
- Push repo to GitHub.
- Import project in Vercel.
- Framework preset:
Vite. - Build command:
npm run build. - Output directory:
dist. - Add environment variables in Vercel Project Settings:
VITE_GOOGLE_MAPS_API_KEYGEMINI_API_KEYRAPIDAPI_KEYGOOGLE_MAPS_SERVER_API_KEYMAPCN_API_KEY(optional)
- Deploy.
vercel.json already includes:
- SPA rewrite for React Router routes.
- Function max duration of 60 seconds.
- Never commit real
.envvalues. - Rotate any keys that were previously exposed in client-side
VITE_*vars. - Keep RapidAPI and Gemini keys server-only.