Files
MAIA/backend/core/config.py
c-d-p 62d6b8bdfd [V1.0] Working application, added notifications.
Ready to upload to store.
2025-04-27 00:39:52 +02:00

41 lines
1.0 KiB
Python

# core/config.py
from pydantic_settings import BaseSettings
import os
DOTENV_PATH = os.path.join(os.path.dirname(__file__), "../.env")
class Settings(BaseSettings):
# Database settings - reads from environment or .env
DB_PORT: int = 5432
DB_NAME: str = "maia"
DB_HOST: str
DB_USER: str
DB_PASSWORD: str
DB_URL: str = ""
# Redis settings - reads REDIS_URL from environment or .env, also used for Celery.
REDIS_URL: str = "redis://localhost:6379/0"
# JWT settings - reads from environment or .env
JWT_ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
PEPPER: str
JWT_SECRET_KEY: str
# Other settings
GOOGLE_API_KEY: str
EXPO_PUSH_API_URL: str = "https://exp.host/--/api/v2/push/send"
class Config:
# Tell pydantic-settings to load variables from a .env file
env_file = DOTENV_PATH
env_file_encoding = "utf-8"
extra = "ignore"
# Create a single instance of the settings
settings = Settings()