> ## Documentation Index
> Fetch the complete documentation index at: https://blue-chip.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

# Configuration

Settings are plain environment variables read in `app/core/config.py`. At import
time, the first matching file from `.env.<environment>.local`,
`.env.<environment>`, `.env.local`, or `.env` in `apps/api/` is loaded.

## Application

| Variable | Default | Purpose |
| - | - | - |
| `APP_ENV` | `development` | `development`, `staging`, `production`, `test` |
| `PROJECT_NAME` | `Five Star Startups API` | OpenAPI title |
| `VERSION` | `1.0.0` | API version |
| `DESCRIPTION` | `A simple FastAPI backend with Supabase authentication` | OpenAPI description |
| `API_V1_STR` | `/api/v1` | Route prefix |
| `DEBUG` | env-specific (`true` in dev/test, `false` in staging/prod) | Enables profiling and debug log level |
| `ALLOWED_ORIGINS` | env-specific (`*` in dev/test, `[]` in staging/prod) | Comma-separated CORS origins; fails closed outside dev/test |

## Supabase

| Variable | Default | Purpose |
| - | - | - |
| `SUPABASE_URL` | — | Project URL (issuer + JWKS) |
| `SUPABASE_SERVICE_ROLE_KEY` | — | Backend-only; used for account deletion via the Auth Admin API |
| `SUPABASE_JWT_AUDIENCE` | `authenticated` | Expected `aud` claim |
| `SUPABASE_JWKS_CACHE_SECONDS` | `600` | JWKS key cache lifetime |

## Postgres

| Variable | Default | Purpose |
| - | - | - |
| `POSTGRES_HOST` | `localhost` | Use the Supabase session pooler host (or `db` inside Docker Compose) |
| `POSTGRES_PORT` | `5432` | Session pooler port |
| `POSTGRES_DB` | `postgres` | Database name |
| `POSTGRES_USER` | `postgres` | Role (bypasses RLS for the `app` schema) |
| `POSTGRES_PASSWORD` | `postgres` | Password |
| `POSTGRES_SSLMODE` | `prefer` | `require` for Supabase |
| `POSTGRES_POOL_SIZE` | `20` | Async pool size |
| `POSTGRES_MAX_OVERFLOW` | `10` | Async pool overflow |

## Logging and profiling

| Variable | Default | Purpose |
| - | - | - |
| `LOG_DIR` | `logs` | JSONL log directory (`<environment>-<YYYY-MM-DD>.jsonl`) |
| `LOG_LEVEL` | env-specific (`DEBUG` in dev/test, `INFO` in staging, `WARNING` in prod) | Standard log level |
| `LOG_FORMAT` | env-specific (`console` in dev/test, `json` in staging/prod) | `json` or `console` |
| `PROFILING_DIR` | `/tmp/fastapi_profiles` | Slow-request profile reports (`DEBUG` only) |
| `PROFILING_THRESHOLD_SECONDS` | `2.0` | Profile requests slower than this |

## Rate limiting and Redis

| Variable | Default | Purpose |
| - | - | - |
| `RATE_LIMIT_DEFAULT` | env-specific (`1000 per day,200 per hour` in dev; `500 per day,100 per hour` in staging; `200 per day,50 per hour` in prod; `1000 per day,1000 per hour` in test) | Global default limits |
| `RATE_LIMIT_READ` | `120 per minute` | Read endpoints (`GET /profile`, `GET /organizations*`, `GET /metrics/velocity`) |
| `RATE_LIMIT_WRITE` | `30 per minute` | Write endpoints (`PATCH /profile`, `DELETE /account`) |
| `RATE_LIMIT_ROOT` | `10 per minute` | `/` |
| `RATE_LIMIT_HEALTH` | `20 per minute` | `/health` |
| `REDIS_URL` | — | Full Redis storage URI (takes precedence over `REDIS_HOST`); empty = in-memory (single process) |
| `REDIS_HOST` | — | Redis host (used when `REDIS_URL` is unset) |
| `REDIS_PORT` | `6379` | Redis port |
| `REDIS_DB` | `0` | Redis database index |
| `REDIS_PASSWORD` | — | Redis password |

## Metrics

| Variable | Default | Purpose |
| - | - | - |
| `METRICS_TOKEN` | — | Bearer token for `/metrics`; empty + non-dev/test = `/metrics` disabled (404) |

## Temporal (boilerplate)

| Variable | Default | Purpose |
| - | - | - |
| `TEMPORAL_ADDRESS` | `localhost:7233` | Server address |
| `TEMPORAL_NAMESPACE` | `default` | Namespace |
| `TEMPORAL_API_KEY` | — | Set for Temporal Cloud (enables TLS) |
| `TEMPORAL_TASK_QUEUE` | `starter` | Worker task queue |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.