
- Set up project structure and dependencies - Create SQLAlchemy database models - Set up Alembic for database migrations - Implement user registration and login endpoints - Add JWT token authentication - Create middleware for protected routes - Add health check endpoint - Update README with documentation generated with BackendIM... (backend.im)
15 lines
567 B
Python
15 lines
567 B
Python
from sqlalchemy import Boolean, Column, Integer, String, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.database import Base
|
|
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String, unique=True, index=True)
|
|
username = Column(String, unique=True, index=True)
|
|
hashed_password = Column(String)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |