Automated Action ca5dbb9088 Add complete simple messaging app with FastAPI
- Implement user authentication with JWT tokens
- Add messaging system for sending/receiving messages
- Create SQLite database with SQLAlchemy models
- Set up Alembic for database migrations
- Add health check endpoint
- Include comprehensive API documentation
- Support user registration, login, and message management
- Enable conversation history and user listing
2025-06-26 16:07:21 +00:00

30 lines
578 B
Python

from pydantic import BaseModel, EmailStr
from datetime import datetime
from typing import Optional
class UserBase(BaseModel):
email: EmailStr
username: str
class UserCreate(UserBase):
password: str
class UserLogin(BaseModel):
email: EmailStr
password: str
class User(UserBase):
id: int
is_active: bool
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
class Token(BaseModel):
access_token: str
token_type: str
class TokenData(BaseModel):
email: Optional[str] = None