This is a two-player version of Riichi Mahjong.
See http://pwmarcz.pl/minefield/ (where the project is currently deployed) for more details.
The project is available under MIT license. See COPYING for more details.
For frontend, node.js and yarn is required.
For backend, Rust and Cargo.
Install libraries:
$ make
Make targets are:
make static
- recompile static assetsmake watch
- recompile static assets on each changemake serve
- serve the website in development modemake bot
- run bot
$ make watch
$ make serve
then browse to localhost:8080
.
make test
- run server testsmake test_js
- run JavaScript testsmake watch_test_js
- run JavaScript tests on each change
make env
- build virtualenvmake test_py
- run testsmake serve_py
- serve the website in development mode
Minefield is currently a static web page plus a WebSocket server. To deploy Minefield, you need to:
- copy files (see
make sync
), - run
minefield-server
(and possiblyminefield-bot
) - serve the static files under a given location, for instance
/minefield/
, - serve the WebSocket under the
ws
path, for instance/minefield/ws
.
Here's an example configuration for nginx:
location /minefield {
/path/to/minefield/client/static;
}
location /minefield/socket.io {
proxy_pass http://127.0.0.1:8080/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Prevent dropping idle connections
proxy_read_timeout 7d;
}