|
|
4 months ago | |
|---|---|---|
| .idea | 4 months ago | |
| css | 4 months ago | |
| data | 4 months ago | |
| html | 4 months ago | |
| js | 4 months ago | |
| server | 4 months ago | |
| src | 4 months ago | |
| tests | 4 months ago | |
| .gitignore | 4 months ago | |
| .postcssrc.json | 1 year ago | |
| README.md | 4 months ago | |
| elm.json | 4 months ago | |
| package-lock.json | 4 months ago | |
| package.json | 4 months ago | |
| requirements.txt | 4 months ago | |
| tailwind.config.js | 1 year ago | |
| update_and_release.sh | 4 months ago |
[!TIP] Access a hosted version of Drafter here.
A web-based assistant for Magic: The Gathering Limited players.
Load your drafts from 17Lands and analyse your picks.
⚠️ Early development
Drafter is pre-alpha software. It's very incomplete. Expect bugs and breaking changes.
| Path | Purpose |
|---|---|
src/ |
Elm source for the front-end UI |
css/, tailwind.config.js |
Tailwind CSS styling |
html/ |
Static HTML entry point served by Parcel |
server/ |
FastAPI backend that exposes set/card endpoints |
data/ |
Raw data files and helper scripts used to generate JSON served by the backend |
Front-end
Back-end
virtualenv or pyenv# clone and enter the repo
# git clone https://github.com/kdelwat/drafter.git
cd drafter
# Front-end deps
npm install
# Back-end deps (inside a venv)
python3 -m venv .venv
source .venv/bin/activate
pip install fastapi uvicorn[standard] httpx
| Service | Command | URL |
|---|---|---|
| UI (Parcel) | npm run start |
http://localhost:1234 |
| API (FastAPI) | uvicorn server.main:app --reload --port 8000 |
http://localhost:8000 |
The UI is configured to call the API on localhost:8000 during development via CORS.
npm run build # outputs static assets to dist/
There are a few frontend tests, run with:
elm-test
Named after the set code, e.g. data/sets/eoe.
Log in to 17lands, go to card data, select the set, premier draft format, and top users, then switch to table view.
Click export and download the CSV file.
Save to data/sets/<CODE>/card-ratings-all.csv
Go to https://scryfall.com/docs/api/bulk-data and download the Oracle Cards JSON file.
Move it to data/cards/oracle-cards.json.
Generate the set data
cd data
python generate_card_ratings.py