An expanded version of miltydraft.com, with saving/sharing drafts across sessions.
- make sure you have docker installed
To install a local copy of this app you can clone it from the Git Repo:
git@github.com:shenanigans-be/miltydraft.git
Then follow these steps:
- Add
127.0.0.1 milty.localhostto your/etc/hostsfile. This first step is optional though. You can use 127.0.0.1 directly as well. - Run
docker compose up -d --build. This will first build the image, then start all services. - Run
docker compose exec app composer install. This will install all php dependencies. - Create a
.envfile. See.env.examplefor details. - Go to https://milty.localhost in your browser (or http://localhost if you don't want to go through the hassle of the following steps)
- Your browser might give you some scary warnings about untrusted certificates. That's because we're using a self-signed certificate. If you want to, you can add the certificate to your device's truster certificate.
- Run
docker compose exec app cat /home/app/.local/share/caddy/pki/authorities/local/root.crt > caddy-cert.crtto make a copy of the certificate incaddy-cert.crt(which you can then import wherever you need it)
Frontend runs on vanilla JS/jQuery (I'm aware jQuery is a bit of a blast from the past at this point; sue me and/or change it and PR me if you want) and the Back-end is vanilla PHP. As such there's no build-system, or compiling required except for the steps described above.
To make this app as lean and mean (and easy to understand for anyone) as possible, external dependencies, both in the front- and backend should be kept to an absolute minimum.
- Players come in on index.php and choose their options.
- A JSON config file is created (either locally or remotely, depending on .env settings) with a unique ID
- That Draft ID is also the Draft URL: APP_URL/d/{draft-id} (URL rewriting is done via Caddy locally)
- Players (or the Admin) make draft choices, which updates the draft json file (with very loose security, since we're assuming a very low amount of bad actors)