""" Configuration module for the MONA application. This module centralizes all configuration settings and constants used throughout the application, making it easier to maintain and modify settings in one place. """ import os from pathlib import Path # Base paths BASE_DIR = Path(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) DATA_DIR = BASE_DIR / "data" EXPORT_DIR = DATA_DIR / "exports" BACKUP_DIR = DATA_DIR / "backups" # Ensure directories exist os.makedirs(DATA_DIR, exist_ok=True) os.makedirs(EXPORT_DIR, exist_ok=True) os.makedirs(BACKUP_DIR, exist_ok=True) # File paths FILE_PATHS = { "tasks": DATA_DIR / "tasks.json", "notes": DATA_DIR / "notes.json", "goals": DATA_DIR / "goals.json", "settings": DATA_DIR / "settings.json", "usage": DATA_DIR / "usage.json", "activity": DATA_DIR / "activity.json", "focus": DATA_DIR / "focus.json", "mood": DATA_DIR / "mood.json", "wellness": DATA_DIR / "wellness.json", "integrations": DATA_DIR / "integrations.json", } # AI Models configuration AI_MODELS = { "text_generation": { "name": "microsoft/DialoGPT-medium", "max_length": 100, "temperature": 0.7, }, "question_answering": { "name": "distilbert-base-uncased-distilled-squad", }, "image_captioning": { "name": "Salesforce/blip-image-captioning-base", "max_length": 50, }, "speech_to_text": { "name": "openai/whisper-small", }, "translation": { "name": "Helsinki-NLP/opus-mt-en-de", }, "sentiment": { "name": "cardiffnlp/twitter-roberta-base-sentiment-latest", }, "summarization": { "name": "facebook/bart-large-cnn", "max_length": 150, "min_length": 30, }, "code_generation": { "name": "microsoft/CodeBERT-base", }, } # Default application settings DEFAULT_SETTINGS = { "appearance": { "theme": "light", "primary_color": "#7B68EE", "secondary_color": "#FF6B6B", "font_size": "medium", "sidebar_position": "left", "default_page": "dashboard", "compact_mode": False, "show_welcome": True, }, "notifications": { "enable_notifications": True, "notification_sound": True, "task_reminders": True, "goal_reminders": True, "focus_reminders": True, "reminder_time": "09:00", }, "ai_preferences": { "enable_suggestions": True, "preferred_model": "balanced", "usage_limit": 100, "current_usage": 0, }, "data_management": { "auto_backup": True, "backup_frequency": "weekly", "data_retention": "1 year", "auto_archive": True, }, "user_profile": { "name": "User", "email": "", "timezone": "UTC", "language": "English", "date_format": "MM/DD/YYYY", "time_format": "12h", }, "api_keys": { "OpenWeatherMap": "", "GitHub": "", "Google Calendar": "", "Telegram": "", "News API": "", "Crypto API": "", }, } # UI Constants UI_CONSTANTS = { "sidebar_width": 300, "header_height": 60, "card_border_radius": "10px", "animation_duration": "0.3s", "max_items_per_page": 20, "chart_colors": ["#7B68EE", "#FF6B6B", "#64DFDF", "#FFAB4C", "#9D65C9"], } # UI Colors for components UI_COLORS = { "blue": "#3498db", "green": "#2ecc71", "red": "#e74c3c", "yellow": "#f1c40f", "purple": "#9b59b6", "orange": "#e67e22", "teal": "#1abc9c", "gray": "#95a5a6", "dark": "#34495e", "primary": "#7B68EE", "secondary": "#FF6B6B", "success": "#2ecc71", "warning": "#f1c40f", "danger": "#e74c3c", "info": "#3498db", } # UI Sizes for components UI_SIZES = { "xs": "0.75rem", "sm": "0.875rem", "md": "1rem", "lg": "1.25rem", "xl": "1.5rem", "2xl": "2rem", "3xl": "3rem", "icon_sm": "16px", "icon_md": "24px", "icon_lg": "32px", "spacing_xs": "0.25rem", "spacing_sm": "0.5rem", "spacing_md": "1rem", "spacing_lg": "1.5rem", "spacing_xl": "2rem", } # Feature flags for enabling/disabling features FEATURE_FLAGS = { "enable_voice_input": True, "enable_image_analysis": True, "enable_code_generation": True, "enable_integrations": True, "enable_export": True, "enable_analytics": True, } # Integration settings INTEGRATION_SETTINGS = { "google_calendar": { "enabled": False, "auth_url": "https://accounts.google.com/o/oauth2/auth", "token_url": "https://oauth2.googleapis.com/token", "scope": "https://www.googleapis.com/auth/calendar.readonly", }, "microsoft_todo": { "enabled": False, "auth_url": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", "token_url": "https://login.microsoftonline.com/common/oauth2/v2.0/token", "scope": "Tasks.ReadWrite", }, "notion": { "enabled": False, "auth_url": "https://api.notion.com/v1/oauth/authorize", "token_url": "https://api.notion.com/v1/oauth/token", }, "weather_api": { "enabled": False, "base_url": "https://api.openweathermap.org/data/2.5/weather", "units": "metric", }, } # Logging configuration LOGGING_CONFIG = { "version": 1, "disable_existing_loggers": False, "formatters": { "standard": { "format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s" }, }, "handlers": { "console": { "class": "logging.StreamHandler", "level": "INFO", "formatter": "standard", }, "file": { "class": "logging.FileHandler", "level": "DEBUG", "formatter": "standard", "filename": DATA_DIR / "mona.log", "mode": "a", }, }, "loggers": { "": { # root logger "handlers": ["console", "file"], "level": "DEBUG", "propagate": True, }, }, }