Phase 1 (Foundation): - Project restructure (presenton-main → backend/ + frontend/) - Database schema (8 new models, Alembic config, seed script) - Auth (Azure AD SSO + dev bypass, JWT sessions, AuthMiddleware) - RBAC (access_service, rbac_middleware, admin routers) - Audit logging (fire-and-forget, AuditMiddleware, admin router) - i18n (react-i18next with 5 namespace files) Phase 2 (Admin Panel & Client Management): - Admin panel shell (sidebar layout, role guard, 12 pages) - Redux admin slice with 18 async thunks - User management (role changes, deactivation) - Client management (CRUD, brand config, team management) - Brand config editor (colors, fonts, logos, voice rules) - Master deck upload & parser (PPTX → HTML → React pipeline) - Audit log viewer with filters and CSV/JSON export Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
702 B
Python
24 lines
702 B
Python
from collections.abc import AsyncGenerator
|
|
from sqlalchemy.ext.asyncio import (
|
|
AsyncEngine,
|
|
create_async_engine,
|
|
async_sessionmaker,
|
|
AsyncSession,
|
|
)
|
|
from utils.db_utils import get_database_url_and_connect_args
|
|
|
|
|
|
database_url, connect_args = get_database_url_and_connect_args()
|
|
|
|
sql_engine: AsyncEngine = create_async_engine(database_url, connect_args=connect_args)
|
|
async_session_maker = async_sessionmaker(sql_engine, expire_on_commit=False)
|
|
|
|
|
|
async def get_async_session() -> AsyncGenerator[AsyncSession, None]:
|
|
async with async_session_maker() as session:
|
|
yield session
|
|
|
|
|
|
async def create_db_and_tables():
|
|
"""No-op: migrations are now handled by Alembic."""
|
|
pass
|