
- Set up project structure with FastAPI - Implement SQLAlchemy models for inventory items and categories - Create database connection with SQLite - Add CRUD operations for inventory management - Implement API endpoints for categories, items, and inventory transactions - Add health check endpoint - Set up Alembic for database migrations - Update README with documentation
25 lines
630 B
Python
25 lines
630 B
Python
from pydantic_settings import BaseSettings
|
|
from pathlib import Path
|
|
from typing import List
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "Simple Inventory Management App"
|
|
|
|
# Database settings
|
|
DB_DIR: Path = Path("/app") / "storage" / "db"
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
# CORS Settings
|
|
BACKEND_CORS_ORIGINS: List[str] = ["*"]
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
# Create DB directory if it doesn't exist
|
|
Path("/app/storage/db").mkdir(parents=True, exist_ok=True)
|
|
|
|
settings = Settings() |