Skip to content

2-player MtG draft formats implemented in Clojure(Script).

Notifications You must be signed in to change notification settings

ccann/firedraft

Repository files navigation

Draftwith.me

Draftwith.me is a realtime web application for 2-player Magic: The Gathering draft formats written in Clojure and ClojureScript.

This is not production code. It's a hobby project.

Prerequisites

  • JDK 8+
  • Clojure build tool, Leiningen version 2.0 or higher

If you have homebrew and cask setup:

brew cask install java11
brew install leiningen

Running

To start a web server for the application, run:

lein run

To start a development server for automatic ClojureScript recompilation, run:

lein figwheel

Visit http://localhost:3000 and your changes will be automatically recompiled and updated in the browser.

Libraries

This project was created with the Clojure web framework Luminus, which is really just a collection of libraries. I generated the project via: lein new luminus draftwithme +reagent +site +http-kit.

Beyond the standard libraries chosen and pulled in by Luminus, these are the libraries I added / chose:

  • HTTP Kit: A pure clojure web server. I chose this over Jetty because it has websocket support and I hit an issue with Aleph that I didn't feel like resolving.
  • Reagent: a CLJS React wrapper. I chose not to use ReFrame because the scope of this application is quite small and I don't know it as well.
  • Sente: a websockets and HTTP long-polling library. Chosen over Server Sent Events because Sente is a rather mature API.

It's also worth mentioning that Luminus comes with the Bulma framework for CSS.

External Resources

  • MTGJSON is used to get the scryfall IDs and other metadata about cards in a set.
  • Scryfall is used to get card images and set metadata.

Backlog

This project is tracked in a Notion Kanban board.

Contributing

Please follow the official Clojure Style Guide when writing code.

I would also recommend installing CLJ Kondo:

brew install borkdude/brew/clj-kondo

And subsequently integrating it with your editor.

If you'd like to spin up a local REPL for development please refer to the Luminus documentation. You can start with lein repl (or lein rebl for an enhanced version via Rebel Readline).

About

2-player MtG draft formats implemented in Clojure(Script).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published