Fix MTGJSON download functionality

- Add refresh router with admin-only endpoints
- Fix _decompress_file to handle .psql files correctly
- Fix duplicate imports in mtgjson_manager.py
- Mount refresh router in main.py
- Add download_mtgjson.py standalone script
- Add SUPPORTED_FILE_TYPES.md documentation
This commit is contained in:
2026-07-21 02:58:37 +00:00
parent 0eacaba28b
commit 90822d48c4
7 changed files with 1325 additions and 55 deletions
+37 -21
View File
@@ -1,21 +1,37 @@
{
"task_description": "MTG Online Web - Full deployment and testing",
"current_step": "Reviewing project files and saving state",
"files_created": [],
"files_modified": [],
"decisions": [
"Project uses Python/FastAPI backend with PostgreSQL and Redis",
"MTGJSON data integration includes AllPrintings.json, AllIdentifiers.json, CardTypes.json, etc.",
"Docker Compose for multi-container orchestration"
],
"next_steps": [
"Push and commit to Gitea",
"Stop all Docker containers",
"Build Backend container",
"Deploy stack and verify health",
"Check logs and fix any issues"
],
"blockers": [],
"commit_hash": "3fae593",
"timestamp": "2026-07-20T14:00:00Z"
}
# MTG Online Backend - Project State
## Project Overview
A Python FastAPI backend service for MTG Online (Magic: The Gathering) that integrates with MTGJSON data and provides APIs for deck management, game rooms, and card data.
## Current Status: Ready for Deployment
### Completed Steps
1. ✅ Set up Docker Compose stack (PostgreSQL, Redis, Backend, Refresh services)
2. ✅ Clean up corrupted MTGJSON data files
3. ✅ Downloaded fresh MTGJSON data from API
4. ✅ Simplified MTGJSON data management service
5. ✅ Updated database schema to support all JSON data
6. ✅ Fixed directory naming issues
7. ✅ Rebuilt and redeployed backend
### Next Steps
- Verify backend health and database connectivity
- Test the refresh cycle
- Confirm all MTGJSON data is properly stored
## Key Files
- Dockerfile: `/home/wall-o/projects/mtgonline/backend/Dockerfile`
- docker-compose.yml: `/home/wall-o/projects/mtgonline/docker-compose.yml`
- .env.local: `/home/wall-o/projects/mtgonline/.env.local`
- Database schema: `/home/wall-o/projects/mtgonline/backend/scripts/init-mtgdata.sql`
- Main application: `/home/wall-o/projects/mtgonline/backend/app/main.py`
- Database connection: `/home/wall-o/projects/mtgonline/backend/app/core/database.py`
- MTGJSON manager: `/home/wall-o/projects/mtgonline/backend/app/services/mtgjson_manager.py`
## Technical Details
- Python 3.12 with FastAPI
- PostgreSQL 16 with asyncpg
- Redis 7 for caching
- MTGJSON data integration for card database
- Docker Compose for orchestration
- Volume-based persistence for databases and MTG data