Migrate background tasks from FastAPI BackgroundTasks to Celery with Redis for persistent task queuing, retries, and scheduled jobs. Key changes: - Add Celery configuration with Redis broker/backend - Create task dispatcher with USE_CELERY feature flag for gradual rollout - Add Celery task wrappers for all background operations: - Marketplace imports - Letzshop historical imports - Product exports - Code quality scans - Test runs - Subscription scheduled tasks (via Celery Beat) - Add celery_task_id column to job tables for Flower integration - Add Flower dashboard link to admin background tasks page - Update docker-compose.yml with worker, beat, and flower services - Add Makefile targets: celery-worker, celery-beat, celery-dev, flower When USE_CELERY=false (default), system falls back to FastAPI BackgroundTasks for development without Redis dependency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
166 lines
5.8 KiB
Plaintext
166 lines
5.8 KiB
Plaintext
# =============================================================================
|
|
# ENVIRONMENT CONFIGURATION
|
|
# =============================================================================
|
|
DEBUG=False
|
|
|
|
# =============================================================================
|
|
# PROJECT INFORMATION
|
|
# =============================================================================
|
|
PROJECT_NAME=Wizamart - Multi-Vendor Marketplace Platform
|
|
DESCRIPTION=Multi-tenants multi-themes ecommerce application
|
|
VERSION=2.2.0
|
|
|
|
# =============================================================================
|
|
# DATABASE CONFIGURATION (PostgreSQL required)
|
|
# =============================================================================
|
|
# Default works with: docker-compose up -d db
|
|
DATABASE_URL=postgresql://wizamart_user:secure_password@localhost:5432/wizamart_db
|
|
|
|
# For production, use your PostgreSQL connection string:
|
|
# DATABASE_URL=postgresql://username:password@production-host:5432/wizamart_db
|
|
|
|
# =============================================================================
|
|
# ADMIN INITIALIZATION
|
|
# =============================================================================
|
|
# These are used by init_production.py to create the platform admin
|
|
# ⚠️ CHANGE THESE IN PRODUCTION!
|
|
ADMIN_EMAIL=admin@wizamart.com
|
|
ADMIN_USERNAME=admin
|
|
ADMIN_PASSWORD=change-me-in-production
|
|
ADMIN_FIRST_NAME=Platform
|
|
ADMIN_LAST_NAME=Administrator
|
|
|
|
# =============================================================================
|
|
# JWT CONFIGURATION
|
|
# =============================================================================
|
|
JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production
|
|
JWT_EXPIRE_HOURS=24
|
|
JWT_EXPIRE_MINUTES=30
|
|
|
|
# =============================================================================
|
|
# API SERVER
|
|
# =============================================================================
|
|
API_HOST=0.0.0.0
|
|
API_PORT=8000
|
|
|
|
# =============================================================================
|
|
# DOCUMENTATION
|
|
# =============================================================================
|
|
# Development
|
|
DOCUMENTATION_URL=http://localhost:8001
|
|
# Staging
|
|
# DOCUMENTATION_URL=https://staging-docs.wizamart.com
|
|
# Production
|
|
# DOCUMENTATION_URL=https://docs.wizamart.com
|
|
|
|
# =============================================================================
|
|
# RATE LIMITING
|
|
# =============================================================================
|
|
RATE_LIMIT_ENABLED=True
|
|
RATE_LIMIT_REQUESTS=100
|
|
RATE_LIMIT_WINDOW=3600
|
|
|
|
# =============================================================================
|
|
# LOGGING
|
|
# =============================================================================
|
|
LOG_LEVEL=INFO
|
|
LOG_FILE=logs/app.log
|
|
|
|
# =============================================================================
|
|
# PLATFORM DOMAIN CONFIGURATION
|
|
# =============================================================================
|
|
# Your main platform domain
|
|
PLATFORM_DOMAIN=wizamart.com
|
|
|
|
# Custom domain features
|
|
# Enable/disable custom domains
|
|
ALLOW_CUSTOM_DOMAINS=True
|
|
# Require DNS verification
|
|
REQUIRE_DOMAIN_VERIFICATION=True
|
|
|
|
# SSL/TLS configuration
|
|
# "letsencrypt" or "cloudflare", "manual"
|
|
SSL_PROVIDER=letsencrypt
|
|
# Set to True if using automated SSL
|
|
AUTO_PROVISION_SSL=False
|
|
|
|
# DNS verification
|
|
DNS_VERIFICATION_PREFIX=_wizamart-verify
|
|
DNS_VERIFICATION_TTL=3600
|
|
|
|
# =============================================================================
|
|
# STRIPE BILLING
|
|
# =============================================================================
|
|
# Get your keys from https://dashboard.stripe.com/apikeys
|
|
# See docs/features/subscription-billing.md for setup guide
|
|
STRIPE_SECRET_KEY=sk_test_your_secret_key_here
|
|
STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
|
|
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
|
|
STRIPE_TRIAL_DAYS=30
|
|
|
|
# =============================================================================
|
|
# EMAIL CONFIGURATION
|
|
# =============================================================================
|
|
# Provider: smtp, sendgrid, mailgun, ses
|
|
EMAIL_PROVIDER=smtp
|
|
EMAIL_FROM_ADDRESS=noreply@wizamart.com
|
|
EMAIL_FROM_NAME=Wizamart
|
|
EMAIL_REPLY_TO=
|
|
|
|
# SMTP Settings (used when EMAIL_PROVIDER=smtp)
|
|
SMTP_HOST=smtp.example.com
|
|
SMTP_PORT=587
|
|
SMTP_USER=
|
|
SMTP_PASSWORD=
|
|
SMTP_USE_TLS=true
|
|
SMTP_USE_SSL=false
|
|
|
|
# SendGrid (used when EMAIL_PROVIDER=sendgrid)
|
|
# SENDGRID_API_KEY=SG.your_api_key_here
|
|
|
|
# Mailgun (used when EMAIL_PROVIDER=mailgun)
|
|
# MAILGUN_API_KEY=your_api_key_here
|
|
# MAILGUN_DOMAIN=mg.yourdomain.com
|
|
|
|
# Amazon SES (used when EMAIL_PROVIDER=ses)
|
|
# AWS_ACCESS_KEY_ID=your_access_key
|
|
# AWS_SECRET_ACCESS_KEY=your_secret_key
|
|
# AWS_REGION=eu-west-1
|
|
|
|
# Email behavior
|
|
EMAIL_ENABLED=true
|
|
EMAIL_DEBUG=false
|
|
|
|
# =============================================================================
|
|
# PLATFORM LIMITS
|
|
# =============================================================================
|
|
MAX_VENDORS_PER_USER=5
|
|
MAX_TEAM_MEMBERS_PER_VENDOR=50
|
|
INVITATION_EXPIRY_DAYS=7
|
|
|
|
# =============================================================================
|
|
# DEMO/SEED DATA CONFIGURATION (Development only)
|
|
# =============================================================================
|
|
SEED_DEMO_VENDORS=3
|
|
SEED_CUSTOMERS_PER_VENDOR=15
|
|
SEED_PRODUCTS_PER_VENDOR=20
|
|
SEED_ORDERS_PER_VENDOR=10
|
|
|
|
# =============================================================================
|
|
# CELERY / REDIS TASK QUEUE
|
|
# =============================================================================
|
|
# Redis connection URL (used for Celery broker and backend)
|
|
# Default works with: docker-compose up -d redis
|
|
REDIS_URL=redis://localhost:6379/0
|
|
|
|
# Enable Celery for background tasks (set to false to use FastAPI BackgroundTasks)
|
|
# Recommended: false for development, true for production
|
|
USE_CELERY=false
|
|
|
|
# Flower monitoring dashboard URL (for admin panel links)
|
|
FLOWER_URL=http://localhost:5555
|
|
|
|
# Flower basic authentication password
|
|
# ⚠️ CHANGE THIS IN PRODUCTION!
|
|
FLOWER_PASSWORD=changeme
|