43 lines
1.5 KiB
Python
43 lines
1.5 KiB
Python
import os
|
|
from pydantic_settings import BaseSettings
|
|
from typing import List
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application configuration"""
|
|
|
|
# Database settings
|
|
POSTGRES_HOST: str = os.getenv("POSTGRES_HOST", "localhost")
|
|
POSTGRES_PORT: int = int(os.getenv("POSTGRES_PORT", "5432"))
|
|
POSTGRES_USER: str = os.getenv("POSTGRES_USER", "mvp_platform_user")
|
|
POSTGRES_PASSWORD: str = os.getenv("POSTGRES_PASSWORD", "platform123")
|
|
POSTGRES_DATABASE: str = os.getenv("POSTGRES_DATABASE", "vpic")
|
|
|
|
# Redis settings
|
|
REDIS_HOST: str = os.getenv("REDIS_HOST", "localhost")
|
|
REDIS_PORT: int = int(os.getenv("REDIS_PORT", "6379"))
|
|
REDIS_DB: int = int(os.getenv("REDIS_DB", "0"))
|
|
|
|
# Database connection pool settings
|
|
DATABASE_MIN_CONNECTIONS: int = int(os.getenv("DATABASE_MIN_CONNECTIONS", "5"))
|
|
DATABASE_MAX_CONNECTIONS: int = int(os.getenv("DATABASE_MAX_CONNECTIONS", "20"))
|
|
|
|
# Cache settings
|
|
CACHE_TTL: int = int(os.getenv("CACHE_TTL", "3600")) # 1 hour default
|
|
|
|
# Security
|
|
API_KEY: str = os.getenv("API_KEY", "mvp-platform-vehicles-secret-key")
|
|
|
|
# Application settings
|
|
DEBUG: bool = os.getenv("DEBUG", "false").lower() == "true"
|
|
CORS_ORIGINS: List[str] = [
|
|
"http://localhost:3000",
|
|
"https://motovaultpro.com",
|
|
"http://localhost:3001"
|
|
]
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
|
|
def get_settings() -> Settings:
|
|
"""Get application settings"""
|
|
return Settings() |