---
summary: Environment variables, defaults, and what each one tunes.
title: Configuration
path: reference/configuration
status: published
---

# Configuration

All configuration is environment-driven through `pydantic-settings`. A
`.env.example` ships in each service directory.

## Backend (`backend/.env`)

| Var | Default | Purpose |
|---|---|---|
| `DATABASE_URL` | `mysql+aiomysql://…` | MariaDB DSN. |
| `REDIS_URL` | `redis://localhost:6379/0` | Cache + ARQ. |
| `SECRET_KEY` | `change-me-in-production` | JWT signing. Share with delivery. |
| `ALGORITHM` | `HS256` | JWT alg. Share with delivery. |
| `ACCESS_TOKEN_EXPIRE_MINUTES` | `30` | JWT access TTL. |
| `REFRESH_TOKEN_EXPIRE_DAYS` | `7` | JWT refresh TTL. |
| `CORS_ORIGINS` | `[localhost:3000,…]` | Browser CORS allow-list. |
| `API_KEY_PREFIX` | `scai_` | Prefix of issued keys. |
| `S3_ENDPOINT_URL` | _(empty)_ | MinIO or other S3-compat. |
| `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY` | — | S3 credentials. |
| `S3_BUCKET_NAME` | `scaicms-assets` | Bucket. |
| `WEAVIATE_URL` | `http://localhost:8080` | Vector DB. |
| `WEAVIATE_API_KEY` | — | Auth for hosted Weaviate. |
| `WEAVIATE_COLLECTION_NAME` | `Content` | Content index. |
| `WEAVIATE_DOC_COLLECTION_NAME` | `DocPage` | Docs index. |
| `SEARCH_HYBRID_ALPHA` | `0.7` | 0 = pure BM25; 1 = pure vector. |

## Delivery (`delivery/.env`)

| Var | Default | Purpose |
|---|---|---|
| `DELIVERY_HOST`, `DELIVERY_PORT` | `0.0.0.0:8080` | Listen address. |
| `DELIVERY_DATABASE_URL` | shared with backend | Read-only access. |
| `DELIVERY_REDIS_URL` | shared with backend | Cache + invalidations. |
| `SECRET_KEY`, `ALGORITHM` | shared with backend | Validates session cookies. |
| `DELIVERY_DOCS_SESSION_COOKIE` | `scaicms_docs_session` | Cookie name. |
| `DELIVERY_DOCS_SESSION_MAX_AGE` | `604800` | 7 days. |
| `DELIVERY_S3_*` | shared with backend | Templates + media. |

## Admin (`admin/.env`)

| Var | Default | Purpose |
|---|---|---|
| `VITE_API_URL` | proxied via vite | Backend base URL. |
