Implement subscription-based AI access with 250 generations/month at $5/month or $50/year. Changes: - Backend: Stripe service, payment routes, webhook handlers, generation tracking - Frontend: Upgrade page with pricing, payment success/cancel pages, UI prompts - Database: Add subscription fields to users, payments table, migrations - Config: Stripe env vars to .env.example, docker-compose.prod.yml, PRODUCTION.md - Tests: Payment route tests, component tests, subscription hook tests Users without AI access see upgrade prompts; subscribers see remaining generation count.
79 lines
3.4 KiB
Text
79 lines
3.4 KiB
Text
# ==============================================================================
|
|
# REQUIRED - Generate with: openssl rand -base64 36 | tr -d '\n'
|
|
# ==============================================================================
|
|
PG_PASS=
|
|
AUTHENTIK_SECRET_KEY=
|
|
ENCRYPTION_KEY=
|
|
|
|
# ==============================================================================
|
|
# HOST CONFIGURATION
|
|
# Set this to your machine's IP or domain for mobile/network access
|
|
# Examples: localhost, 192.168.1.100, kaboot.example.com
|
|
# ==============================================================================
|
|
KABOOT_HOST=localhost
|
|
KABOOT_FRONTEND_PORT=5173
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - Authentik Database
|
|
# ==============================================================================
|
|
PG_USER=authentik
|
|
PG_DB=authentik
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - Ports
|
|
# ==============================================================================
|
|
AUTHENTIK_PORT_HTTP=9000
|
|
AUTHENTIK_PORT_HTTPS=9443
|
|
KABOOT_BACKEND_PORT=3001
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - Authentik Settings
|
|
# ==============================================================================
|
|
AUTHENTIK_ERROR_REPORTING=false
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - Authentik Bootstrap (for automated setup)
|
|
# Generate with: openssl rand -base64 36 | tr -d '\n'
|
|
# ==============================================================================
|
|
AUTHENTIK_BOOTSTRAP_PASSWORD=
|
|
AUTHENTIK_BOOTSTRAP_TOKEN=
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - Logging
|
|
# ==============================================================================
|
|
LOG_REQUESTS=false
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - System AI (Gemini API Key for server-side quiz generation)
|
|
# If set, users can generate quizzes using "System AI" without their own key.
|
|
# Get a key at: https://aistudio.google.com/apikey
|
|
# ==============================================================================
|
|
GEMINI_API_KEY=
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - Stripe Payments (for AI subscription access)
|
|
# Required for paid AI access. Get keys at: https://dashboard.stripe.com/apikeys
|
|
# ==============================================================================
|
|
STRIPE_SECRET_KEY=
|
|
STRIPE_WEBHOOK_SECRET=
|
|
STRIPE_PRICE_ID_MONTHLY=
|
|
STRIPE_PRICE_ID_YEARLY=
|
|
|
|
# ==============================================================================
|
|
# OPTIONAL - TURN Server (REQUIRED for cross-network multiplayer)
|
|
# Without TURN, players behind restrictive NATs/firewalls cannot connect.
|
|
#
|
|
# Option A: Self-hosted coturn (see docker-compose.turn.yml)
|
|
# 1. Edit turnserver.conf (set external-ip, realm, user password)
|
|
# 2. docker compose -f docker-compose.turn.yml up -d
|
|
# 3. Set values below to match turnserver.conf
|
|
# VITE_TURN_URL=turn:your-server-ip:3478
|
|
# VITE_TURN_USERNAME=kaboot
|
|
# VITE_TURN_CREDENTIAL=your-password-from-turnserver-conf
|
|
#
|
|
# Option B: Metered.ca free tier (500GB/mo)
|
|
# Get credentials at: https://www.metered.ca/tools/openrelay/
|
|
# ==============================================================================
|
|
VITE_TURN_URL=
|
|
VITE_TURN_USERNAME=
|
|
VITE_TURN_CREDENTIAL=
|