Geen omschrijving

Cadel Watson 2266622c76 Update .gitignore 4 maanden geleden
.idea 4a1545bb91 Remove data files 4 maanden geleden
css 01e5d152c2 Improve styles and navigation; add mobile warning 4 maanden geleden
data 4d2a94be31 Remove data files 4 maanden geleden
html 2683cffca0 Add docs 4 maanden geleden
js 01e5d152c2 Improve styles and navigation; add mobile warning 4 maanden geleden
server 8d0e5ab45a Update for deployment 4 maanden geleden
src 8d0e5ab45a Update for deployment 4 maanden geleden
tests 9339ad2982 Load draft from 17lands public URL 4 maanden geleden
.gitignore 2266622c76 Update .gitignore 4 maanden geleden
.postcssrc.json 0c4311efc0 Show highlighted card 1 jaar geleden
README.md 2683cffca0 Add docs 4 maanden geleden
elm.json 3f2d7f6622 WIP: load drafts straight from 17lands 4 maanden geleden
package-lock.json a1e4bd2949 Add card explorer 4 maanden geleden
package.json a1e4bd2949 Add card explorer 4 maanden geleden
requirements.txt 2683cffca0 Add docs 4 maanden geleden
tailwind.config.js 60a32d54c9 Colourise stats 1 jaar geleden
update_and_release.sh afacf2e742 Add release script 4 maanden geleden

README.md

Drafter

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.


Project structure

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

Prerequisites

Front-end

  • Node ≥ 14 and npm (or yarn)

Back-end

  • Python ≥ 3.10
  • (Recommended) virtualenv or pyenv

Running locally

1. Clone & install

# 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

2. Start development servers

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.

3. Build for production (optional)

npm run build   # outputs static assets to dist/

4. Running tests

There are a few frontend tests, run with:

elm-test

Generating & adding new set data

  1. Create a new folder in data/sets

Named after the set code, e.g. data/sets/eoe.

  1. Download card ratings

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

  1. Download updated card data from Scryfall

Go to https://scryfall.com/docs/api/bulk-data and download the Oracle Cards JSON file.

Move it to data/cards/oracle-cards.json.

  1. Generate the set data

    cd data
    python generate_card_ratings.py