Add super admin panel and update README

- Admin account bootstrapped from ADMIN_EMAIL/ADMIN_PASSWORD env vars on startup
- Admin panel: list users, view content, reset passwords, disable/delete accounts
- is_admin and is_disabled columns on users table
- Disabled accounts blocked at login
- README updated with admin setup instructions and panel docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 00:24:27 -07:00
parent 0cdb2c2c2d
commit bd2bd43395
13 changed files with 404 additions and 14 deletions

View File

@@ -13,18 +13,34 @@ class UserCreate(BaseModel):
class UserLogin(BaseModel):
email: EmailStr
email: str
password: str
class UserOut(BaseModel):
id: int
email: str
is_admin: bool = False
is_disabled: bool = False
created_at: Optional[datetime] = None
model_config = {"from_attributes": True}
class AdminUserOut(BaseModel):
id: int
email: str
is_admin: bool
is_disabled: bool
created_at: Optional[datetime]
variety_count: int
batch_count: int
class AdminResetPassword(BaseModel):
new_password: str
class Token(BaseModel):
access_token: str
token_type: str