Skip to main content

Runtime Configuration Reference

Use this page to document the local-development and deployment configuration contract.

Truth Sources

  1. core/backend/.env.example
  2. core/frontend/.env.example
  3. docker-compose.yml
  4. scripts/setup-workspace.mjs
  5. workspace manifests and runtime scripts

Current Finance Variables

Backend

VariableDefaultPurpose
PORT3001Backend HTTP port
SERVICE_NAMEfinance-backendLogical service name for health responses
METRICS_PREFIXfinance_Prefix for default Prometheus metrics
DATABASE_TYPEpostgresDatabase driver, either postgres or local development sqljs
DATABASE_FILEfinance.local.sqliteLocal SQL.js file used when DATABASE_TYPE=sqljs
DATABASE_HOSTlocalhostPostgreSQL host
DATABASE_PORT5433PostgreSQL host port
DATABASE_NAMEfinance_appPostgreSQL database name
DATABASE_USERpostgresPostgreSQL user
DATABASE_PASSWORDpostgresPostgreSQL password
TYPEORM_SYNCHRONIZEtrueLocal development schema synchronization
TYPEORM_LOGGINGfalseTypeORM SQL logging toggle
AUTH_JWT_SECRETrequired outside local defaultsHMAC secret used to sign bearer sessions and Google OAuth state
AUTH_SESSION_TTL_SECONDS604800Bearer session lifetime in seconds
FRONTEND_APP_URLhttp://localhost:5173Frontend origin used by Google SSO redirects
GOOGLE_CLIENT_IDemptyGoogle OAuth client ID
GOOGLE_CLIENT_SECRETemptyGoogle OAuth client secret
GOOGLE_REDIRECT_URIhttp://localhost:3001/auth/google/callbackOAuth redirect URI configured in Google Cloud
GEMINI_API_KEYemptyOptional Gemini API key for async invoice classification; empty or disabled uses local-rule fallback
GEMINI_MODELgemini-2.5-flashGemini model used by async invoice classification jobs
GEMINI_PROVIDERdeveloperGemini provider, either developer for API-key calls or vertex for Google Cloud Vertex AI
GEMINI_VERTEX_PROJECT_IDemptyGoogle Cloud project used when GEMINI_PROVIDER=vertex
GEMINI_VERTEX_LOCATIONus-central1Vertex AI location used when GEMINI_PROVIDER=vertex
VOICE_COMMAND_GEMINI_MODELgemini-2.5-flash-liteLow-cost Gemini model used to turn short voice transcripts into confirmable app actions
SPEECH_GOOGLE_PROJECT_IDemptyGoogle Cloud project for Speech-to-Text V2; staging sets this to the same project as Vertex AI
SPEECH_GOOGLE_LOCATIONglobalSpeech-to-Text V2 recognizer location
SPEECH_RECOGNITION_MODELlatest_longSpeech-to-Text model for natural mobile voice commands, including brief openings or pauses before the actual command
IMPORT_JOB_WORKER_ENABLEDtrueEnables the backend worker that processes queued import classification jobs

Frontend

VariableDefaultPurpose
VITE_API_BASE_URLhttp://localhost:3001Backend API origin used by the finance frontend

Local Services

ServiceDefaultPurpose
PostgreSQLlocalhost:5433Finance relational database
Redislocalhost:6380Support service for future cache/queue concerns

When Docker or PostgreSQL is unavailable, local feature testing can use DATABASE_TYPE=sqljs without starting npm run services:up. Production and shared environments should continue to use PostgreSQL.

GCP Staging

The staging environment is managed by Terraform under infra/gcp/ and deploys:

  • Cloud Run backend
  • Cloud Run static frontend
  • Cloud Run static Docusaurus docs
  • Cloud SQL PostgreSQL
  • Secret Manager
  • Artifact Registry
  • GitHub Workload Identity Federation

Staging intentionally uses TYPEORM_SYNCHRONIZE=true until production-grade migrations are added.

Current staging service names:

ServicePurpose
financeapp-staging-webReact frontend
financeapp-staging-apiNestJS API
financeapp-staging-docsDocusaurus docs

Runtime operator procedures are maintained in docs/STAGING_RUNBOOK.md.