a working product with ugly ui

This commit is contained in:
2025-12-12 20:15:27 +05:00
parent e6d04f986f
commit 4d3085623a
77 changed files with 8750 additions and 0 deletions

39
app/config.py Normal file
View File

@@ -0,0 +1,39 @@
from pydantic_settings import BaseSettings, SettingsConfigDict
from typing import List
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
# Database
DATABASE_URL: str
# Security
SECRET_KEY: str
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
# Registration
ALLOW_REGISTRATION: bool = False
# CORS
ALLOWED_ORIGINS: str = "http://localhost:8000"
# Environment
ENVIRONMENT: str = "development"
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=True
)
@property
def cors_origins(self) -> List[str]:
"""Parse comma-separated CORS origins into a list."""
return [origin.strip() for origin in self.ALLOWED_ORIGINS.split(",")]
# Global settings instance
settings = Settings()