Files
mtgonline/state.json
T
akadmin 2c74a107bc Phase 2.1: Card mirror system for deckbuilding features
- Created MtgCardMirror and DeckCardLink models in mirror_models.py
- Created card_mirror_service.py with sync_mirrors functionality
- Added sync_mirrors() method to mtgjson_manager.py
- Added mirror_get_db() dependency to database.py
- Added DecklistFile.status column (DRAUGHT/FINAL)
- Updated DeckCreate schema with status field
- Added DeckWithCardsResponse schema with card_count
- Updated deck router to query card mirrors and return card counts
- Added plain text deck content support
2026-07-22 03:35:57 +00:00

72 lines
4.3 KiB
JSON

{
"project_summary": "MTG Online Backend — a Python FastAPI application that processes Magic: The Gathering card data from MTGJSON v5 and stores it in PostgreSQL, with Redis for caching. Exposes REST endpoints for card data, user authentication, deck management, and game state. Targets a web-based MTG card browsing and deck-building platform.",
"roadmap": [
{
"phase": "Phase 1: Foundation & Data Pipeline",
"status": "completed",
"description": "Backend scaffolding, dual PostgreSQL setup, Redis, Docker Compose, MTGJSON download and upsert pipeline.",
"key_deliverables": ["FastAPI app running", "Dual Postgres (app + MTG data)", "Redis cache", "MTGJSON v5 pipeline", "22k+ cards loaded"]
},
{
"phase": "Phase 2: Core API Endpoints",
"status": "completed",
"description": "REST endpoints for card search, deck management, user auth, and game state.",
"key_deliverables": ["Card search API", "Deck CRUD", "Auth system", "Health check", "MTGJSON refresh endpoint"]
},
{
"phase": "Phase 2.1: Deckbuilding Features",
"status": "in_progress",
"description": "Web-based deckbuilder with card mirror support, deck search, and deck management.",
"key_deliverables": ["Card mirror models (MtgCardMirror, DeckCardLink)", "Platform mirror tables", "Mirror sync service", "Deck search with card counts", "Plain text deck import", "Status tracking (DRAUGHT/FINAL)", "Card mirror search endpoint"]
},
{
"phase": "Phase 3: Frontend",
"status": "pending",
"description": "Web interface for deck building and card browsing.",
"key_deliverables": ["React/Next.js frontend", "API integration", "Responsive UI", "Docker Compose integration"]
},
{
"phase": "Phase 4: Advanced Features",
"status": "pending",
"description": "Game server integration, multiplayer support, card image serving, performance optimization.",
"key_deliverables": ["Game server", "Multiplayer", "Card images", "Caching optimization"]
}
],
"tech_stack": ["Python 3.12", "FastAPI", "SQLAlchemy (async)", "PostgreSQL x2", "Redis", "Docker Compose", "MTGJSON v5"],
"architectural_notes": "Dual PostgreSQL (mtgonline for app data, mtgdata for MTG card data), Redis caching layer, MTGJSON v5 data pipeline auto-downloads on startup, REST API with Swagger docs at /docs. Backend exposed on port 5555. C++ game server directory exists but not yet integrated.",
"task_description": "Phase 2.1: Implement card mirror system for deckbuilding features",
"current_step": "Created mirror models (MtgCardMirror, DeckCardLink), mirror sync service, updated deck router with card counts, added DeckCreate.status field, DeckWithCardsResponse schema, DecklistFile.status column, database.py mirror_get_db dependency",
"files_created": [
"/home/wall-o/projects/mtgonline/backend/app/models/mirror_models.py",
"/home/wall-o/projects/mtgonline/backend/app/services/card_mirror_service.py"
],
"files_modified": [
"/home/wall-o/projects/mtgonline/backend/app/models/platform_models.py",
"/home/wall-o/projects/mtgonline/backend/app/routers/decks.py",
"/home/wall-o/projects/mtgonline/backend/app/schemas/schemas.py",
"/home/wall-o/projects/mtgonline/backend/app/services/mtgjson_manager.py",
"/home/wall-o/projects/mtgonline/backend/app/core/database.py"
],
"decisions": [
"Card mirror models created in mirror_models.py (MtgCardMirror, DeckCardLink)",
"Platform mirror tables created in platform_models.py for mirrored card data",
"Mirror sync service added to mtgjson_manager.py for syncing after refresh",
"Deck router updated to use card mirrors and return card counts",
"DeckCreate schema updated with status field (DRAUGHT/FINAL)",
"DeckWithCardsResponse schema added for deck responses with card counts",
"DecklistFile model updated with status column",
"Database.py updated with mirror_get_db() dependency",
"Card search will use mirrors for deckbuilding queries"
],
"next_steps": [
"Trigger sync_mirrors() after MTGJSON refresh",
"Implement card mirror search endpoint",
"Test mirror sync functionality",
"Add plain text deck import support",
"Wire up deck search with card counts"
],
"blockers": [],
"commit_hash": "",
"timestamp": "2026-07-23T10:43:00Z"
}