Implemented full FastAPI backend with WebSocket support, database models, and comprehensive documentation for the Paper Dynasty game engine. Backend Implementation: - FastAPI application with Socket.io WebSocket server - SQLAlchemy async database models (Game, Play, Lineup, GameSession) - PostgreSQL connection to dev server (10.10.0.42:5432) - Connection manager for WebSocket lifecycle - JWT authentication utilities - Health check and stub API endpoints - Rotating file logger with Pendulum datetime handling - Redis via Docker Compose for caching Technical Details: - Python 3.13 with updated package versions - Pendulum 3.0 for all datetime operations - Greenlet for SQLAlchemy async support - Fixed SQLAlchemy reserved column names (metadata -> *_metadata) - Pydantic Settings with JSON array format for lists - Docker Compose V2 commands Documentation: - Updated backend/CLAUDE.md with environment-specific details - Created .claude/ENVIRONMENT.md for gotchas and quirks - Created QUICKSTART.md for developer onboarding - Documented all critical learnings and troubleshooting steps Database: - Tables created: games, plays, lineups, game_sessions - All indexes and foreign keys configured - Successfully tested connection and health checks Verified: - Server starts at http://localhost:8000 - Health endpoints responding - Database connection working - WebSocket infrastructure functional - Hot-reload working 🎯 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
751 B
Plaintext
26 lines
751 B
Plaintext
# Application
|
|
APP_ENV=development
|
|
DEBUG=true
|
|
SECRET_KEY=your-secret-key-change-in-production
|
|
|
|
# Database
|
|
# Update with your actual database server hostname/IP and credentials
|
|
DATABASE_URL=postgresql+asyncpg://paperdynasty:your-password@10.10.0.42:5432/paperdynasty_dev
|
|
|
|
# Discord OAuth
|
|
DISCORD_CLIENT_ID=your-discord-client-id
|
|
DISCORD_CLIENT_SECRET=your-discord-client-secret
|
|
DISCORD_REDIRECT_URI=http://localhost:3000/auth/callback
|
|
|
|
# League APIs
|
|
SBA_API_URL=https://sba-api.example.com
|
|
SBA_API_KEY=your-sba-api-key
|
|
PD_API_URL=https://pd-api.example.com
|
|
PD_API_KEY=your-pd-api-key
|
|
|
|
# CORS (must be JSON array format)
|
|
CORS_ORIGINS=["http://localhost:3000", "http://localhost:3001"]
|
|
|
|
# Redis (optional - for caching)
|
|
# REDIS_URL=redis://localhost:6379
|