Production Environment Setup
This page covers configuration differences between local development and production (Render) deployments.
Firebase Credentials
| Environment | Recommended Approach |
|---|---|
| Local development | Set FIREBASE_SERVICE_ACCOUNT_PATH to a relative path (e.g., co2_firebase_utils/service_key.json) |
| Production (Render) | Set FIREBASE_SERVICE_ACCOUNT_JSON to the full JSON content as a single-line string |
To convert a JSON file to a single-line string for Render:
cat co2_firebase_utils/service_key.json | tr -d '\n'
Paste the output as the value of FIREBASE_SERVICE_ACCOUNT_JSON in the Render environment.
Never commit the service_key.json file to Git. It is in .gitignore by default.
Supabase Configuration
Supabase credentials (supabaseUrl and supabaseAnonKey) are stored in auth/supabase-config.js, which is served as a static file. These are public values (the Supabase anon key is safe to expose client-side given that RLS policies are configured correctly).
For production:
- Create a separate Supabase project (or use the same one)
- Update
auth/supabase-config.jswith the correct URL and anon key before deploying - In Supabase Authentication → URL Configuration, add
https://geo-lens.netas an allowed site URL and redirect URL
OpenWeatherMap Key
The OpenWeatherMap API key is currently embedded directly in client/public/js/app.js. For production hardening, consider:
- Adding
OPENWEATHERMAP_API_KEYto.env - Exposing it through the
/configendpoint - Fetching it in
app.jsat startup
TomTom Fallback Key
server/server.js has a hardcoded fallback TomTom API key. In production, always set TOMTOM_API_KEY explicitly to avoid rate-limiting on the shared fallback key.
NODE_ENV
Set NODE_ENV=production in the Render environment. This is currently used for logging verbosity and may be used for future optimizations.
Checklist: Production Deployment
-
CESIUM_ION_TOKENset in Render -
TOMTOM_API_KEYset in Render -
AIRNOW_API_KEYset in Render -
TRAFFIC_VIEW_API_KEYset in Render -
EM_FIREBASE_API_KEYset in Render -
FIREBASE_SERVICE_ACCOUNT_JSONset in Render (not_PATH) -
CODETR_API_KEYset in Render (if using camera interoperability) -
auth/supabase-config.jsupdated with production Supabase credentials - Supabase redirect URLs configured for
https://geo-lens.net -
supabase/schema.sqlhas been run on the Supabase project - Custom domain (
geo-lens.net) CNAME or A record pointing to Render - Custom domain (
docs.geo-lens.net) CNAME pointing to Render Static Site