
- Set up project structure and dependencies - Create database models for tasks and users with SQLAlchemy - Configure Alembic for database migrations - Implement authentication system with JWT tokens - Create CRUD API endpoints for tasks and users - Add health check endpoint - Update README with documentation
16 lines
605 B
Python
16 lines
605 B
Python
from sqlalchemy import Boolean, Column, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base import Base
|
|
from app.db.base_class import Base as BaseClass
|
|
|
|
|
|
class User(Base, BaseClass):
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
username = Column(String, unique=True, index=True, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
is_superuser = Column(Boolean, default=False)
|
|
|
|
# Relationship with tasks
|
|
tasks = relationship("Task", back_populates="owner", cascade="all, delete-orphan") |