Files
2025-11-27 21:17:46 +08:00

183 lines
6.2 KiB
Bash

# =============================================================================
# Database Configuration
# =============================================================================
#
# For SQLite (recommended for development):
# DATABASE_URL=sqlite:///./database_name.db
#
# For PostgreSQL (recommended for production):
# DATABASE_URL=postgresql://username:password@host:port/database_name
#
# For MySQL:
# DATABASE_URL=mysql://username:password@host:port/database_name
#
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/wordmaster
# =============================================================================
# Security Configuration
# =============================================================================
#
# IMPORTANT: Change SECRET_KEY in production!
# Generate a secure key with: openssl rand -base64 32
# Or: python -c "import secrets; print(secrets.token_urlsafe(32))"
#
SECRET_KEY=your-super-secret-and-secure-key-change-me-in-production
# JWT algorithm (HS256 is recommended)
ALGORITHM=HS256
# Token expiration time in minutes
ACCESS_TOKEN_EXPIRE_MINUTES=30
# =============================================================================
# OpenRouter AI Configuration
# =============================================================================
#
# Get your API key from: https://openrouter.ai/keys
# Required if you want to use AI-powered features
#
OPENROUTER_API_KEY=your-openrouter-api-key-here
# =============================================================================
# AI Model Selection
# =============================================================================
#
# Available models through OpenRouter:
#
# Claude Models (Anthropic):
# - anthropic/claude-sonnet-4.5 (Default, best general performance)
# - anthropic/claude-opus-4 (Most capable, slower)
# - anthropic/claude-haiku-3.5 (Fast, cost-effective)
#
# Gemini Models (Google):
# - google/gemini-3-pro-preview (Great for math, recommended for math exams)
# - google/gemini-pro-1.5 (Good general performance)
#
# GPT Models (OpenAI):
# - openai/gpt-4o (Latest GPT-4 with vision)
# - openai/gpt-4-turbo (Fast GPT-4)
# - openai/gpt-3.5-turbo (Fastest, most economical)
#
AI_MODEL=anthropic/claude-sonnet-4.5
# =============================================================================
# Parser Configuration
# =============================================================================
#
# Use AI-powered parser for better accuracy (requires OPENROUTER_API_KEY)
# Set to "false" to use traditional rule-based parser
#
USE_CLAUDE_PARSER=true
# =============================================================================
# Application Configuration
# =============================================================================
#
# Server host and port
HOST=0.0.0.0
PORT=8888
# Environment: development, staging, production
ENVIRONMENT=development
# Enable debug mode (set to false in production)
DEBUG=true
# =============================================================================
# CORS Configuration
# =============================================================================
#
# Allowed origins for CORS (comma-separated)
# Use "*" for development, specific domains for production
#
# Examples:
# CORS_ORIGINS=http://localhost:3000,http://localhost:3001
# CORS_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
#
CORS_ORIGINS=*
# =============================================================================
# File Upload Configuration
# =============================================================================
#
# Maximum file size in MB
MAX_UPLOAD_SIZE=50
# Allowed file extensions (comma-separated)
ALLOWED_EXTENSIONS=.pdf,.jpg,.jpeg,.png,.doc,.docx
# Upload directory (relative to backend/)
UPLOAD_DIR=uploads
# =============================================================================
# Logging Configuration
# =============================================================================
#
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL=INFO
# Log file path (leave empty to disable file logging)
LOG_FILE=logs/app.log
# =============================================================================
# Feature Flags
# =============================================================================
#
# Enable/disable specific features
#
ENABLE_AI_FEATURES=true
ENABLE_PDF_PROCESSING=true
ENABLE_FILE_UPLOAD=true
ENABLE_ANALYTICS=true
# =============================================================================
# Rate Limiting (Optional)
# =============================================================================
#
# Requests per minute per user
RATE_LIMIT_PER_MINUTE=60
# =============================================================================
# Email Configuration (Optional)
# =============================================================================
#
# SMTP settings for sending emails
# Leave empty if not using email features
#
# SMTP_HOST=smtp.gmail.com
# SMTP_PORT=587
# [email protected]
# SMTP_PASSWORD=your-app-password
# [email protected]
# =============================================================================
# Redis Configuration (Optional)
# =============================================================================
#
# For caching and session management
# Leave empty if not using Redis
#
# REDIS_URL=redis://localhost:6379/0
# =============================================================================
# Sentry Configuration (Optional)
# =============================================================================
#
# For error tracking and monitoring
# Get your DSN from: https://sentry.io
#
# SENTRY_DSN=your-sentry-dsn-here
# =============================================================================
# Notes
# =============================================================================
#
# 1. Copy this file to .env and update the values
# 2. Never commit .env to version control
# 3. Use strong, unique values for SECRET_KEY in production
# 4. Set DEBUG=false in production
# 5. Use specific CORS_ORIGINS in production
# 6. Keep API keys secure and rotate them regularly
#
# =============================================================================