🏓 Initial ServeSync demo build
- 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
This commit is contained in:
22
backend/app/models/court.py
Normal file
22
backend/app/models/court.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user