GithubHelp home page GithubHelp logo

xingd / monopoly_react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lamarios/monopoly

0.0 0.0 0.0 1.46 MB

Online monopoly game with video chat

License: GNU General Public License v3.0

Shell 0.07% JavaScript 84.86% CSS 1.54% HTML 1.16% Dockerfile 0.45% Less 11.92%

monopoly_react's Introduction

Build Status

Monopoly

This is an online replica of the famous board game, it also has video and text chat.

The game includes little game logic to replicate playing the board game version. Meaning that if you roll the dice, you need to move your token. If you pass through the GO, the person in charge of the bank need to sends you the money. You can make change with other players etc... If you buy a deed, the person in charge of the bank needs to give it to you and you need to send the money to the bank yourself.

A running instance can be found here: https://monop.ftpix.com

This repo is split in two different applications, the game itself and a game launcher. The launcher is a small application to launch new instance of the game container.

The Game

Run

Configuration

The application can run without any environment variables. Note that video chat and microphone access might not work if the software is not running under HTTPS (enabled by default).

Environment variables
Name Description Default Required
PORT Which port to run the application on 8443 No
HTTP_TLS_KEY Path of the SSL key 'key.pem' No (but recommended)
HTTP_TLS_CERTIFICATE Path of the SSL Certificate 'cert.pem' No (but recommended)
HTTP Set to 'true' to disable https. To use if you want to run the game behind a HTTPS reverse proxy for example 'false' No

Docker

docker run -p "8443:8443" gonzague/monopoly

Add environment variables from above relevant for your use case

Node

This require node to run.

First the ui needs to be build

cd game/client
npm install
npm run build

Then we can start the server

cd game
npm install
npm start

The launcher

The launcher is a simple web application that will help launch multiple instances of the game and reverse proxy to the instances. It must be ran as a docker container as it needs to communicate with the game instances that will run as containers.

Run

Configuration

The application needs to be able to talk to a docker host. Note that video chat and microphone access might not work if the software is not running under HTTPS (enabled by default).

Environment variables
Name Description Default Required
PORT Which port to run the application on 8080 No
HTTP_TLS_KEY Path of the SSL key 'key.pem' No (but recommended)
HTTP_TLS_CERTIFICATE Path of the SSL Certificate 'cert.pem' No (but recommended)
HTTP Set to 'true' to disable https. To use if you want to run the launcher behind a HTTPS reverse proxy for example 'false' No
DOCKER_SOCKET The path to the docker socket /var/run/docker.sock No
DOCKER_HOST If connecting to the docker host via http No
DOCKER_PORT The port if connecting to the docker host via http No
DOCKER_NETWORK The network which the new games will be started. It must be the same network as the manager. If not set the reverse proxy to the games is not going to work. YES
GAME_CONTAINER_PREFIX This will be use to prefix the name the new containers monopoly-game No
GAME_TTL How long in hours before killing an inactive game 24 No
MAX_GAMES Maximum number of games to be ran at the same time 500 No
GAME_IMAGE The docker image to be used to run the games gonzague/monopoly No

Docker

If you're connecting to the docker socket directly, otherwise use the DOCKER_HOST and DOCKER_PORT environment variables.

# The network creation is only for the example, you may not need to create it
docker network create monopoly-network
docker run -p "8080:8080" -v "/var/run/docker.sock:/var/run/docker.sock:ro' --network="monopoly-network" -e "DOCKER_NETWORK=monopoly-network" gonzague/monopoly-manager

Add environment variables from above relevant for your use case.

Technology used

  • Nodejs
  • Websockets
  • WebRTC
  • React

monopoly_react's People

Contributors

lamarios avatar dependabot[bot] avatar cabarclay avatar lexnastin 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.