---
# ConfigMap for backend configuration
apiVersion: v1
kind: ConfigMap
metadata:
  name: backend-config
  namespace: dating-app
data:
  JWT_SECRET: {{ .Values.backend.environment.JWT_SECRET | quote }}
  JWT_EXPIRES_MINUTES: {{ .Values.backend.environment.JWT_EXPIRES_MINUTES | quote }}
  MEDIA_DIR: {{ .Values.backend.environment.MEDIA_DIR | quote }}
  CORS_ORIGINS: {{ .Values.backend.environment.CORS_ORIGINS | quote }}
  DATABASE_URL: "postgresql://{{ .Values.postgres.credentials.username }}:{{ .Values.postgres.credentials.password }}@postgres.dating-app.svc.cluster.local:{{ .Values.postgres.service.port }}/{{ .Values.postgres.credentials.database }}"

---
# ConfigMap for frontend configuration
apiVersion: v1
kind: ConfigMap
metadata:
  name: frontend-config
  namespace: dating-app
data:
  VITE_API_URL: {{ .Values.frontend.environment.VITE_API_URL | quote }}
