
- Set up project structure with FastAPI - Create database models for notes - Implement Alembic migrations - Create API endpoints for note CRUD operations - Implement note export functionality (markdown, txt, pdf) - Add health endpoint - Set up linting with Ruff
30 lines
812 B
Python
30 lines
812 B
Python
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "Notes Management Platform"
|
|
PROJECT_DESCRIPTION: str = "A platform to store and download notes in various formats"
|
|
VERSION: str = "0.1.0"
|
|
API_V1_STR: str = "/api/v1"
|
|
|
|
# Database settings
|
|
DB_DIR: Path = Path("/app/storage/db")
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
# Storage path for generated files
|
|
STORAGE_DIR: Path = Path("/app/storage")
|
|
EXPORT_DIR: Path = STORAGE_DIR / "exports"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings()
|
|
|
|
# Ensure required directories exist
|
|
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
settings.EXPORT_DIR.mkdir(parents=True, exist_ok=True)
|