
- Set up FastAPI application with proper project structure - Configure SQLite database with SQLAlchemy ORM - Implement user model with CRUD operations - Add Alembic for database migrations - Create comprehensive API endpoints for user management - Configure CORS middleware for cross-origin requests - Add health check endpoint and service information - Set up Ruff for code linting and formatting - Update README with complete documentation Co-Authored-By: BackendIM <noreply@backendim.com>
27 lines
534 B
Python
27 lines
534 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, EmailStr
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
email: EmailStr
|
|
full_name: str
|
|
is_active: bool = True
|
|
|
|
class UserCreate(UserBase):
|
|
password: str
|
|
|
|
class UserUpdate(BaseModel):
|
|
email: Optional[EmailStr] = None
|
|
full_name: Optional[str] = None
|
|
is_active: Optional[bool] = None
|
|
|
|
class User(UserBase):
|
|
id: int
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|