Add a new game
Find a reliable data source
The data source must provide comprehensive card data including:
- All card properties and attributes
- Printing information for each card
- Localized versions in different languages
- High quality card images
The source should be either:
- Official game data (e.g. cards.fabtcg.com for Flesh and Blood)
- Well-maintained community source (e.g. mtgjson for Magic)
- Reliable API provider (e.g. curiosa.com for Sorcery)
Ensure the data source is regularly updated as new cards are released
Create game configuration
Game configurations are located in packages/games/game-configuration/.
- Create a new folder under
packages/games/game-configuration/src/lib/games/<game-name>/ - Define game-specific types in
<game-name>.types.ts(enums for attributes like rarity, color, etc.) - Create a game configuration file
<game-name>.game.tsthat implementsGameConfigurationinterface:- Define game metadata (name, slug, icon, image)
- Configure all card attributes (name, type, rarity, etc.)
- Specify basic and advanced filters
- Define list presets and supported marketplaces
- Optionally create
<game-name>.presets.tsfor list presets - Optionally create
i18n/index.tsfor game-specific translations - Add the game configuration to
Configurationsobject ingame-configuration.ts - Add the game to the
SupportedGamesenum ingame-configuration.types.ts
Example game configuration files:
packages/games/game-configuration/src/lib/games/mtg/mtg.game.tspackages/games/game-configuration/src/lib/games/lorcana/lorcana.game.ts
Create game importer
Game importers are located in packages/games/game-importer/.
- Create a new importer class that extends
BaseImporterfrompackages/games/game-importer/src/base-importer.ts - Implement the required abstract methods:
init(): Initialize data source (download files, setup connections, etc.)getExpansionGroups(): Return list of expansion groups/series (if supported)getExpansions(): Return list of card sets/expansionsgetCards(): Return card data with attributes and printingsgetGame(): Return basic game info (slug, name, logo)
- Handle game-specific logic for:
- Downloading/parsing card data from the source
- Mapping external data to platform attributes
- Managing card images (source URLs and destination paths)
- Supporting multiple languages/variants
- Computing card counts and languages per expansion
The BaseImporter class provides:
- Caching mechanism for downloaded data (
readCache,writeCache,download) - History archiving to S3 (
writeHistory) - Image downloading and processing integration
- Diff generation for incremental updates
- Event loop yielding to prevent blocking during large imports
Example importer implementations can be found at:
packages/games/game-importer/src/lib/mtg/- Magic: The Gatheringpackages/games/game-importer/src/lib/lorcana/- Disney Lorcanapackages/games/game-importer/src/lib/pokemon/- Pokemon TCG
Register the game
- Add game to
SupportedGamesenum inpackages/games/game-configuration/src/lib/game-configuration.types.ts - Export the game configuration from
packages/games/game-configuration/src/index.ts - Register the importer in the game admin service
- Configure game routes and components in the frontend
- Add game assets (icons, images) to the appropriate location
Last updated on