- Backend: FastAPI + Python-SocketIO + SQLAlchemy - Models for categories, questions, game sessions, events - AI services for answer validation and question generation (Claude) - Room management with Redis - Game logic with stealing mechanics - Admin API for question management - Frontend: React + Vite + TypeScript + Tailwind - 5 visual themes (DRRR, Retro, Minimal, RGB, Anime 90s) - Real-time game with Socket.IO - Achievement system - Replay functionality - Sound effects per theme - Docker Compose for deployment - Design documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
64 lines
1.3 KiB
YAML
64 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
frontend:
|
|
build: ./frontend
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- VITE_API_URL=${VITE_API_URL:-http://localhost:8000}
|
|
- VITE_WS_URL=${VITE_WS_URL:-ws://localhost:8000}
|
|
depends_on:
|
|
- backend
|
|
volumes:
|
|
- ./frontend:/app
|
|
- /app/node_modules
|
|
|
|
backend:
|
|
build: ./backend
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=${DATABASE_URL:-postgresql://trivia:trivia@db:5432/trivia}
|
|
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
|
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
|
- JWT_SECRET=${JWT_SECRET:-dev-secret-key}
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
volumes:
|
|
- ./backend:/app
|
|
|
|
db:
|
|
image: postgres:15
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_DB=trivia
|
|
- POSTGRES_USER=trivia
|
|
- POSTGRES_PASSWORD=trivia
|
|
ports:
|
|
- "5432:5432"
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "6379:6379"
|
|
|
|
cloudflared:
|
|
image: cloudflare/cloudflared:latest
|
|
command: tunnel run
|
|
environment:
|
|
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
|
|
depends_on:
|
|
- frontend
|
|
- backend
|
|
profiles:
|
|
- production
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|