Add Phase 1 MVP: D&D text-adventure server
FastAPI + Postgres backend with fastapi-users auth, games/characters CRUD, and a WebSocket chat endpoint where an x.ai Grok DM narrates play, rolls dice, and maintains character sheets via tool calls. React + Tailwind frontend covers registration/login, game list and creation, participation-code join flow, character viewer, and a real-time chat session view. Docker Compose skeleton (Postgres + backend) included; Caddy/frontend container wiring is deferred to the deploy milestone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class GameCreate(BaseModel):
|
||||
name: str
|
||||
description: str = ""
|
||||
|
||||
|
||||
class GameRead(BaseModel):
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
description: str
|
||||
creator_id: uuid.UUID
|
||||
creator_name: str
|
||||
player_count: int
|
||||
player_names: list[str]
|
||||
participation_code: str | None # only populated for the creator
|
||||
created_at: datetime
|
||||
is_participant: bool
|
||||
my_character_id: uuid.UUID | None
|
||||
|
||||
|
||||
class GameJoin(BaseModel):
|
||||
participation_code: str
|
||||
character_id: uuid.UUID | None = None
|
||||
Reference in New Issue
Block a user