
- Set up FastAPI application with CORS and proper structure - Created User model with SQLAlchemy and SQLite database - Implemented JWT-based authentication with bcrypt password hashing - Added user registration, login, and profile endpoints - Created health check endpoint for monitoring - Set up Alembic for database migrations - Added comprehensive API documentation - Configured proper project structure with separate modules - Updated README with complete setup and usage instructions
13 lines
542 B
Python
13 lines
542 B
Python
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
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()) |