
- Set up project structure and FastAPI application - Create database models for users, products, and inventory - Configure SQLAlchemy and Alembic for database management - Implement JWT authentication - Create API endpoints for user, product, and inventory management - Add admin-only routes and authorization middleware - Add health check endpoint - Update README with documentation - Lint and fix code issues
16 lines
366 B
Python
16 lines
366 B
Python
from typing import Any
|
|
|
|
from sqlalchemy.ext.declarative import declared_attr
|
|
from sqlalchemy.orm import as_declarative
|
|
|
|
|
|
@as_declarative()
|
|
class Base:
|
|
"""Base class for all SQLAlchemy models."""
|
|
id: Any
|
|
__name__: str
|
|
|
|
# Generate __tablename__ automatically
|
|
@declared_attr
|
|
def __tablename__(cls) -> str:
|
|
return cls.__name__.lower() |