Giter VIP home page Giter VIP logo

duel-masters's Introduction

duel-masters

duel-masters is a multiplayer simulator for the Duel Masters Trading Card Game for play in the browser.

It aims to simulate how you would be playing the card game in real life, but with enforced rules and automations for the effects of each individual card.

Run with docker

# Login to the github package registry
docker login ghcr.io

# Run the container
docker run -d \
    --name duel-masters \
    --restart unless-stopped \
    -p 80:80 \
    -e port=80 \
    -e mongo_name=<mongodb_name> \
    -e mongo_uri=<mongodb_connection_string> \
    ghcr.io/sindreslungaard/duel-masters/production:latest

Setting up for development

Run the server, webapp and db locally (recommended)

  1. Fork the duel-masters repo on GitHub.
  2. Clone your fork locally:
git clone https://github.com/sindreslungaard/duel-masters.git
  1. Set up MongoDB locally or use a cloud provider.
  2. Create a .env file based on the .env.default file in the repository. Example:
port=80
mongo_uri=mongodb://127.0.0.1:27017
mongo_name='duel-masters'
restart_after=
  1. Navigate to the webapp directory and run npm install. Then run either npm run build or npm run watch to build or watch the files.

  2. Run the application. If you're using Vscode simply hit F5 or Run -> Start Debugging. To run manually use go run cmd/duel-masters/main.go. Note that debugging with vscode will automatically pick up environment variables from the .env file. If you're not using vscode's debug mode or if you use a different editor you will have to set up the environment variables yourself.

  3. Go to http://localhost and create a user as well as a deck. To set the deck as a standard deck, find it in MongoDB and change the standard field to true.



Run only the webapp locally

  1. git clone https://github.com/sindreslungaard/duel-masters.git

  2. Navigate to the webapp directory and run npm install and npm run serve

  3. Override your host config

localStorage.setItem(
    "config",
    JSON.stringify({
        host: "shobu.io",
        ws_protocol: "wss://",
        api: "https://shobu.io/api"
    })
)



Run the server, webapp and db locally with docker compose

  1. Fork the duel-masters repo on GitHub.
  2. Clone your fork locally:
git clone https://github.com/sindreslungaard/duel-masters.git
  1. go into your cloned directory
  2. Start the containers via:
docker compose up --build
  1. Go to http://localhost:9080 and create a user and a deck



Development tips

For testing cards locally there is a neat chat command that spawns in any card to the hand of the persons turn it is even if it's not in your deck /add {cardUid} (e.g /add 4459f97b-8927-4231-a11d-f4f88175b71c). The card uid can be found in repository.go.

To add all cards from your hand to the mana zone, use /mana

To get access to the command you need to add the role admin to the permissions array on your user in the database.

Changelog

A changelog starting from 11/11/2021 can be found here

duel-masters's People

Contributors

astroprojection avatar cristidospra avatar dependabot[bot] avatar eirikbjornr avatar fabiantmc avatar fightlapa avatar gaurav281296 avatar jyotiskaghosh avatar karbulot avatar pablopenna avatar severinkaderli avatar sindreslungaard avatar thomasschmidtgf avatar tydefriz avatar vasyop avatar verified-sindre avatar zayberex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.