An ASP.NET Core MVC application that harnesses the power of Groq's LLM to create unique MTG cards based on existing card data from Scryfall. Generate, visualize, and explore AI-crafted cards with authentic MTG styling.
C#
4
31 commits
updated Jun 6, 2026
Generate custom Magic: The Gathering cards using AI-powered creativity! โจ
An ASP.NET Core MVC application that harnesses the power of Groq's LLM to create unique MTG cards based on existing card data from Scryfall. Generate, visualize, and explore AI-crafted cards with authentic MTG styling.
๐จ AI Card Generation - Leverage Groq's Llama 3.3 70B model to generate balanced, creative MTG cards
๐ผ๏ธ AI Card Artwork - Generate custom card artwork using HuggingFace's Stable Diffusion XL
๐ฅ Scryfall Integration - Import bulk card data directly from Scryfall's comprehensive database
๐ด Card Sharing & Gallery - Share your generated cards in a public gallery for others to see
โค๏ธ Like System - Like your favorite cards with real-time updates via Server-Sent Events
๐พ Card Persistence - All generated cards saved to database with image data and metadata
๐ User Authentication - ASP.NET Core Identity integration for card ownership and likes
๐ฏ CMC-Based Balance - Cards are generated based on converted mana cost for power-level consistency
๐ Card Browser - Browse and search through imported cards with pagination
๐ญ Multi-Color Support - Full support for all color identities (W/U/B/R/G/Multicolor/Colorless)
โฑ๏ธ Rate Limiting - Built-in rate limiting to prevent API abuse on card generation
๐ Database Storage - SQLite-based persistence with EF Core for fast querying
git clone https://github.com/yourusername/AiMagicCardsGenerator.git
cd AiMagicCardsGenerator
Edit appsettings.Development.json:
{
"Groq": {
"ApiKey": "your-groq-api-key-here"
},
"HuggingFace": {
"ApiKey": "your-huggingface-api-key-here"
}
}
Or use .NET User Secrets (recommended):
dotnet user-secrets set "Groq:ApiKey" "your-groq-api-key-here"
dotnet user-secrets set "HuggingFace:ApiKey" "your-huggingface-api-key-here"
Run PowerShell scripts to download card frames and mana symbols:
cd wwwroot/assets
./download_frames.ps1
./download_symbols.ps1
dotnet ef database update
dotnet run
Visit https://localhost:7073 ๐
Via Web Interface:
Backend:
AI & APIs:
Image Processing:
Frontend:
AiMagicCardsGenerator/
โโโ ๐ฎ Controllers/ # MVC Controllers
โ โโโ HomeController.cs # Gallery with likes & SSE
โ โโโ DataController.cs # Scryfall import
โ โโโ CardsController.cs # Card browsing
โ โโโ GeneratorController.cs # Generation & sharing
โโโ ๐ Models/
โ โโโ Entities/ # Domain models
โ โ โโโ Card.cs # Imported Scryfall cards
โ โ โโโ GeneratedCard.cs # User-generated cards
โ โ โโโ CardLike.cs # Like relationships
โ โโโ Dto/ # Data transfer objects
โ โโโ ScryfallModels.cs
โโโ ๐๏ธ Data/
โ โโโ ApplicationDbContext.cs
โ โโโ Migrations/ # EF Core migrations
โโโ ๐ง Services/ # Business logic
โ โโโ Interfaces/
โ โ โโโ ICardService.cs
โ โ โโโ IGeneratorService.cs
โ โ โโโ IScryfallService.cs
โ โ โโโ ICardRenderService.cs
โ โ โโโ IImageGeneratorService.cs
โ โ โโโ ICardLikeService.cs
โ โ โโโ ILikesBroadcastService.cs
โ โโโ CardService.cs
โ โโโ GeneratorService.cs
โ โโโ ScryfallService.cs
โ โโโ CardRenderService.cs
โ โโโ ImageGeneratorService.cs # HuggingFace integration
โ โโโ CardLikeService.cs
โ โโโ LikesBroadcastService.cs # SSE broadcasting
โ โโโ CardRenderConfig.cs
โโโ ๐ฆ Repositories/ # Data access
โ โโโ Interfaces/
โ โ โโโ ICardRepository.cs
โ โ โโโ IGeneratedCardRepository.cs
โ โ โโโ ICardLikeRepository.cs
โ โโโ CardRepository.cs
โ โโโ GeneratedCardRepository.cs
โ โโโ CardLikeRepository.cs
โโโ ๐จ Views/ # Razor templates
โโโ ๐ Areas/Identity/ # ASP.NET Core Identity pages
โโโ ๐งช AiMagicCardsGenerator.Tests/ # Unit tests
โโโ ๐ wwwroot/
โ โโโ assets/
โ โโโ frames/ # Card frame images
โ โโโ fonts/ # MTG fonts
โ โโโ symbols/ # Mana symbols (SVG)
โโโ โ๏ธ Program.cs # Application entry point
appsettings.json / appsettings.Development.json:
{
"ConnectionStrings": {
"DefaultConnection": "DataSource=mtg.db;Cache=Shared"
},
"Groq": {
"ApiKey": "your-groq-api-key-here"
},
"HuggingFace": {
"ApiKey": "your-huggingface-api-key-here"
}
}
The application requires these assets in wwwroot/assets/:
Use provided PowerShell scripts to download automatically.
# Build the project
dotnet build
# Run with hot reload
dotnet watch run
# Add new migration
dotnet ef migrations add MigrationName
# Apply migrations
dotnet ef database update
# Remove last migration (if not applied)
dotnet ef migrations remove
# Run all tests
dotnet test
# Run specific test project
dotnet test AiMagicCardsGenerator.Tests/AiMagicCardsGenerator.Tests.csproj
# Run with detailed output
dotnet test --verbosity detailed
Contributions are welcome! Here's how you can help:
git checkout -b feature/AmazingFeature)git commit -m 'โจ Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
This project is a fan-made tool and is not affiliated with, endorsed by, or associated with Wizards of the Coast. Magic: The Gathering is a trademark of Wizards of the Coast LLC. Card frames, fonts, and symbols are used for educational and demonstration purposes only.
Made with โค๏ธ and AI
โญ Star this repo if you find it useful!
C#
68.2%
HTML
19.8%
CSS
9.1%
JavaScript
2.2%
An ASP.NET Core MVC application that harnesses the power of Groq's LLM to create unique MTG cards based on existing card data from Scryfall. Generate, visualize, and explore AI-crafted cards with authentic MTG styling.
C#
4
31 commits
updated Jun 6, 2026
Generate custom Magic: The Gathering cards using AI-powered creativity! โจ
An ASP.NET Core MVC application that harnesses the power of Groq's LLM to create unique MTG cards based on existing card data from Scryfall. Generate, visualize, and explore AI-crafted cards with authentic MTG styling.
๐จ AI Card Generation - Leverage Groq's Llama 3.3 70B model to generate balanced, creative MTG cards
๐ผ๏ธ AI Card Artwork - Generate custom card artwork using HuggingFace's Stable Diffusion XL
๐ฅ Scryfall Integration - Import bulk card data directly from Scryfall's comprehensive database
๐ด Card Sharing & Gallery - Share your generated cards in a public gallery for others to see
โค๏ธ Like System - Like your favorite cards with real-time updates via Server-Sent Events
๐พ Card Persistence - All generated cards saved to database with image data and metadata
๐ User Authentication - ASP.NET Core Identity integration for card ownership and likes
๐ฏ CMC-Based Balance - Cards are generated based on converted mana cost for power-level consistency
๐ Card Browser - Browse and search through imported cards with pagination
๐ญ Multi-Color Support - Full support for all color identities (W/U/B/R/G/Multicolor/Colorless)
โฑ๏ธ Rate Limiting - Built-in rate limiting to prevent API abuse on card generation
๐ Database Storage - SQLite-based persistence with EF Core for fast querying
git clone https://github.com/yourusername/AiMagicCardsGenerator.git
cd AiMagicCardsGenerator
Edit appsettings.Development.json:
{
"Groq": {
"ApiKey": "your-groq-api-key-here"
},
"HuggingFace": {
"ApiKey": "your-huggingface-api-key-here"
}
}
Or use .NET User Secrets (recommended):
dotnet user-secrets set "Groq:ApiKey" "your-groq-api-key-here"
dotnet user-secrets set "HuggingFace:ApiKey" "your-huggingface-api-key-here"
Run PowerShell scripts to download card frames and mana symbols:
cd wwwroot/assets
./download_frames.ps1
./download_symbols.ps1
dotnet ef database update
dotnet run
Visit https://localhost:7073 ๐
Via Web Interface:
Backend:
AI & APIs:
Image Processing:
Frontend:
AiMagicCardsGenerator/
โโโ ๐ฎ Controllers/ # MVC Controllers
โ โโโ HomeController.cs # Gallery with likes & SSE
โ โโโ DataController.cs # Scryfall import
โ โโโ CardsController.cs # Card browsing
โ โโโ GeneratorController.cs # Generation & sharing
โโโ ๐ Models/
โ โโโ Entities/ # Domain models
โ โ โโโ Card.cs # Imported Scryfall cards
โ โ โโโ GeneratedCard.cs # User-generated cards
โ โ โโโ CardLike.cs # Like relationships
โ โโโ Dto/ # Data transfer objects
โ โโโ ScryfallModels.cs
โโโ ๐๏ธ Data/
โ โโโ ApplicationDbContext.cs
โ โโโ Migrations/ # EF Core migrations
โโโ ๐ง Services/ # Business logic
โ โโโ Interfaces/
โ โ โโโ ICardService.cs
โ โ โโโ IGeneratorService.cs
โ โ โโโ IScryfallService.cs
โ โ โโโ ICardRenderService.cs
โ โ โโโ IImageGeneratorService.cs
โ โ โโโ ICardLikeService.cs
โ โ โโโ ILikesBroadcastService.cs
โ โโโ CardService.cs
โ โโโ GeneratorService.cs
โ โโโ ScryfallService.cs
โ โโโ CardRenderService.cs
โ โโโ ImageGeneratorService.cs # HuggingFace integration
โ โโโ CardLikeService.cs
โ โโโ LikesBroadcastService.cs # SSE broadcasting
โ โโโ CardRenderConfig.cs
โโโ ๐ฆ Repositories/ # Data access
โ โโโ Interfaces/
โ โ โโโ ICardRepository.cs
โ โ โโโ IGeneratedCardRepository.cs
โ โ โโโ ICardLikeRepository.cs
โ โโโ CardRepository.cs
โ โโโ GeneratedCardRepository.cs
โ โโโ CardLikeRepository.cs
โโโ ๐จ Views/ # Razor templates
โโโ ๐ Areas/Identity/ # ASP.NET Core Identity pages
โโโ ๐งช AiMagicCardsGenerator.Tests/ # Unit tests
โโโ ๐ wwwroot/
โ โโโ assets/
โ โโโ frames/ # Card frame images
โ โโโ fonts/ # MTG fonts
โ โโโ symbols/ # Mana symbols (SVG)
โโโ โ๏ธ Program.cs # Application entry point
appsettings.json / appsettings.Development.json:
{
"ConnectionStrings": {
"DefaultConnection": "DataSource=mtg.db;Cache=Shared"
},
"Groq": {
"ApiKey": "your-groq-api-key-here"
},
"HuggingFace": {
"ApiKey": "your-huggingface-api-key-here"
}
}
The application requires these assets in wwwroot/assets/:
Use provided PowerShell scripts to download automatically.
# Build the project
dotnet build
# Run with hot reload
dotnet watch run
# Add new migration
dotnet ef migrations add MigrationName
# Apply migrations
dotnet ef database update
# Remove last migration (if not applied)
dotnet ef migrations remove
# Run all tests
dotnet test
# Run specific test project
dotnet test AiMagicCardsGenerator.Tests/AiMagicCardsGenerator.Tests.csproj
# Run with detailed output
dotnet test --verbosity detailed
Contributions are welcome! Here's how you can help:
git checkout -b feature/AmazingFeature)git commit -m 'โจ Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
This project is a fan-made tool and is not affiliated with, endorsed by, or associated with Wizards of the Coast. Magic: The Gathering is a trademark of Wizards of the Coast LLC. Card frames, fonts, and symbols are used for educational and demonstration purposes only.
Made with โค๏ธ and AI
โญ Star this repo if you find it useful!
C#
68.2%
HTML
19.8%
CSS
9.1%
JavaScript
2.2%