Automated Action 9c818fbd91 Implement complete user authentication system with FastAPI
- Set up FastAPI application with CORS and proper structure
- Created User model with SQLAlchemy and SQLite database
- Implemented JWT-based authentication with bcrypt password hashing
- Added user registration, login, and profile endpoints
- Created health check endpoint for monitoring
- Set up Alembic for database migrations
- Added comprehensive API documentation
- Configured proper project structure with separate modules
- Updated README with complete setup and usage instructions
2025-06-25 01:56:41 +00:00

29 lines
568 B
Python

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