UrbanReflex Logo
UrbanReflex

Configuration

Environment variables, services, and run commands

Configuration

Backend .env (core)

# Database
MONGODB_URI=mongodb://localhost:27017
MONGODB_DB_NAME=urbanreflex
ORION_LD_URL=http://localhost:1026
 
# AI (optional but required for chatbot with Gemini)
GEMINI_API_KEY=
 
# Vector search (optional RAG)
PINECONE_API_KEY=
PINECONE_ENVIRONMENT=
PINECONE_INDEX_NAME=urbanreflex-index
 
# External data (optional; mock used if absent)
OPENAQ_API_KEY=
OPENWEATHER_API_KEY=
 
# Security
SECRET_KEY=change_me
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
 
# CORS
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000
 
# Logging
LOG_LEVEL=INFO

Frontend src/frontend/.env.local

NEXT_PUBLIC_API_URL=http://localhost:8000

(Docs site uses Next.js export in docs/documentation; API URL above is for app/frontend.)

Docker Compose (dev stack)

  • just dev / just db-start will start MongoDB + Orion-LD (and scheduler if configured).
  • Default ports: MongoDB 27017, Orion-LD 1026, backend 8000, frontend 3000.

Just Commands (common)

just install       # Install UV + backend deps + frontend deps
just setup-env     # Copy .env and .env.local templates
just dev           # Start DBs + show backend/frontend instructions
just backend-dev   # Run FastAPI dev server (8000)
just frontend-dev  # Run Next.js dev server (3000)
just db-start      # Start MongoDB + Orion-LD
just db-logs       # Tail DB logs
just test          # Run backend tests
just format        # Format code (Black + Prettier)
just lint          # Lint (Flake8 + ESLint)

Production Notes (baseline)

  • Set DEBUG=false, LOG_LEVEL=WARNING (or appropriate level).
  • Enforce HTTPS and restrictive CORS for public hosts.
  • Provide real secrets for SECRET_KEY, API keys, and any auth providers.
  • Size and secure MongoDB/Orion-LD for production workloads (backups, auth, network policies).

On this page