Automated Action e0b4ac8ba6 Create a REST API with FastAPI and SQLite
- Setup FastAPI project structure with main.py and requirements.txt
- Implement SQLAlchemy ORM with SQLite database
- Create Item model with CRUD operations
- Implement health endpoint for monitoring
- Setup Alembic for database migrations
- Add comprehensive documentation in README.md
- Configure Ruff for code linting
2025-05-23 10:10:10 +00:00

29 lines
647 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
# API configuration
API_V1_STR: str = "/api/v1"
PROJECT_NAME: str = "RESTAPIService"
PROJECT_DESCRIPTION: str = "FastAPI REST API Service"
VERSION: str = "0.1.0"
# CORS Origins
BACKEND_CORS_ORIGINS: list[str] = ["*"]
# Database
DB_DIR = Path("/app") / "storage" / "db"
DB_DIR.mkdir(parents=True, exist_ok=True)
# SQLite Database URL
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
class Config:
case_sensitive = True
env_file = ".env"
settings = Settings()