
- 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)
30 lines
649 B
Python
30 lines
649 B
Python
from datetime import datetime
|
|
from typing import Optional, List
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from app.schemas.user import User
|
|
|
|
class ConversationBase(BaseModel):
|
|
name: Optional[str] = None
|
|
is_group: bool = False
|
|
|
|
class ConversationCreate(ConversationBase):
|
|
participant_ids: List[str]
|
|
|
|
class ConversationUpdate(BaseModel):
|
|
name: Optional[str] = None
|
|
|
|
class ConversationInDBBase(ConversationBase):
|
|
id: str
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
class Conversation(ConversationInDBBase):
|
|
participants: List[User]
|
|
|
|
class ConversationInDB(ConversationInDBBase):
|
|
pass |