About this project

OpenMTG is a self-hosted web application for managing a Magic: The Gathering card collection. It targets individuals and small groups who want card inventory, decks and pricing data to stay on their own server rather than in a hosted service. Collection management lets users add cards by name through fuzzy Scryfall search and record quantity, condition, foil status, language, price and set printing. Prices refresh automatically from Scryfall at a configurable interval and rate limit (defaults are a 72-hour refresh and 2 requests per second). Collections and decks can be imported and exported in multiple formats, and deck lists from Moxfield, MTGO or Arena can be pasted in to create a populated deck in one step with a per-card progress indicator. The deck builder supports mainboard, sideboard and commander zones, plus a deck analysis view covering deck CMC, mana curve and color distribution. A statistics page breaks the collection down by rarity, color, type, condition, set and estimated value. A wishlist tracks current price, 90-day price history and alerts when cards drop below a target price. Other features include admin-managed multi-user accounts with isolated collections, card trading between users on the same instance with confirmation from both sides before cards transfer, loan tracking with a recipient name and date, front and back card photo uploads, favorites, a quick-add flow, USD and EUR support plus admin-defined currencies with automatic rate refresh, and a public Showroom page that shows only explicitly selected cards and decks and can be disabled per instance. An optional Home Assistant integration pushes trade and wishlist alerts through per-user webhooks and exposes live collection stats via a bearer-authenticated pull endpoint; it is admin-gated and off by default. The stack is Python 3.14 with FastAPI, SQLAlchemy and Alembic on the backend, and React with Vite and TanStack Query on the frontend. Storage is PostgreSQL 16 or SQLite, determined by which Compose file is used and fixed at first-time setup. Nginx acts as reverse proxy, and deployment is via Docker and Docker Compose, listening on port 8080 by default. Configuration is handled through an .env file and an admin settings panel, and database migrations run automatically on startup. Telemetry is opt-in and anonymous, and can be disabled with the NOTEL environment variable. The project is licensed under AGPL-3.0; an admin account is created on first launch, after which only admins create additional users.