Backend API
Environment Variables
All configuration variables for the Cookest API
Environment Variables
Copy .env.example to .env and fill in the required values.
cp .env.example .envRequired variables
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgres://user:pass@localhost/cookest |
JWT_SECRET | JWT signing key β minimum 32 characters | super-secret-key-at-least-32-chars |
Optional variables
| Variable | Default | Description |
|---|---|---|
HOST | 0.0.0.0 | Server bind address |
PORT | 8080 | Server port |
CORS_ORIGIN | http://localhost:3000 | Allowed CORS origin |
JWT_ACCESS_EXPIRY_SECONDS | 900 | Access token TTL (15 minutes) |
JWT_REFRESH_EXPIRY_SECONDS | 2592000 | Refresh token TTL (30 days) |
OLLAMA_URL | http://localhost:11434 | Ollama API base URL |
OLLAMA_MODEL | llava | Vision model for PDF price extraction |
PDF_UPLOAD_DIR | /var/cookest/pdfs | Writable directory for uploaded PDFs |
STRIPE_WEBHOOK_SECRET | β | Stripe webhook signing secret (whsec_...) |
Security notes
Never commit your .env file. The .gitignore already excludes it. In production, inject secrets via environment variables or a secrets manager β never via a committed file.
JWT_SECRETmust be at least 32 characters of random data (openssl rand -hex 32)STRIPE_WEBHOOK_SECRETstarts withwhsec_β obtain from the Stripe dashboardDATABASE_URLshould use a dedicated database user with least-privilege permissions in production