A multilingual card database and personal collection tracker. Card data comes from MTGJSON, set icons and release dates from Scryfall. Users sign in with Discord.
- PHP 8.4.1+ —
ctype,curl,dom,filter,gmp,iconv,intl,json,mbstring,pdo_mysql,redis,xml,zip - MariaDB 10.6+
- Redis
- Node and pnpm
- Symfony CLI, optional — picks the PHP version
from
.php-version
git clone git@github.com:ThauEx/colorless-mana.git
cd colorless-mana
symfony composer install
pnpm install
pnpm run buildCreate a .env.local with:
APP_ENV=prod
APP_SECRET=
DATABASE_URL="mysql://user:password@127.0.0.1:3306/colorless_mana?serverVersion=mariadb-12.3.3"
REDIS_URL=redis://localhost
OAUTH_DISCORD_CLIENT_ID=
OAUTH_DISCORD_CLIENT_SECRET=
SENTRY_DSN=serverVersion has to match the running database, Doctrine generates its SQL
for that version.
On an empty database the migrations do not apply — they continue an older schema. Create it from the mappings and mark them as done:
symfony console doctrine:schema:create
symfony console doctrine:migrations:version --add --allOtherwise:
symfony console doctrine:migrations:migratepnpm run dev # development build
pnpm run watch # rebuild on change
pnpm run build # production buildpublic/build/ is not in version control. Where the server has no Node
toolchain, build locally and copy the directory across.
symfony console mtgjson:import:cards path/to/AllPrintings.json
symfony console mtgjson:import:prices path/to/AllPrices.json
symfony console mtgjson:sync:sets # set codes and release dates only
symfony console mtgjson:cleanup:stale-cards # dry run; --force to applyThe card import matches by Scryfall id, updating existing cards and creating
missing ones, and refreshes the sets table along the way. The cleanup removes
card rows the last import did not touch, which are leftovers from changed
MTGJSON uuids.
Both dumps are also available gzipped:
curl -fsSL https://mtgjson.com/api/v5/AllPrintings.json.gz | gunzip > AllPrintings.jsonsymfony php vendor/bin/phpunitUnit tests only, no database or kernel required.
docs/card-finishes.md describes how foil types are modelled: the finishes, the rules for deriving them from MTGJSON, the exceptions, and the "★" convention for foil-only variants.