Automated Action 1badf85dea Create FastAPI inventory management system for small businesses
- Set up FastAPI application with SQLite database
- Implemented CRUD operations for inventory items, categories, and suppliers
- Added Alembic migrations for database schema management
- Configured CORS middleware for cross-origin requests
- Added health check and API documentation endpoints
- Structured project with proper separation of concerns
- Added comprehensive README with API documentation
2025-06-25 10:33:52 +00:00

15 lines
420 B
Python

from pathlib import Path
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
DB_DIR = Path("/app") / "storage" / "db"
DB_DIR.mkdir(parents=True, exist_ok=True)
SQLALCHEMY_DATABASE_URL = f"sqlite:///{DB_DIR}/db.sqlite"
engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)