- Do not hardcode API keys in source files.
- The map renderer uses
VITE_GOOGLE_MAPS_API_KEYfrom environment. - Directions/geocoding/search calls are proxied through backend endpoints at
/api/google/*.
- Copy
.env.exampleto.env. - Set
VITE_GOOGLE_MAPS_API_KEYwith a Google Maps browser key. - Restrict the key in Google Cloud Console:
- Allowed URLs (your production domain)
- Enable only required Maps APIs
npm install
npm run devThe Vite dev server proxies /api to http://localhost:8081.
- Build frontend:
npm run build- Ensure backend has
GOOGLE_MAPS_SERVER_API_KEYconfigured. - Deploy frontend and backend behind the same domain or configure
VITE_API_BASE_URL.