Skip to main content

Environment Variables

All configuration is loaded via a .env file in the project root. Copy .env.example to .env and populate each value before starting the server.

note

The CODETR_*, FLOOD_BACKEND_URL, and GATEWAY_SHARED_SECRET settings point to or protect services that run on Jetstream2 at Indiana University through NSF ACCESS allocation CIS251126. See the Acknowledgments.

Reference​

VariableRequiredDescription
NODE_ENVNodevelopment or production. Affects logging behavior.
PORTNoServer listen port. Defaults to 3000.
CESIUM_ION_TOKENYesCesium Ion access token. Needed for Google 3D Tiles (asset #2275207). Get one at ion.cesium.com.
TOMTOM_API_KEYYesTomTom Maps API key for live traffic tiles. A fallback key is hardcoded but may be rate-limited. Get one at developer.tomtom.com.
AIRNOW_API_KEYYesAirNow API key for real-time AQI data. Free registration at docs.airnowapi.org.
NY511_API_KEYNo511NY API key. Used by the /ny511-cameras proxy endpoint (not the primary camera source).
TRAFFIC_VIEW_API_KEYYesTrafficView API key for FDOT CCTV cameras. Used by /fdot-cameras.
EM_FIREBASE_API_KEYYesFirebase Web API key for the Emergency Management project (CORD2). Used to obtain an anonymous Firebase ID token to authenticate CORD2 Cloud Function calls.
FIREBASE_SERVICE_ACCOUNT_JSONYes*Full Firebase Admin service account JSON as a single-line string. Used in production/Render for CO₂ sensor Firestore access.
FIREBASE_SERVICE_ACCOUNT_PATHYes*Relative path to a Firebase Admin service account JSON file. Used for local development instead of the JSON env var.
NOTEHUB_PROJECT_UIDNoBlues Notehub project UID. Used by the legacy /sensor-data endpoint (Notehub-sourced sensors).
NOTEHUB_ACCESS_TOKENNoBlues Notehub bearer token for /sensor-data.
CODETR_API_KEYNoCo-DETR API key used server-side for /detect-image and FDOT batch jobs.
CODETR_BACKEND_URLNoCo-DETR backend base URL. Defaults to the deployed UCF UrbanGeoLens backend.
CODETR_TIMEOUT_MSNoCo-DETR request timeout in milliseconds. Defaults to 300,000; accepted settings are bounded to 30,000–600,000.
SUPABASE_SERVICE_ROLE_KEYNoSupabase service-role key for the /admin user-management API. Server only. See Roles and Permissions.
SUPABASE_URL, SUPABASE_ANON_KEYNoOverride the project in auth/supabase-config.js when verifying sessions on the server.
SITE_URLNoPublic base URL used in invite emails, e.g. https://geo-lens.net.
ACCESS_CONTROLNooff disables permission checks (local development only). Default enforces.
GATEWAY_SHARED_SECRETNoSent to the Jetstream2 CO₂/Flood services as X-GeoLens-Gateway. Set the same value there to lock them to this server.
EXTENSIONS_DIRNoFolder of access-restricted extensions (default server/protected). Point it outside the repo (for example a Render secret-file path) to keep extension code out of git.
CESIUM_ION_TOKEN_MARS, CESIUM_ION_TOKEN_MOONNoOptional ion tokens restricted to that world's assets, served by /config?planet=. Fall back to CESIUM_ION_TOKEN.

* Exactly one of FIREBASE_SERVICE_ACCOUNT_JSON or FIREBASE_SERVICE_ACCOUNT_PATH must be set for CO₂ sensor and history endpoints to function.

Loading Priority for Firebase Credentials​

The server checks credentials in this order:

  1. FIREBASE_SERVICE_ACCOUNT_JSON (preferred for cloud deployments, no file path issues)
  2. FIREBASE_SERVICE_ACCOUNT_PATH (relative to project root, preferred locally)

If neither is found, CO₂ sensor endpoints return 503 Service Unavailable.

Client-Exposed Variables​

The /config endpoint exposes a safe subset to the frontend:

{
"cesiumIonToken": "..."
}

API keys, including CODETR_API_KEY, are used server-side as proxy credentials and are not sent to the client.

Example .env​

NODE_ENV=development
PORT=3000

CESIUM_ION_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
TOMTOM_API_KEY=your_tomtom_key_here
AIRNOW_API_KEY=your_airnow_key_here
TRAFFIC_VIEW_API_KEY=your_trafficview_key_here
EM_FIREBASE_API_KEY=AIzaSy...

# Local dev: use file path
FIREBASE_SERVICE_ACCOUNT_PATH=co2_firebase_utils/service_key.json

CODETR_API_KEY=your_codetr_key_here