# Environment Variables

This document describes all environment variables needed for the frontend application.

## Required Environment Variables

### Server Configuration
- `PORT` - Server port (default: 9031)
- `NODE_ENV` - Node environment (production/development)

### Next.js Configuration
- `BASEPATH` - Base path for Next.js application (optional, leave empty for root)
- `NEXT_PUBLIC_APP_URL` - Public URL of the application (e.g., http://localhost:9031)
- `NEXT_PUBLIC_DOCS_URL` - Documentation URL (optional)

### API Configuration
- `NEXT_PUBLIC_API_URL` or `ENVOY_GATEWAY_URL` - Envoy Gateway URL for backend API calls (e.g., http://85.208.253.135:8000)
  - This is used by the frontend to communicate with backend services via Envoy Gateway
  - Defaults to `http://85.208.253.135:8000` if not set

## Optional Environment Variables

### Mapbox
- `MAPBOX_ACCESS_TOKEN` - Mapbox access token for map features

## Example .env file

```env
# Server Configuration
PORT=9031
NODE_ENV=production

# Next.js Configuration
BASEPATH=
NEXT_PUBLIC_APP_URL=http://localhost:9031
NEXT_PUBLIC_DOCS_URL=https://demos.themeselection.com

# API Configuration (Envoy Gateway)
NEXT_PUBLIC_API_URL=http://85.208.253.135:8000
# Alternative: ENVOY_GATEWAY_URL=http://85.208.253.135:8000

# Mapbox (Optional - for map features)
MAPBOX_ACCESS_TOKEN=your-mapbox-access-token
```

## Docker Configuration

When using Docker, these environment variables are set in `docker-compose.yaml`. 
For local development, create a `.env` file in the frontend directory with the values above.



