Magic: The Gathering collection manager and deck optimizer. Upload your collection, generate legal Commander decks, and analyze deck qualityโall in a modern web interface.
- Upload your MTG collection (CSV formats: Moxfield, Manabox, etc.)
- Automatic card data enrichment from Scryfall
- Generate and save legal Commander decks from your collection
- Analyze deck quality and composition
- Export decks in TXT, JSON, and CSV formats
- Secure user authentication and collection management
- Real-time pricing and collection valuation
- User profiles and community features
- Any community-requested features
- Frontend: Next.js + React + TypeScript + Tailwind CSS
- Backend: Python FastAPI for efficient data processing and deck generation
- Data Source: Scryfall API and Supabase PostgresSQL for complete, up-to-date card information and storage
- Format Support: Commander with bracket, salt, and house rules options
- Deployment: Vercel (frontend) + Railway/Redis (backend) + Supabase (data storage)
House rules are Bracket 1 and no Sol Ring, nonland tutors, or some 'unfun' cards like Armageddon, Winter Orb, and Stasis.
Prerequisites:
- Node.js 18+ and npm
- Python 3.8+ and pip
- Git for version control
Backend Setup:
cd backend
python -m venv venv
venv\Scripts\Activate.ps1
pip install -r requirements.txtFrontend:
cd frontend
npm installRun Development Servers from Root:
./run.ps1MTG-Deck-Optimizer/
โโโ frontend/ # Next.js 15 + React 19 application
โ โโโ src/
โ โ โโโ app/ # App Router pages and layouts
โ โ โโโ components/ # Reusable React components
โ โ โโโ lib/ # API client and utilities
โ โ โโโ stores/ # Zustand state management
โ โ โโโ types/ # TypeScript definitions
โ โโโ public/ # Static assets
โ โโโ tailwind.config.js # Tailwind CSS configuration
โ
โโโ backend/ # FastAPI Python application
โโโ main.py # API server entry point
โโโ deckgen.py # Deck generation algorithms
โโโ deck_analysis.py # Advanced deck scoring
โโโ utils.py # Utility functions
โโโ data/ # Scryfall card database
โโโ requirements.txt # Python dependencies
Some large files (like scryfall_all_cards.json) are not in git. Download from Scryfall API or use the provided script in data/. In SparkRoot, these are uploaded to a public.cards table in Supabase.
The FastAPI backend provides REST endpoints and automatic OpenAPI docs at http://localhost:8000/docs.
Icons from Mana Font by Andrew Gioia.
All mana images and card symbols ยฉ Wizards of the Coast.
The Mana font is licensed under the the SIL OFL 1.1.
Mana CSS, LESS, and Sass files are licensed under the MIT License.
- Intro guide to Commander (EDH) decks
- What's an Optimal Mana Curve and Land/Ramp Count for Commander?
- Commander Deckbuilding Template for the New Era
This project is licensed under the Business Source License 1.1(BUSL-1.1).
Magic: The Gatheringยฎ and all related logos, fonts, and trademarks are property of Wizards of the Coast. SparkRoot is unofficial Fan Content permitted under the Fan Content Policy. Not approved/endorsed by Wizards. Portions of the materials used are property of Wizards of the Coast. ยฉWizards of the Coast LLC.
We welcome contributions! Please:
- Open issues for bugs, feature requests, or questions
- Fork the repo and submit pull requests for improvements
- Follow clean code practices and keep changes focused
- Add clear commit messages and documentation for new features
- Join the Discord for discussions and support
For questions, feedback, or collaboration opportunities:
- GitHub: @gurleyryan
- Email: gurleyryan@gmail.com
- Discord: Grand Gurley Generation
- Website: Gurley Music
