- FastAPI backend with PostgreSQL + Redis - 4 core features: Registration, Courts, Matchmaking, Tournament - Double elimination tournament with bracket visualization - ELO-based matchmaking (Stage 1 Open, Stage 2 Skill-Based) - Real-time WebSocket updates - TV Screen display for courts - Vue 3 + Tailwind CSS frontend - Seed data: 12 players, 4 courts, active matches, tournament in progress - Docker compose stack with Nginx reverse proxy
23 lines
855 B
Python
23 lines
855 B
Python
from sqlalchemy import Column, Integer, String, Boolean, Float, DateTime
|
|
from sqlalchemy.orm import relationship
|
|
from sqlalchemy.sql import func
|
|
from app.database import Base
|
|
import enum
|
|
|
|
|
|
class Court(Base):
|
|
__tablename__ = "courts"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String(50), nullable=False)
|
|
court_number = Column(Integer, unique=True, nullable=False)
|
|
hourly_rate = Column(Float, default=200.0)
|
|
is_active = Column(Boolean, default=True)
|
|
surface_type = Column(String(50), default="Sport Court")
|
|
features = Column(String(500), default="LED Lighting, Spectator Seating")
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
|
|
# Relationships
|
|
bookings = relationship("Booking", back_populates="court")
|
|
matches = relationship("Match", back_populates="court")
|