Spaces:
Running
Running
Download backend/app/core/config.py from axeronis/microfunnel-api: direct link, hf CLI and curl.
- Browser
- Download file 5.4 kB
-
https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/app/core/config.py
- Command line
-
hf download hf://spaces/axeronis/microfunnel-api/backend/app/core/config.py
-
curl -L -o config.py https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/app/core/config.py
5.4 kB
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| from typing import Optional, List | |
| import os | |
| class Settings(BaseSettings): | |
| """Application settings loaded from environment variables.""" | |
| # Application | |
| APP_NAME: str = "MicroFunnel" | |
| ENVIRONMENT: str = "development" | |
| DEBUG: bool = os.getenv("DEBUG", "false").lower() == "true" | |
| # Database | |
| DATABASE_URL: str | |
| # Redis | |
| REDIS_URL: str = "redis://localhost:6379" | |
| # Supabase | |
| SUPABASE_URL: str | |
| SUPABASE_KEY: str | |
| # Groq AI (LLM) | |
| GROQ_API_KEY: Optional[str] = None | |
| # Google Gemini AI | |
| GEMINI_API_KEY: Optional[str] = None | |
| GEMINI_MODEL: str = "gemini-3-flash-preview" | |
| # OpenAI API (Embeddings & LLM) | |
| OPENAI_API_KEY: Optional[str] = None | |
| # Embedding Configuration | |
| # OpenAI text-embedding-3-small dimension is 1536 | |
| EMBEDDING_DIMENSION: int = 1536 | |
| # Security | |
| SECRET_KEY: str | |
| ALGORITHM: str = "HS256" | |
| ACCESS_TOKEN_EXPIRE_MINUTES: int = 10080 # 7 days | |
| # CORS - Allowed Origins (comma-separated) | |
| # Development: http://localhost:3000 | |
| # Production: https://your-app.vercel.app,https://your-domain.com | |
| ALLOWED_ORIGINS: str = "http://localhost:3000,http://127.0.0.1:3000,https://axeronis-microfunnel-api.hf.space,https://microfunnelai.vercel.app" | |
| # Frontend URL (for webhooks and redirects) | |
| FRONTEND_URL: str = "https://microfunnel.online" | |
| # Google OAuth | |
| GOOGLE_CLIENT_ID: Optional[str] = None | |
| GOOGLE_CLIENT_SECRET: Optional[str] = None | |
| # Telegram | |
| # Platform-level bot for admin notifications (hot leads, orders, bookings) | |
| # Fallback when tenant doesn't have their own bot configured | |
| TELEGRAM_NOTIFICATION_TOKEN: Optional[str] = "7734361434:AAGGKvlHN6BaND61F1Lr-0TQiBPsRWdmrRo" | |
| TELEGRAM_WEBHOOK_URL: Optional[str] = "https://axeronis-microfunnel-api.hf.space" | |
| # Telegram Proxy (Vercel) to bypass HF firewall | |
| TELEGRAM_PROXY_URL: Optional[str] = "https://microfunnel.online/api/proxy/telegram" | |
| # AI Settings | |
| MAX_CONTEXT_MESSAGES: int = 50 # Increased from 30 to 50 for better conversation memory | |
| TEMPERATURE: float = 0.7 | |
| MAX_TOKENS: int = 1024 | |
| # Business Logic | |
| DEFAULT_COMMISSION_RATE: float = 0.5 | |
| HOT_LEAD_THRESHOLD: int = 80 | |
| WARM_LEAD_THRESHOLD: int = 50 | |
| # Sentry (Error Tracking) | |
| SENTRY_DSN: Optional[str] = None | |
| # Email Notifications | |
| SMTP_HOST: Optional[str] = "smtp.yandex.ru" | |
| SMTP_PORT: int = 465 | |
| SMTP_USER: Optional[str] = "microfunnel@yandex.kg" | |
| SMTP_PASSWORD: Optional[str] = "usjqasaddkqrrauv" | |
| EMAIL_FROM: str = "noreply@microfunnel.online" | |
| # Resend API (Alternative to SMTP) | |
| RESEND_API_KEY: Optional[str] = None | |
| # Brevo (Sendinblue) API | |
| BREVO_API_KEY: Optional[str] = None | |
| # Email IMAP (Receiving) | |
| IMAP_SERVER: Optional[str] = None | |
| IMAP_PORT: int = 993 | |
| IMAP_USER: Optional[str] = None # Defaults to SMTP_USER if None | |
| IMAP_PASSWORD: Optional[str] = None # Defaults to SMTP_PASSWORD if None | |
| LINKEDIN_PROVIDER: str = "mock" # mock, rapidapi, official | |
| LINKEDIN_API_KEY: Optional[str] = None | |
| LINKEDIN_EMAIL: Optional[str] = None | |
| LINKEDIN_PASSWORD: Optional[str] = None | |
| # Meta (WhatsApp/Instagram) Embedded Signup | |
| META_APP_ID: Optional[str] = None | |
| META_APP_SECRET: Optional[str] = None | |
| META_WA_ACCESS_TOKEN: Optional[str] = None | |
| META_WA_PHONE_NUMBER_ID: Optional[str] = None | |
| # Stripe (Payments) - Legacy | |
| STRIPE_SECRET_KEY: Optional[str] = None | |
| STRIPE_WEBHOOK_SECRET: Optional[str] = None | |
| STRIPE_PRICE_START: Optional[str] = "price_start_month" | |
| STRIPE_PRICE_GROWTH: Optional[str] = "price_growth_month" | |
| STRIPE_PRICE_ENTERPRISE: Optional[str] = "price_enterprise_month" | |
| # LemonSqueezy (Payments) - Primary | |
| LEMONSQUEEZY_API_KEY: Optional[str] = None | |
| LEMONSQUEEZY_STORE_ID: Optional[str] = None | |
| LEMONSQUEEZY_WEBHOOK_SECRET: Optional[str] = None | |
| LEMONSQUEEZY_VARIANT_START: Optional[str] = None # Variant ID for $99/mo | |
| LEMONSQUEEZY_VARIANT_GROWTH: Optional[str] = None # Variant ID for $199/mo | |
| LEMONSQUEEZY_VARIANT_ENTERPRISE: Optional[str] = None # Variant ID for $499/mo | |
| LEMONSQUEEZY_VARIANT_PARTNER: Optional[str] = None # Variant ID for $500 partner fee | |
| # Freedom Pay KG (Kyrgyzstan) - Primary Payment Gateway | |
| FREEDOMPAY_MERCHANT_ID: Optional[str] = None # Merchant ID from my.freedompay.kg | |
| FREEDOMPAY_SECRET_KEY: Optional[str] = None # Secret key for payments | |
| FREEDOMPAY_TEST_MODE: bool = True # True = test mode, False = production | |
| # ElevenLabs TTS Service (replaces Chatterbox) | |
| ELEVENLABS_API_KEY: Optional[str] = None # ElevenLabs API key for TTS | |
| def get_allowed_origins(self) -> List[str]: | |
| """Parse ALLOWED_ORIGINS from comma-separated string.""" | |
| return [origin.strip() for origin in self.ALLOWED_ORIGINS.split(",") if origin.strip()] | |
| # Supabase | |
| SUPABASE_URL: str | |
| SUPABASE_KEY: str | |
| SUPABASE_SERVICE_KEY: Optional[str] = None | |
| # ... (rest of fields) | |
| model_config = SettingsConfigDict( | |
| env_file=".env", | |
| env_file_encoding="utf-8", | |
| case_sensitive=True, | |
| extra="ignore" | |
| ) | |
| # Global settings instance | |
| settings = Settings() | |