A real-time implementation of the Serbian card game Lora using Elixir and Phoenix LiveView.
Lora is a 4-player card game played with a 32-card deck (7, 8, 9, 10, J, Q, K, A in all four suits). The game consists of 28 deals with 7 different contracts (Minimum, Maximum, Queens, Hearts, Jack of Clubs, King of Hearts plus Last Trick, and Lora), each played 4 times with different dealers.
- Real-time multiplayer gameplay with Phoenix LiveView
- In-memory game state with GenServer
- 7 different contracts with unique rules
- Player reconnection support
- Responsive design for desktop browsers
- Elixir 1.17 or newer
- Phoenix 1.8 or newer
- Phoenix LiveView 1.1 or newer
- Node.js and npm for assets
- Install dependencies:
mix deps.get
cd apps/lora_web/assets && npm install && cd ../../..
- Start the Phoenix server:
mix phx.server
Now you can visit localhost:4000
from your browser.
This project includes a dev container configuration for Visual Studio Code, which provides a consistent development environment.
- Install the Remote - Containers extension for VS Code.
- Open the project folder in VS Code.
- When prompted to "Reopen in Container", click "Reopen in Container".
- Once the container is built and running, the development environment is ready.
- Open a terminal in VS Code and start the Phoenix server:
mix phx.server
mix test
For test coverage:
mix coveralls.html
- Build the Docker image:
docker build -t lora-game .
- Run the container:
docker run -p 4000:4000 -e PHX_HOST=your-domain.com lora-game
This project is licensed under the MIT License - see the LICENSE file for details.