feat: Initial project structure for WebTriviasMulti

- Backend: FastAPI + Python-SocketIO + SQLAlchemy
  - Models for categories, questions, game sessions, events
  - AI services for answer validation and question generation (Claude)
  - Room management with Redis
  - Game logic with stealing mechanics
  - Admin API for question management

- Frontend: React + Vite + TypeScript + Tailwind
  - 5 visual themes (DRRR, Retro, Minimal, RGB, Anime 90s)
  - Real-time game with Socket.IO
  - Achievement system
  - Replay functionality
  - Sound effects per theme

- Docker Compose for deployment
- Design documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-26 07:50:48 +00:00
commit 43021b9c3c
57 changed files with 5446 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
from sqlalchemy import Column, Integer, String, Text, Boolean, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from app.models.base import Base
class GameEvent(Base):
__tablename__ = "game_events"
id = Column(Integer, primary_key=True, index=True)
session_id = Column(Integer, ForeignKey("game_sessions.id"), nullable=False)
event_type = Column(String(50), nullable=False) # question_selected, answer_submitted, steal_attempted, etc.
player_name = Column(String(100))
team = Column(String(1)) # 'A' or 'B'
question_id = Column(Integer, ForeignKey("questions.id"))
answer_given = Column(Text)
was_correct = Column(Boolean)
was_steal = Column(Boolean, default=False)
points_earned = Column(Integer)
timestamp = Column(DateTime(timezone=True), server_default=func.now())
# Relationships
session = relationship("GameSession", back_populates="events")
question = relationship("Question", back_populates="game_events")
def __repr__(self):
return f"<GameEvent(id={self.id}, type='{self.event_type}', player='{self.player_name}')>"