paper-dynasty-discord/CLAUDE.md
Cal Corum 73353c2086 Add deployment details to CLAUDE.md (container name, logs, CI/CD)
Align production environment section with Major Domo's format:
container name, remote log command, co-hosted services, tea PR workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 19:05:16 -06:00

2.1 KiB

Paper Dynasty Discord Bot

Baseball card game Discord bot. discord.py with cog-based commands, SQLModel for database ops.

Commands

python -m pytest                    # Run tests
python paperdynasty.py              # Start bot
pip install -r requirements.txt     # Install dependencies

Architecture

  • Cogs (cogs/): Command modules — gameplay, economy, players, admins
  • Game engine (in_game/): Turn-based simulation, AI manager, dice mechanics, WPA calculations
  • UI (utilities/): Buttons, dropdowns, embeds
  • Database: Production uses FastAPI database directly; dev may use separate PostgreSQL via SQLModel

Key Patterns

  • Cards generated from MLB statistics with complex rating calculations
  • Card ratings split by handedness (vs_hand: 'R' or 'L')
  • Multiple cardsets (seasons) with different priorities for gameplay
  • Use factory data in testing as often as possible

Deployment

Production Environment

  • Host: ssh sba-bots (10.10.0.88, alias pd-bots)
  • Path: /home/cal/container-data/paper-dynasty
  • Bot container: paper-dynasty_discord-app_1
  • Logs: ssh sba-bots "docker logs --since 1h paper-dynasty_discord-app_1"
  • Other services on same host: paper-dynasty_adminer_1, paper-dynasty_db_1, sba-website_sba-web_1, sba-ghost_sba-ghost_1
  • Image: manticorum67/paper-dynasty-discordapp (Docker Hub)
  • Version file: VERSION (current: 1.9.2) — bump before merge to main
  • Health: Port 8080 — /health, /ready, /metrics, /diagnostics
  • Env vars: BOT_TOKEN, GUILD_ID, API_TOKEN, DATABASE (Dev/Prod), LOG_LEVEL, TZ=America/Chicago

CI/CD

Builds and deploys are handled by Gitea Actions. Create a PR to main using tea:

tea pulls create --repo cal/paper-dynasty --head <branch> --base main --title "title" --description "description"

Gitea validates the version, builds the Docker image, and deploys on merge.

Development Notes

  • Connect to proper docker socket when running tests
  • Plans go in ./.claude/plans/ with descriptive filenames