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.
♠️ ♦️ 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
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).
- Docker Desktop
- VS Code with the extension Remote - Containers (
ms-vscode-remote.remote-containers
)
- 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
, rundotnet 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 withctrl
+F5
(ordotnet run src/Server
)
- 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.
.. are not so many, have a look yourself. For integration testing, a second db is prepared in the postgres container.
... Are here