Demon Spirit, an abstract board game on a 5x5 grid served over the web. You can play against other players or a computer AI with programmable difficulty. Built in Elixir, Phoenix, and Phoenix Live View.
mix deps.get
cd ./apps/demon_spirit_web/assets
npm install
cd ../../../
mix phx.server
Visit http://localhost:4000 in web browser
./test_prod.sh
# Visit http://localhost:4000 in your browser
This will create a new docker image named demon-spirit:test
, and run it,
published to port 4000 on localhost.
Create a Docker Image:
edit build.sh with your favorite text editor - change docker tag to your namespace
./build.sh
Run the docker image via your favorite method. Expose port 4000 to anywhere you want, typically 80. Since it doesn't require a database, that's all you need.
Run mix check
to run all tests and linting.
Newest version is deployed at https://demonspirit.xyz/.
Some issues are tracked in Issues.MD.
-
DemonSpiritGame.*
Game logic. All functions for tracking and changing game state.
-
DemonSpiritWeb.*
Phoenix app that will allow users to play the game online. Uses Phoenix LiveView.
-
DemonSpirit
If the web app ever tracks user accounts, win records, etc, the data models and associated functions will be here. Current implementation is anonymous sessions only.
-
Lessons Learned
If I were making this app again, I don't think I would use an umbrella project. I'm not sure the apps are separated cleanly enough to warrant it.
Current view:
To report metrics to honeycomb.io, set these environment variables when running:
- HONEYCOMB_APIKEY
- HONEYCOMB_DATASET
Example:
export HONEYCOMB_APIKEY="012345678912345678abcde123456789"
export HONEYCOMB_DATASET="demonspirit-elixir"