Restructure into full project layout

This commit is contained in:
2026-06-16 23:06:16 -06:00
parent de4862b2d1
commit 57765496a6
74 changed files with 4441 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
from sqlalchemy import select
from app.core.database import AsyncSessionLocal
from app.core.security import hash_password
from app.core.config import settings
from app.models.user import User, UserRole
async def bootstrap_admin():
async with AsyncSessionLocal() as db:
result = await db.execute(select(User).where(User.email == settings.ADMIN_EMAIL))
if result.scalar_one_or_none():
return
admin = User(
email=settings.ADMIN_EMAIL,
hashed_password=hash_password(settings.ADMIN_PASSWORD),
display_name="Admin",
role=UserRole.ADMIN,
is_active=True,
)
db.add(admin)
await db.commit()
print(f"Admin user created: {settings.ADMIN_EMAIL}")