
- Set up project structure with FastAPI and SQLite - Implement user authentication using JWT - Create database models for users, conversations, and messages - Implement API endpoints for user management and chat functionality - Set up WebSocket for real-time messaging - Add database migrations with Alembic - Create health check endpoint - Update README with comprehensive documentation generated with BackendIM... (backend.im)
32 lines
664 B
Python
32 lines
664 B
Python
from datetime import datetime
|
|
from typing import Optional, List
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
class UserBase(BaseModel):
|
|
username: str
|
|
email: EmailStr
|
|
is_active: Optional[bool] = True
|
|
|
|
class UserCreate(UserBase):
|
|
password: str
|
|
|
|
class UserUpdate(BaseModel):
|
|
username: Optional[str] = None
|
|
email: Optional[EmailStr] = None
|
|
password: Optional[str] = None
|
|
is_active: Optional[bool] = None
|
|
|
|
class UserInDBBase(UserBase):
|
|
id: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
class User(UserInDBBase):
|
|
pass
|
|
|
|
class UserInDB(UserInDBBase):
|
|
hashed_password: str |