# emaui environment
#
# Vite reads this from the workspace root, not from the app directory:
# apps/portal/vite.config.mts and apps/backoffice/vite.config.mts both set
# `envDir: '../../'`. So copy this file to ./.env here, at the repo root.
#
#   cp .env.example .env
#
# Only VITE_-prefixed values reach the browser, and everything that does is
# public — it ships inside the built bundle. Never put a secret here. The Fayda
# client id, private key and endpoints live in the API's environment only; the
# frontend never speaks to Fayda directly.

# Base URL of the emaapi backend, including the /api prefix.
# 3001, not 3000: the portal itself takes 3000 in development, because that is
# the port in the Fayda redirect URI registered for local testing. Set PORT=3001
# in emaapi's .env to match.
VITE_BASE_API_URL=http://localhost:3001/api

# Serve fixture data instead of calling the API. Any value other than "true"
# uses the real backend.
VITE_USE_MOCKS=false

# --- Docker Compose only -----------------------------------------------------
# Host ports published by docker-compose.yml. It also expects per-app env files
# at apps/portal/.env and apps/backoffice/.env, which can each be a copy of this
# file. Ignored when running the Vite dev servers, which serve the portal on
# 3000 and the backoffice on 4201.
# EMA_PORTAL_PORT=8021
# EMA_BACKOFFICE_PORT=8022

# --- Fayda note --------------------------------------------------------------
# There is nothing to configure here for Fayda. The portal serves the callback
# page at /callback and /signup/fayda/callback, and whichever path is registered
# with Fayda must match the API's FAYDA_REDIRECT_URI exactly.
#
# The value being registered first is http://localhost:3001/callback, so the
# portal's dev server now listens on 3000 and emaapi moves to 3001. Nothing
# extra to run — `nx serve portal` already binds the right port.
