2
3
Fork
You've already forked egg
1
Evolve your Game with Gleam
  • Gleam 60.5%
  • JavaScript 38.8%
  • HTML 0.7%
2025年09月05日 23:19:16 +02:00
be
doc
integration
presentation
shared
ui
.gitignore
README.md

Egg README

After a cool presentation at LangDev'23, I want to recreate Cascade in the BEAM eco system.

Specifically, I am after (im)possibilities and restrictions on live upgrades of running systems. I'm moving towards Event Sourcing, where the model changes and player actions form a linear history, so that game instance can be reconstructed / replayed.

Upon that, the Modeling of game rules is non-trivial, especially as the rules need to be editable.

Content:

  • doc/, contains documentation, including doc/TODO.md
  • backend/ contains the model server (a web server)
  • shared/ contains model definition and conversions
  • ui/ contains user interface (web pages obtained from the backend, that also communicate with the backend)
  • integration/ contains integration tests: launch the web server and interact with web pages
  • presentation/ contains presentation that uses the system

Egg is the umbrella. It is likely that sub-projects will emerge that are more reusable than Egg as a whole.

Install / Run

$ (cd shared; gleam test --target javascript) # Also runs on Erlang target, but compiles slower
$ (cd ui; gleam test --runtime deno; gleam run -m build)
$ (cd backend; gleam test; gleam run) # http(s)://(local)host:3210/
 # spectator: http(s)://(local)host:3030
$ (cd integration; gleam test)
$ (cd presentation; gleam run -m build) # http(s)://(local)host:3000/presentation

The workflow:

  1. First created user will be admin, and only admin, i.e. who can manage users
  2. Admin can make a player ModelEditor
  3. ModelEditor can edit a model
  4. Anyone can Create and run a game
  5. Game creator cannot join that game
  6. All (other) Nonpaying players can join that game
  7. Any changes to the model made, while a game with that model is running, will receive the changes
  8. Game creator starts the game, the players play until the game is finished