54 lines
1.3 KiB
Python
54 lines
1.3 KiB
Python
from pydantic_settings import BaseSettings
|
|
from typing import List
|
|
import os
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Application
|
|
APP_NAME: str = "Swansea Airport Stakeholders Alliance"
|
|
APP_VERSION: str = "1.0.0"
|
|
DEBUG: bool = True
|
|
ENVIRONMENT: str = "development"
|
|
|
|
# API
|
|
API_V1_PREFIX: str = "/api/v1"
|
|
SECRET_KEY: str
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
|
|
# Database
|
|
DATABASE_HOST: str
|
|
DATABASE_PORT: int = 3306
|
|
DATABASE_USER: str
|
|
DATABASE_PASSWORD: str
|
|
DATABASE_NAME: str
|
|
|
|
@property
|
|
def DATABASE_URL(self) -> str:
|
|
return f"mysql+pymysql://{self.DATABASE_USER}:{self.DATABASE_PASSWORD}@{self.DATABASE_HOST}:{self.DATABASE_PORT}/{self.DATABASE_NAME}"
|
|
|
|
# Square Payment
|
|
SQUARE_ACCESS_TOKEN: str
|
|
SQUARE_ENVIRONMENT: str = "sandbox"
|
|
SQUARE_LOCATION_ID: str
|
|
|
|
# Email
|
|
SMTP2GO_API_KEY: str
|
|
SMTP2GO_API_URL: str = "https://api.smtp2go.com/v3/email/send"
|
|
EMAIL_FROM: str
|
|
EMAIL_FROM_NAME: str
|
|
|
|
# CORS
|
|
BACKEND_CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:8080"]
|
|
|
|
# File Storage
|
|
UPLOAD_DIR: str = "/app/uploads"
|
|
MAX_UPLOAD_SIZE: int = 10485760 # 10MB
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings()
|