
- Set up FastAPI project structure with main.py and requirements.txt - Created SQLite database models for users, beats, and transactions - Implemented Alembic database migrations - Added user authentication system with JWT tokens - Created beat management endpoints (CRUD operations) - Implemented purchase/transaction system - Added file upload/download functionality for beat files - Created health endpoint and API documentation - Updated README with comprehensive documentation - Fixed all linting issues with Ruff Environment variables needed: - SECRET_KEY: JWT secret key for authentication
17 lines
696 B
Python
17 lines
696 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime, func
|
|
from sqlalchemy.orm import relationship
|
|
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)
|
|
full_name = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
is_producer = Column(Boolean, default=False)
|
|
created_at = Column(DateTime, default=func.now())
|
|
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
|
|
|
|
beats = relationship("Beat", back_populates="producer") |