- Backend: FastAPI + MongoDB + Redis (카테고리, 할일 CRUD, 파일 첨부, 검색, 대시보드) - Frontend: Next.js 15 + Tailwind + React Query + Zustand - 통합 TodoModal: 생성/수정 모달 통합, 탭 구조 (기본/태그와 첨부) - 간트차트: 카테고리별 할일 타임라인 시각화 - TodoCard: 제목/카테고리/우선순위/태그/첨부 한줄 표시 - Docker Compose 배포 (Frontend:3010, Backend:8010, MongoDB:27021, Redis:6391) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from pydantic_settings import BaseSettings
|
|
from pydantic import Field
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
mongodb_url: str = Field(
|
|
default="mongodb://mongodb:27017",
|
|
description="MongoDB 연결 URL",
|
|
)
|
|
mongodb_database: str = Field(
|
|
default="todos2",
|
|
alias="DB_NAME",
|
|
description="MongoDB 데이터베이스 이름",
|
|
)
|
|
redis_url: str = Field(
|
|
default="redis://redis:6379",
|
|
description="Redis 연결 URL",
|
|
)
|
|
frontend_url: str = Field(
|
|
default="http://localhost:3000",
|
|
description="프론트엔드 URL (CORS 허용)",
|
|
)
|
|
upload_dir: str = Field(
|
|
default="/app/uploads",
|
|
description="파일 업로드 디렉토리",
|
|
)
|
|
max_file_size: int = Field(
|
|
default=10 * 1024 * 1024,
|
|
description="최대 파일 크기 (bytes, 기본 10MB)",
|
|
)
|
|
max_files_per_todo: int = Field(
|
|
default=5,
|
|
description="Todo당 최대 첨부 파일 수",
|
|
)
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
populate_by_name = True # alias와 필드명 모두 허용
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|