Skip to content

npaulsen/eumel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eumel

Blazor WebAssembly App for playing cards. The game Eumel has various names and is a little bit like Wizard (but without wizards 😆). See also Oh Hell on wikipedia.

Why

  • ♠️ ♦️ I like the simple game concept and wanted to try playing it remotely with my family (2020 etc)
  • Learn / Evaluate Blazor WebAssembly
  • Practice applying different designs/architecture styles, like more immutables and event sourcing

Screenshots

Playing in the command line:

console game screenshot

"Lobby browser" view with all games:

lobby browser screenshot

Gameplay on mobile:

gameplay screen capture

Quickstart 🐌

The quickest way to get started is using a VS Code devcontainer setup.

The devcontainer comes with the dotnet SDK and some preinstalled VS Code extensions (additional containers are started to host a local PostgreSQL database and pgAdmin to inspect it in the browser).

Prerequisites

Get started

  • When you open the repo in VS Code, the remote extension will suggest reopening the workspace in a container. Do it :)
  • open a new integrated terminal of type zsh, run dotnet run src/Console to play against two bots.
  • to start the whole app, first migrate the local db with dotnet ef database update --project src/Persistence. Then you can start the server with ctrl+F5 (or dotnet run src/Server)

Overview of the code

Projects in the repo

  • Eumel.Core contains inner logic of the game flow. The whole game state (players, cards, points) is only changed through events, the goal was to keep as much of the code here side-effect free as possible. But it also has classes with state that dispatch the events and manage the 'game flow'.
    • the core is (meant to be) persistence and infrastructure agnostic. Not by abstracting those details away into interfaces, but really, really agnostic.
  • Eumel.Console was the first user interface and is meant as an example/test for reusability of the Core without any workarounds.
  • Eumel.Shared defines some DTOs and interfaces for client/server communication but is not depending on any protocol/library.
  • Eumel.Client is a blazor WASM app that defines some blazor components, pages using them and a GameClient service that uses SignalR for bidirectional communication with the server.
  • Eumel.Persistence knows how to persist games/rooms and game events. Is using EF core (probably not that well 🙈) to put everything in a PostgreSQL db.
  • Eumel.Server defines an ASP api (currently only a game room controller) and the SignalR Hub. Running games are managed and loaded into memory (until the server breaks down :)). Observed Events from games are forwarded to the SignalR clients and also persisted.

Tests

.. are not so many, have a look yourself. For integration testing, a second db is prepared in the postgres container.

TODOs

... Are here

References

About

Blazor WebAssembly App for playing cards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published