Skip to content

exponentially/lora

Repository files navigation

Lora Card Game

A real-time implementation of the Serbian card game Lora using Elixir and Phoenix LiveView.

About the Game

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.

Features

  • 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

Requirements

  • Elixir 1.17 or newer
  • Phoenix 1.8 or newer
  • Phoenix LiveView 1.1 or newer
  • Node.js and npm for assets

Development Setup

Option 1: Local Setup

  1. Install dependencies:
mix deps.get
cd apps/lora_web/assets && npm install && cd ../../..
  1. Start the Phoenix server:
mix phx.server

Now you can visit localhost:4000 from your browser.

Option 2: Using Dev Containers (Recommended)

This project includes a dev container configuration for Visual Studio Code, which provides a consistent development environment.

  1. Install the Remote - Containers extension for VS Code.
  2. Open the project folder in VS Code.
  3. When prompted to "Reopen in Container", click "Reopen in Container".
  4. Once the container is built and running, the development environment is ready.
  5. Open a terminal in VS Code and start the Phoenix server:
mix phx.server

Running Tests

mix test

For test coverage:

mix coveralls.html

Deployment

Using Docker

  1. Build the Docker image:
docker build -t lora-game .
  1. Run the container:
docker run -p 4000:4000 -e PHX_HOST=your-domain.com lora-game

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published