A web application for managing and optimizing Magic: The Gathering EDH (Elder Dragon Highlander) collections and decks using Moxfield integration.
This application consists of two main components:
- Located in
/frontenddirectory - Built with Angular 18
- Provides a clean, user-friendly interface for collection management
- Communicates with the Flask API backend
- Located in
/apidirectory - Python Flask REST API
- Handles Moxfield integration
- Processes card shuffling and optimization logic
- Collection Management: Add and manage Moxfield decks and binders
- Type Classification: Mark collections as Source or Target
- Reshuffle Engine: Optimally redistribute cards between collections
- Sortable Interface: Sort collections by name, URL, or type
- Excel Export: Download reshuffled collection data as Excel files
- Python 3.12+
- Node.js 18+
- npm
cd api
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txtcd frontend
npm install- Start the Flask API:
cd api
source .venv/bin/activate
python app.pyThe API will run on http://localhost:5000
- In another terminal, start the Angular dev server:
cd frontend
npm startThe frontend will run on http://localhost:4200
Note: The Angular dev server is configured with a proxy (proxy.conf.json) that forwards /api/* requests to the Flask backend at http://localhost:5000.
This application includes a multi-stage Dockerfile that builds both the Angular frontend and Python backend into a single container.
docker build -t edh-remixer:latest .
docker run -p 8000:8000 edh-remixer:latestThe application will be available at http://localhost:8000
The application automatically builds and pushes Docker images to GitHub Container Registry (GHCR) on every push to the main or master branch.
Pull the latest image:
docker login ghcr.io
docker pull ghcr.io/rm2631/edhremixer:latest
docker run -p 8000:8000 ghcr.io/rm2631/edhremixer:latestPull a specific version (by commit SHA):
docker pull ghcr.io/rm2631/edhremixer:<commit-sha>
docker run -p 8000:8000 ghcr.io/rm2631/edhremixer:<commit-sha>View build logs: Navigate to your repository's Actions tab to see Docker build logs and history.
This application is configured for deployment on Render using the render.yaml blueprint.
- Push your code to GitHub
- Connect your repository to Render
- Render will automatically detect the
render.yamlfile - The build process will:
- Install Python dependencies
- Build the Angular application
- Configure the Flask app to serve the Angular SPA
No additional environment variables are required for basic operation. All Moxfield API calls are made server-side.
LOG_LEVEL(optional, defaultINFO) - Console log verbosity (DEBUG,INFO,WARNING,ERROR). Outbound calls to Moxfield and EDHRec are logged atINFO(URL, status, latency);DEBUGalso shows cache hits and low-level HTTP library logs.
GET /api/health- Health check endpointPOST /api/deck-name- Get deck name from Moxfield URL- Body:
{"url": "https://www.moxfield.com/decks/..."}
- Body:
POST /api/reshuffle- Process card redistribution- Body: Array of collections with
name,url, andis_sourcefields
- Body: Array of collections with
EDHRemixer/
├── api/ # Flask backend
│ ├── app.py # Main Flask application
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ └── requirements.txt # Python dependencies
├── frontend/ # Angular frontend
│ ├── src/
│ │ ├── app/ # Angular components and services
│ │ ├── environments/ # Environment configuration
│ │ └── styles.css # Global styles
│ ├── angular.json # Angular CLI configuration
│ └── package.json # Node dependencies
├── models/ # Shared models (legacy)
├── services/ # Shared services (legacy)
├── render.yaml # Render deployment configuration
├── Dockerfile # Multi-stage Docker build configuration
├── .github/
│ └── workflows/
│ └── docker-build.yml # GitHub Actions workflow for Docker builds
└── README.md # This file
The following files are from the previous Streamlit implementation and are kept for reference:
main.py- Original main application logictest.py- Test file
This project is licensed under the MIT License.