Files
LiveServer-M1/.env.example
joylessorchid a42ec96965 perf: Redis pub/sub, PgBouncer, optimistic UI for high concurrency
- Add Redis 7 for pub/sub (lobby + chat real-time), rate limiting, caching
- Replace SSE DB polling with Redis pub/sub (lobby: instant approval, chat: instant delivery)
- Add PgBouncer (transaction mode, 500 client → 25 pool connections)
- Chat SSE stream via Redis pub/sub instead of 3s polling
- Optimistic UI in ChatPanel (messages appear before server confirms)
- Redis-based rate limiter (works across multiple app replicas)
- Prisma query optimization (select only needed fields)
- Chat message cache in Redis (10s TTL)
- Docker Compose: add redis, pgbouncer services with healthchecks
- Production: resource limits, 2 app replicas behind Traefik
- Update CLAUDE.md, README.md, .env.example, setup.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 14:17:25 +03:00

40 lines
1.2 KiB
Plaintext

# === Domain & SSL (оставь пустым для локалки) ===
# DOMAIN=live.example.com
# ACME_EMAIL=admin@example.com
# === Local dev protection (работает когда DOMAIN не задан) ===
# Ключ доступа: открой http://192.168.x.x:3000?key=mySecretKey123
DEV_ACCESS_KEY=mySecretKey123
# Разрешённые IP (через запятую). localhost всегда разрешён.
# ALLOWED_IPS=192.168.1.10,192.168.1.11
# === Database ===
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/liveserver
POSTGRES_PASSWORD=postgres
# === LiveKit ===
LIVEKIT_URL=wss://your-project.livekit.cloud
NEXT_PUBLIC_LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your-api-key
LIVEKIT_API_SECRET=your-api-secret
# === AI Agent (Python) ===
DEEPGRAM_API_KEY=your-deepgram-key
OPENAI_API_KEY=your-openai-key
# === Storage (MinIO/S3) ===
S3_ENDPOINT=http://minio:9000
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_BUCKET=liveserver
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
# === Redis ===
REDIS_URL=redis://localhost:6379
# === Auth ===
BETTER_AUTH_SECRET=your-secret-key-change-in-production
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000