
Added complete backend infrastructure with: - Authentication system with OAuth (Google, GitHub, Apple) - Stripe payment processing with subscription management - Testimonials management API - Usage statistics tracking - Email communication services - Health monitoring endpoints - Database migrations with Alembic - Comprehensive API documentation All APIs are production-ready with proper error handling, security measures, and environment variable configuration. Co-Authored-By: Claude <noreply@anthropic.com>
28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
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)
|
|
username = Column(String, unique=True, index=True, nullable=True)
|
|
full_name = Column(String, nullable=True)
|
|
hashed_password = Column(String, nullable=True)
|
|
is_active = Column(Boolean, default=True)
|
|
is_verified = Column(Boolean, default=False)
|
|
avatar_url = Column(String, nullable=True)
|
|
|
|
# OAuth fields
|
|
google_id = Column(String, unique=True, nullable=True)
|
|
github_id = Column(String, unique=True, nullable=True)
|
|
apple_id = Column(String, unique=True, nullable=True)
|
|
|
|
# Subscription info
|
|
stripe_customer_id = Column(String, nullable=True)
|
|
subscription_status = Column(String, default="free")
|
|
subscription_plan = Column(String, nullable=True)
|
|
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |