
- Set up FastAPI application with CORS support - Implement SQLite database with SQLAlchemy ORM - Create User model with CRUD operations - Add Alembic for database migrations - Include health check and documentation endpoints - Set up proper project structure with organized modules - Add comprehensive README with setup instructions - Configure Ruff for code linting and formatting
23 lines
389 B
Python
23 lines
389 B
Python
from pydantic import BaseModel, EmailStr
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
email: EmailStr
|
|
name: str
|
|
is_active: bool = True
|
|
|
|
|
|
class UserCreate(UserBase):
|
|
pass
|
|
|
|
|
|
class UserResponse(UserBase):
|
|
id: int
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|