
- Set up project structure with FastAPI - Implement user authentication system with JWT tokens - Create database models for users, notes, and collections - Set up SQLAlchemy ORM and Alembic migrations - Implement CRUD operations for notes and collections - Add filtering and sorting capabilities for notes - Implement health check endpoint - Update project documentation
38 lines
623 B
Python
38 lines
623 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from app.schemas.note import Note
|
|
|
|
|
|
class CollectionBase(BaseModel):
|
|
name: str
|
|
description: str | None = None
|
|
|
|
|
|
class CollectionCreate(CollectionBase):
|
|
pass
|
|
|
|
|
|
class CollectionUpdate(BaseModel):
|
|
name: str | None = None
|
|
description: str | None = None
|
|
|
|
|
|
class CollectionInDBBase(CollectionBase):
|
|
id: int
|
|
owner_id: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class Collection(CollectionInDBBase):
|
|
pass
|
|
|
|
|
|
class CollectionWithNotes(Collection):
|
|
notes: list[Note] = []
|