Skip to content

Transform your physical collection into optimized decks through an intuitive, beautifully designed web interface with powerful Python algorithms for complex deck generation tasks.

License

Notifications You must be signed in to change notification settings

gurleyryan/SparkRoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SparkRoot Logo

SparkRoot Logo SparkRoot

Next.js React Python FastAPI TypeScript License Status

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.

Features

  • 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

Planned

  • Real-time pricing and collection valuation
  • User profiles and community features
  • Any community-requested features

๐Ÿ”ง Technical Details

Architecture

  • 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.

Manual Setup

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.txt

Frontend:

cd frontend
npm install

Run Development Servers from Root:

./run.ps1

Architecture

MTG-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

Data Files

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.

API

The FastAPI backend provides REST endpoints and automatic OpenAPI docs at http://localhost:8000/docs.

Attributions

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.

Sources

License & Disclaimer

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.

Contributing

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

Contact

For questions, feedback, or collaboration opportunities:

About

Transform your physical collection into optimized decks through an intuitive, beautifully designed web interface with powerful Python algorithms for complex deck generation tasks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published