
- Set up project structure with FastAPI and SQLite - Created Todo model and database schemas - Implemented CRUD operations for Todo items - Added Alembic for database migrations - Added health check endpoint - Used Ruff for code linting and formatting - Updated README with project documentation
25 lines
596 B
Python
25 lines
596 B
Python
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "SimpleTodoApp"
|
|
PROJECT_DESCRIPTION: str = (
|
|
"A simple Todo application API built with FastAPI and SQLite"
|
|
)
|
|
PROJECT_VERSION: str = "0.1.0"
|
|
|
|
# Database configuration
|
|
DB_DIR: Path = Path("/app") / "storage" / "db"
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|
|
|
|
# Create DB directory if it doesn't exist
|
|
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
|