1# AI Software Factory — realtime gateway (apps/realtime) 2# Copy to .env and fill in real values. NEVER commit secrets to source control. 3 4# WebSocket gateway port (ws) 5PORT=4001 6# Health/metrics HTTP port 7HEALTH_PORT=4002 8# JWT secret shared with the API (HS256; 32+ bytes) 9JWT_SECRET=change-me-32-bytes-minimum-0000 10# Redis (cross-node room fan-out, presence) 11REDIS_URL=redis://localhost:6379 12# API base URL (token/session verification fallback) 13API_URL=http://localhost:4000 14# Log level: fatal | error | warn | info | debug | trace 15LOG_LEVEL=info 16# Rate limiting: max messages per client per window 17RATE_LIMIT_WINDOW_MS=60000 18RATE_LIMIT_MAX=300 19# Maximum sockets per document room 20MAX_ROOM_SIZE=200 21# Realtime DB (REALTIME_DB=0 → in-memory doc store, dev mode) 22REALTIME_DB=1 23# Shared service token for the API's internal endpoints (TASK-0092 slice 2). 24# Non-empty → the doc store persists through the API's /internal/blocks/* 25# (the production seam — one Postgres write funnel); empty → the 26# in-process Prisma store (single-node dev). Must MATCH the API's 27# INTERNAL_SERVICE_TOKEN (the guard fails closed when it is empty there). 28INTERNAL_SERVICE_TOKEN= 29