Automated Action 43235eb604 Create TechDating API backend
- Setup project structure and basic FastAPI application
- Define database models for users, profiles, matches, and messages
- Set up database connection and create Alembic migrations
- Implement user authentication and registration endpoints
- Create API endpoints for profile management, matches, and messaging
- Add filtering and search functionality for tech profiles
- Setup environment variable configuration
- Create README with project information and setup instructions
2025-05-28 15:17:44 +00:00

40 lines
1.5 KiB
Python

from sqlalchemy import Boolean, Column, Integer, String, Date, ForeignKey, Text, DateTime
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
import enum
from app.db.session import Base
class GenderEnum(str, enum.Enum):
male = "male"
female = "female"
non_binary = "non_binary"
other = "other"
class Profile(Base):
__tablename__ = "profiles"
id = Column(Integer, primary_key=True, index=True)
user_id = Column(Integer, ForeignKey("users.id"), unique=True, nullable=False)
full_name = Column(String, nullable=False)
bio = Column(Text, nullable=True)
gender = Column(String, nullable=False)
date_of_birth = Column(Date, nullable=False)
location = Column(String, nullable=True)
job_title = Column(String, nullable=True)
company = Column(String, nullable=True)
education = Column(String, nullable=True)
profile_picture = Column(String, nullable=True) # URL to profile picture
interests = Column(String, nullable=True) # Stored as comma-separated values
tech_stack = Column(String, nullable=True) # Stored as comma-separated values
github_url = Column(String, nullable=True)
linkedin_url = Column(String, nullable=True)
portfolio_url = Column(String, nullable=True)
is_visible = Column(Boolean, default=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
# Relationships
user = relationship("User", back_populates="profile")