# Database backend — "sqlite" (default) or "postgres"
DATABASE_BACKEND=sqlite

# Option A: SQLite (default, zero external dependencies)
DATABASE_URL=sqlite://movies.db

# Option B: PostgreSQL
# DATABASE_BACKEND=postgres
# DATABASE_URL=postgres://user:password@localhost:5432/movies_diary

# Authentication
JWT_SECRET=change-me
JWT_TTL_SECONDS=86400

# OMDb/TMDB metadata
OMDB_API_KEY=your-key
TMDB_API_KEY=your-key

# Poster storage — Option A (local) is active. To use S3, comment it out and uncomment Option B:

# Option A: local filesystem (zero external dependencies)
POSTER_STORAGE_BACKEND=local
POSTER_STORAGE_PATH=./posters

# Option B: S3-compatible (MinIO, AWS S3, etc.)
# POSTER_STORAGE_BACKEND=s3
# MINIO_ENDPOINT=http://localhost:9000
# MINIO_BUCKET=posters
# MINIO_REGION=minio
# MINIO_ACCESS_KEY_ID=minioadmin
# MINIO_SECRET_ACCESS_KEY=minioadmin

# Optional
HOST=0.0.0.0
PORT=3000
BASE_URL=http://localhost:3000
SECURE_COOKIES=false
ALLOW_REGISTRATION=false
RATE_LIMIT=20
POSTER_FETCH_TIMEOUT_SECONDS=30

# Event bus — "db" (default) or "nats"
# The worker binary must run alongside the presentation to process events.
EVENT_BUS_BACKEND=db

# Option A: DB queue (default — no extra infrastructure needed)
# Events are persisted in the same database as the app and polled by the worker.
# EVENT_QUEUE_POLL_INTERVAL_MS=500   # polling interval (default: 500ms)
# EVENT_QUEUE_BATCH_SIZE=10          # rows claimed per poll cycle (default: 10)
# EVENT_QUEUE_MAX_ATTEMPTS=5         # retries before dead-lettering (default: 5)

# Option B: NATS (at-least-once delivery, recommended for higher throughput)
# EVENT_BUS_BACKEND=nats
# NATS_URL=nats://localhost:4222
# NATS_MODE=jetstream           # "jetstream" (default, at-least-once) or "core" (fire-and-forget)
# NATS_SUBJECT_PREFIX=movies-diary.events
# NATS_STREAM_NAME=MOVIES_DIARY_EVENTS
# NATS_CONSUMER_NAME=worker

# Image conversion (optional — converts stored images to save disk space)
# Disable by default; enable in the worker by setting ENABLED=true.
# IMAGE_CONVERSION_ENABLED=false
# IMAGE_CONVERSION_FORMAT=avif   # avif | webp

# Annual Wrap-Up (video generation — optional, requires ffmpeg)
# WRAPUP_FONT_PATH=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
# WRAPUP_LOGO_PATH=./static/logo.webp
# WRAPUP_BG_DIR=./static/wrapup-backgrounds   # directory of jpg/png/webp images for video slide backgrounds
# FFMPEG_PATH=ffmpeg
# WRAPUP_MAX_CONCURRENT=2

RUST_LOG=presentation=debug,tower_http=debug,worker=info,application=info
