> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hellocobi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Frontend Service

> Environment variables and secrets required to run the Cobi frontend service on-premises

## Overview

The frontend is a Vite/React application served as a Node.js process on port `8080`. It is exposed through Gateway API, Ingress, or an OpenShift Route — separate from the backend API hostname.

The frontend calls the backend API using `VITE_API_BASE_URL`, which must be set to the backend's public URL.

## Required Secrets

```bash theme={null}
kubectl create secret generic cobi-frontend-secrets \
  --namespace cobi \
  --from-literal=NODE_ENV="production" \
  --from-literal=VITE_API_BASE_URL="https://api.example.com" \
  --from-literal=VITE_API_SANDBOX_URL="https://api.example.com"
```

`VITE_API_BASE_URL` must match the hostname of the backend Gateway route, Ingress, or Route.

## Environment Variable Reference

| Variable               | Required | Description                                                                                                      |
| ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `VITE_API_BASE_URL`    | Yes      | Public base URL of the **backend** API. The frontend constructs all API request URLs from this value             |
| `VITE_API_SANDBOX_URL` | No       | Base URL for sandbox API calls. Set to the same value as `VITE_API_BASE_URL` if only one environment is deployed |
| `HOST`                 | No       | Server bind address. Defaults to `0.0.0.0` in the container image — only set if you need to override             |

## Helm Values

```yaml theme={null}
frontend:
  enabled: true
  image:
    repository: docker.io/hellocobi/dashboard-frontend
    tag: "0.1.9"
    pullPolicy: IfNotPresent
  replicaCount: 1
  service:
    type: ClusterIP
    port: 8080
  envFrom:
    - secretRef:
        name: cobi-frontend-secrets
  resources:
    requests:
      cpu: 100m
      memory: 256Mi
    limits:
      cpu: 500m
      memory: 512Mi
```

## Notes

`VITE_*` variables are injected at **container start time** via a server-side env-injection mechanism in the Cobi image, so Secret changes take effect after a pod restart — no image rebuild is required.
