
- Set up FastAPI application structure - Create database models for User, Product, Cart, CartItem, Order, and OrderItem - Set up Alembic for database migrations - Create Pydantic schemas for request/response models - Implement API endpoints for products, cart operations, and checkout process - Add health endpoint - Update README with project details and documentation
19 lines
382 B
Python
19 lines
382 B
Python
from typing import Optional
|
|
from pydantic import BaseModel, EmailStr
|
|
|
|
|
|
class Token(BaseModel):
|
|
"""Schema for token response."""
|
|
access_token: str
|
|
token_type: str
|
|
|
|
|
|
class TokenPayload(BaseModel):
|
|
"""Schema for token payload (JWT claims)."""
|
|
sub: Optional[int] = None
|
|
|
|
|
|
class Login(BaseModel):
|
|
"""Schema for user login."""
|
|
email: EmailStr
|
|
password: str |