File size: 4,374 Bytes
e210581
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
"""
Development environment configuration for BackgroundFX Pro.

Optimized for local development with debugging and hot-reload enabled.
"""

from dataclasses import dataclass, field
from pathlib import Path
from typing import List

from ..settings import Settings


@dataclass
class DevelopmentSettings(Settings):
    """
    Development-specific configuration with relaxed security and debug features.
    """
    
    # Environment
    environment: str = "development"
    debug: bool = True
    
    # Server settings
    host: str = "127.0.0.1"
    port: int = 8000
    workers: int = 1
    reload: bool = True  # Hot reload enabled
    
    # Security - Relaxed for development
    secret_key: str = "dev-secret-key-not-for-production"
    cors_origins: List[str] = field(default_factory=lambda: ["*"])  # Allow all origins
    
    # API settings
    api_docs_enabled: bool = True  # Enable Swagger UI
    
    # Database - Local PostgreSQL
    database_url: str = "postgresql://postgres:postgres@localhost:5432/backgroundfx_dev"
    database_echo: bool = True  # Log SQL queries
    database_pool_size: int = 5
    database_max_overflow: int = 10
    
    # MongoDB - Local instance
    mongodb_url: str = "mongodb://localhost:27017/backgroundfx_dev"
    
    # Redis - Local instance
    redis_url: str = "redis://localhost:6379/0"
    redis_max_connections: int = 10
    
    # Storage - Local filesystem for development
    storage_backend: str = "local"
    local_storage_path: Path = field(default_factory=lambda: Path("./storage/dev"))
    
    # Processing - Smaller limits for development
    max_image_size: int = 20 * 1024 * 1024  # 20MB
    max_video_size: int = 100 * 1024 * 1024  # 100MB
    max_batch_size: int = 10
    processing_timeout: int = 120  # 2 minutes
    enable_gpu: bool = False  # Usually no GPU in dev
    gpu_memory_fraction: float = 0.5
    
    # Models - Local directory
    models_dir: Path = field(default_factory=lambda: Path("./models"))
    model_cache_dir: Path = field(default_factory=lambda: Path("./cache/models"))
    
    # Queue - Local Redis
    celery_broker_url: str = "redis://localhost:6379/1"
    celery_result_backend: str = "redis://localhost:6379/2"
    celery_worker_concurrency: int = 2
    celery_task_time_limit: int = 300  # 5 minutes
    
    # JWT - Simple key for development
    jwt_secret_key: str = "dev-jwt-secret-key"
    jwt_expiration_delta: int = 86400  # 1 day
    
    # Rate limiting - Relaxed for development
    rate_limit_enabled: bool = False
    rate_limit_requests: int = 10000
    rate_limit_window: int = 60
    
    # Monitoring - Disabled in development
    sentry_dsn: str = ""  # Disabled
    prometheus_enabled: bool = False
    
    # Logging - Verbose logging
    log_level: str = "DEBUG"
    log_file: str = "./logs/dev.log"
    
    # Cache - Shorter TTL for development
    cache_ttl: int = 60  # 1 minute
    cache_max_entries: int = 100
    
    # CDN - Disabled in development
    cdn_enabled: bool = False
    cdn_base_url: str = "http://localhost:8000/static"
    
    # Email - Console backend for development
    smtp_host: str = "localhost"
    smtp_port: int = 1025  # MailHog or similar
    smtp_use_tls: bool = False
    email_from: str = "dev@localhost"
    
    # Webhooks - Shorter timeouts for development
    webhook_timeout: int = 10
    webhook_max_retries: int = 1
    webhook_retry_delay: int = 1
    
    # Feature flags - Everything enabled for testing
    enable_video_processing: bool = True
    enable_batch_processing: bool = True
    enable_ai_backgrounds: bool = True
    enable_webhooks: bool = True
    
    # Development-specific settings
    auto_create_test_data: bool = True
    mock_external_services: bool = True
    enable_profiling: bool = True
    enable_debug_toolbar: bool = True
    
    def __post_init__(self):
        """Additional development-specific initialization."""
        super().__post_init__()
        
        # Create development directories
        for dir_path in [
            self.local_storage_path,
            self.models_dir,
            self.model_cache_dir,
            self.log_dir,
            self.temp_dir
        ]:
            dir_path.mkdir(parents=True, exist_ok=True)
        
        # Create test data directory
        test_data_dir = Path("./test_data")
        test_data_dir.mkdir(exist_ok=True)