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 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.
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
└── 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.